summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qlineedit.cpp2
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp3
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp3
-rw-r--r--src/widgets/widgets/qmenubar.cpp11
-rw-r--r--src/widgets/widgets/qsplitter.cpp4
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp46
6 files changed, 21 insertions, 48 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 5926476470..29c8a42cad 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -64,6 +64,8 @@
#include "qdebug.h"
#include "qtextedit.h"
#include <private/qtextedit_p.h>
+#include <private/qwidgettextcontrol_p.h>
+
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 68be82c71d..7c5ba79cb6 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -536,7 +536,8 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
// If there is a 'before' action, it takes preference
// There's a bug in GHS compiler that causes internal error on the following code.
- // The affected GHS compiler versions are 2016.5.4 and 2017.1
+ // The affected GHS compiler versions are 2016.5.4 and 2017.1. GHS internal reference
+ // to track the progress of this issue is TOOLS-26637.
// This temporary workaround allows to compile with GHS toolchain and should be
// removed when GHS provides a patch to fix the compiler issue.
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 63b6bcfaef..98421588a7 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -2330,6 +2330,9 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
}
#endif
+#if !QT_CONFIG(dockwidget) || !QT_CONFIG(tabbar)
+ Q_UNUSED(group);
+#endif
layoutState.unplug(path ,&savedState);
savedState.fitLayout();
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 77ed7a4f78..c16b2a5ac1 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -1470,6 +1470,17 @@ bool QMenuBar::eventFilter(QObject *object, QEvent *event)
}
}
+ if (isNativeMenuBar() && event->type() == QEvent::ShowToParent) {
+ // On some desktops like Unity, the D-Bus menu bar is unregistered
+ // when the window is hidden. So when the window is shown, we need
+ // to forcefully re-register it. The only way to force re-registering
+ // with D-Bus menu is the handleReparent method.
+ QWidget *widget = qobject_cast<QWidget *>(object);
+ QWindow *handle = widget ? widget->windowHandle() : nullptr;
+ if (handle != nullptr)
+ d->platformMenuBar->handleReparent(handle);
+ }
+
if (style()->styleHint(QStyle::SH_MenuBar_AltKeyNavigation, 0, this)) {
if (d->altPressed) {
switch (event->type()) {
diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp
index e6332293e4..e92347c65c 100644
--- a/src/widgets/widgets/qsplitter.cpp
+++ b/src/widgets/widgets/qsplitter.cpp
@@ -1798,9 +1798,9 @@ QTextStream& operator>>(QTextStream& ts, QSplitter& splitter)
QString line = ts.readLine();
line = line.simplified();
line.replace(QLatin1Char(' '), QString());
- line = line.toUpper();
+ line = std::move(line).toUpper();
- splitter.restoreState(line.toLatin1());
+ splitter.restoreState(std::move(line).toLatin1());
return ts;
}
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index 9e848ca834..0d34fae78f 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -1144,52 +1144,8 @@ void QWidgetTextControl::processEvent(QEvent *e, const QMatrix &matrix, QWidget
case QEvent::ShortcutOverride:
if (d->interactionFlags & Qt::TextEditable) {
QKeyEvent* ke = static_cast<QKeyEvent *>(e);
- if (ke->modifiers() == Qt::NoModifier
- || ke->modifiers() == Qt::ShiftModifier
- || ke->modifiers() == Qt::KeypadModifier) {
- if (ke->key() < Qt::Key_Escape) {
- ke->accept();
- } else {
- switch (ke->key()) {
- case Qt::Key_Return:
- case Qt::Key_Enter:
- case Qt::Key_Delete:
- case Qt::Key_Home:
- case Qt::Key_End:
- case Qt::Key_Backspace:
- case Qt::Key_Left:
- case Qt::Key_Right:
- case Qt::Key_Up:
- case Qt::Key_Down:
- case Qt::Key_Tab:
- ke->accept();
- default:
- break;
- }
- }
-#ifndef QT_NO_SHORTCUT
- } else if (ke == QKeySequence::Copy
- || ke == QKeySequence::Paste
- || ke == QKeySequence::Cut
- || ke == QKeySequence::Redo
- || ke == QKeySequence::Undo
- || ke == QKeySequence::MoveToNextWord
- || ke == QKeySequence::MoveToPreviousWord
- || ke == QKeySequence::MoveToStartOfDocument
- || ke == QKeySequence::MoveToEndOfDocument
- || ke == QKeySequence::SelectNextWord
- || ke == QKeySequence::SelectPreviousWord
- || ke == QKeySequence::SelectStartOfLine
- || ke == QKeySequence::SelectEndOfLine
- || ke == QKeySequence::SelectStartOfBlock
- || ke == QKeySequence::SelectEndOfBlock
- || ke == QKeySequence::SelectStartOfDocument
- || ke == QKeySequence::SelectEndOfDocument
- || ke == QKeySequence::SelectAll
- ) {
+ if (isCommonTextEditShortcut(ke))
ke->accept();
-#endif
- }
}
break;
default: