From 50be124f169f26ba5c94515f520b018e7fbe7da4 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 10 Jul 2018 09:44:19 +0200 Subject: QSplashScreen: Pass the layout direction set on widget to the painter Change-Id: I6adc9f6fd77b6e9f9387393884e13285f4452018 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qsplashscreen.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp index 468fc272b5..44b9f7d9a1 100644 --- a/src/widgets/widgets/qsplashscreen.cpp +++ b/src/widgets/widgets/qsplashscreen.cpp @@ -343,6 +343,7 @@ bool QSplashScreen::event(QEvent *e) if (e->type() == QEvent::Paint) { Q_D(QSplashScreen); QPainter painter(this); + painter.setLayoutDirection(layoutDirection()); if (!d->pixmap.isNull()) painter.drawPixmap(QPoint(), d->pixmap); drawContents(&painter); -- cgit v1.2.3 From a832e3773a3cbc51c6cd54d50ccd37be66aa300a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 29 Jun 2018 13:31:41 +0200 Subject: Show the toolbutton's menu in the right place on multiple screens When a screen is positioned to be above another, then the toolbutton menu could be shown on the wrong screen if it was deemed to not fit below the button the same screen. This ensures that it shows it on the right screen when there is sufficient space to do so. Change-Id: Ia626b28f74c1931904ff5b30cca17e63914d3c79 Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qtoolbutton.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp index c94c10574f..03950ef44b 100644 --- a/src/widgets/widgets/qtoolbutton.cpp +++ b/src/widgets/widgets/qtoolbutton.cpp @@ -756,14 +756,14 @@ void QToolButtonPrivate::popupTimerDone() QSize sh = ((QToolButton*)(QMenu*)actualMenu)->receivers(SIGNAL(aboutToShow()))? QSize() : actualMenu->sizeHint(); if (horizontal) { if (q->isRightToLeft()) { - if (q->mapToGlobal(QPoint(0, rect.bottom())).y() + sh.height() <= screen.height()) { + if (q->mapToGlobal(QPoint(0, rect.bottom())).y() + sh.height() <= screen.bottom()) { p = q->mapToGlobal(rect.bottomRight()); } else { p = q->mapToGlobal(rect.topRight() - QPoint(0, sh.height())); } p.rx() -= sh.width(); } else { - if (q->mapToGlobal(QPoint(0, rect.bottom())).y() + sh.height() <= screen.height()) { + if (q->mapToGlobal(QPoint(0, rect.bottom())).y() + sh.height() <= screen.bottom()) { p = q->mapToGlobal(rect.bottomLeft()); } else { p = q->mapToGlobal(rect.topLeft() - QPoint(0, sh.height())); -- cgit v1.2.3 From 4ebe4f4b727ee374fe5d5465f065ec1570fe3090 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Wed, 11 Jul 2018 15:35:16 +0200 Subject: Doc: Explain emission of QAction::changed on calling QAction::toggle Extend description of QAction::checked() and QAction::toggled(), as it is not clear from the documentation that calling QAction::toggle causes the emission of a QAction::changed signal. Task-number: QTBUG-68213 Change-Id: I5afa4d9a6e6f001dff81271d1e34d0c515da3c24 Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qaction.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index 0ef4ed0634..8a359346c9 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -968,7 +968,10 @@ void QAction::toggle() Only checkable actions can be checked. By default, this is false (the action is unchecked). - \sa checkable + \note The notifier signal for this property is toggled(). As toggling + a QAction changes its state, it will also emit a changed() signal. + + \sa checkable, toggled() */ void QAction::setChecked(bool b) { @@ -1190,7 +1193,8 @@ void QAction::activate(ActionEvent event) This signal is emitted whenever a checkable action changes its isChecked() status. This can be the result of a user interaction, - or because setChecked() was called. + or because setChecked() was called. As setChecked() changes the + QAction, it emits changed() in addition to toggled(). \a checked is true if the action is checked, or false if the action is unchecked. -- cgit v1.2.3 From 2d20342c996ad7f1919f1329fde57d2edc367147 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Fri, 13 Jul 2018 14:18:51 +0200 Subject: Doc: Remove redundant \code The preceding snippet contains the same line of code. It is unclear why this line is repeated, and it does not seem to serve a purpose. This patch removes the line of code and the QDoc command used to set it apart from the preceding snippet. Task-number: QTBUG-56772 Change-Id: I400b22aa75ee4542bfb67f7e47e3c31c577a39e5 Reviewed-by: Martin Smith --- src/widgets/kernel/qaction.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index 8a359346c9..1ca5514655 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -232,10 +232,6 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map) the action. For example: \snippet mainwindows/application/mainwindow.cpp 19 - \codeline - \code - fileMenu->addAction(openAct); - \endcode We recommend that actions are created as children of the window they are used in. In most cases actions will be children of -- cgit v1.2.3 From 6f81dbe674c8277bb080e026432a1a0453653678 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 12 Jul 2018 14:32:00 +0300 Subject: QLineEdit: Fix behavior of DeleteStartOfWord key DeleteStartOfWord key behaves like Delete key when the cursor is at the beginning of the line. Do nothing instead. Task-number: QTBUG-65855 Change-Id: I56402961b44ec6fe3a382df68a76db36891c4522 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qwidgetlinecontrol.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 623ca5b0a1..c4a928410b 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -1840,7 +1840,8 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) else if (event == QKeySequence::DeleteStartOfWord) { if (!isReadOnly()) { cursorWordBackward(true); - del(); + if (hasSelectedText()) + del(); } } else if (event == QKeySequence::DeleteCompleteLine) { if (!isReadOnly()) { -- cgit v1.2.3 From b0797cfed63d14707249a85e09c03177595a4df8 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Thu, 5 Jul 2018 12:41:28 +0200 Subject: QCalendarWidget: update the year label correctly on locale change The year label in the header would show an unlocalized year number. Fix by setting it equal to the year editor's correctly localized string. Task-number: QTBUG-69038 Change-Id: I87148c607b8fb498c57bcf59bc175154c9e445d1 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qcalendarwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 9559b58339..4946969360 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -1946,8 +1946,8 @@ void QCalendarWidgetPrivate::updateNavigationBar() QString monthName = q->locale().standaloneMonthName(m_model->m_shownMonth, QLocale::LongFormat); monthButton->setText(monthName); - yearButton->setText(QString::number(m_model->m_shownYear)); yearEdit->setValue(m_model->m_shownYear); + yearButton->setText(yearEdit->text()); } void QCalendarWidgetPrivate::update() -- cgit v1.2.3