summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-051-0/+4
|\ | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/minimum-linux.S src/network/access/qhttpthreaddelegate.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Id2e817e85f85c68f5482c9a12912d35590f9d5f8
| * Fix -no-opengl buildTimur Pocheptsov2017-10-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | A follow-up patch for 8e70241dccaf5a9e5c79c8d6da5665b881c5914d: Make 'shareContext' conditionally included/compiled (protected by QT_CONFIG(opengl)). Change-Id: Ieaeea6b146b47fba7a77e2576ae0a33042280199 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Remove references to obsolete platformsJake Petroules2017-11-052-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ultrix and reliant have not seen a release since 1995. dgux not since 2001. bsdi not since 2003. irix not since 2006. osf not since 2010. dynix... unclear, but no later than 2002. symbian needs no mention. All considered obsolete, all gone. sco and unixware are effectively obsolete. Remove them until someone expresses a real need. Change-Id: Ia3d9d370016adce9213ae5ad0ef965ef8de2a3ff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | qwidgetwindow: remove seemingly stray QApplicationPrivate::mouse_buttonsGatis Paeglis2017-10-271-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes mouse_buttons related code from qwidgetwindow.cpp as it does not belong there for the following reasons: - The commit (ed2a2dc6dae0a2523cecfd272609d322ace16145) that added it in Qt5 says that the logic was copied from qapplication_x11.cpp (filename in Qt4 repository). Other qapplication_*.cpp platform implementations did not have this kind of logic; thus having it in cross platform location qwidgetwindow.cpp does not make sense. - According to the documentation, QApplicationPrivate::mouse_buttons: "Returns the current state of the buttons on the mouse. The current state is updated synchronously as the event queue is emptied". So the only place where changing this variable makes sense is in QGuiApplicationPrivate::processMouseEvent, which is *when the event queue is emptied*. There are other places in source code where this variable is changed, but all of those are hacks and should be cleaned out eventually: // a hack due to insufficient QWindowSystemInterface API plugins/platforms/windows/qwindowsdrag.cpp // a hack to support code that bypasses QWSI API when sending mouse events // via qApp->notify(). widgets/kernel/qapplication.cpp - AFACT, the released button bit will be already unset by the time mouse release event reaches QWidgetWindow::handleMouseEvent. Change-Id: Ifb2b3b443ffff0274545e5d3c631cf1e77160502 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QWidgetTextControl: allow context menu to open for a QTextEdit with ↵Richard Moe Gustavsen2017-10-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt::NoFocus set Currently a context menu will only open when right-clicking on a text edit that has input focus. This means that you cannot e.g bring up the context menu to copy text for a text edit that doesn't accept input focus (but you are still allowed to select text with the mouse, which feels a bit contradictory). This is different from how QLineEdit works, and also different compared to how native applications work, at least after testing on macOS and Ubuntu. This patch will change this behavior, so that the context menu always open on both QPlainTextEdit and QTextEdit, even when they don't accept focus. Task-number: QTBUG-63868 Change-Id: Ibc4cbcc900077546828690ddc958820677211a5a Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-10-2411-13/+12
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsmousehandler.cpp src/plugins/platforms/xcb/qxcbimage.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/manual/qtabletevent/regular_widgets/main.cpp Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Done-with: Mårten Nordheim<marten.nordheim@qt.io> Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-231-1/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/direct2d/direct2d.pro src/plugins/platforms/ios/qiosclipboard.mm src/plugins/platforms/windows/windows.pro Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
| | * QShortcut: Fall back to cross platform code in absence of QPA menuGabriel de Dietrich2017-10-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On macOS, absence of a QPA menu means that we should be using our own internal logic since there's no entity on the QCocoaMenuDelegate to take care of the shortcuts. Change-Id: I35ed8f0b55445f61d0528709d4debb636a502002 Task-number: QTBUG-61039 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | Fix implementation of spell check underline stylesDmitry Shachnev2017-10-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QTextCharFormat documentation said that the used style is based on QStyle::SH_SpellCheckUnderlineStyle style hint, however in fact the implementation (drawTextItemDecoration in qpainter.cpp) uses themeHint(QPlatformTheme::SpellCheckUnderlineStyle) instead since Qt 5 (see commit 1f9ae50457a3750f). Make the documentation match that behavior, and update QPlatformTheme to use the correct default value. Also, switch Cocoa theme to use DotLine, as that is what native macOS applications use. Change-Id: I2a6bb3da6c7b0686dca87ed2c251b6abc006123c Task-number: QTBUG-50499 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| * | MinGW: Globally define WINVER and _WIN32_WINNT to enable Windows 7 APIOrgad Shaneh2017-10-191-2/+0
| | | | | | | | | | | | | | | Change-Id: I637b33ba6d05f40486d8da927ae5cc5148299348 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | QAbstractItemView: Make it easier to drop above and below itemsThorbjørn Lund Martsum2017-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch a very accurate drop position below or above an index was needed. Therefore it was not that easy to do. This patch increases the above/below area to be about 18% of the item (still leaving the most space for the item). An average user will likely be 2-3x faster with dropping below or above (while not losing much when dropping on items). [ChangeLog][QtWidgets][ItemViews] Made it easier to drop above and below items. Change-Id: I47f0f80c76878c17ebf3f93d0a0cc82755971c2a Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | Doc: qtwidgets index page: wrong name for image fileNico Vertriest2017-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | windowsvista-treeview.png --> windows-treeview.png Change-Id: I19ccec1ff5fadf2107ad47109d65f170df4b0505 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | Doc: correct filename png filesNico Vertriest2017-10-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | qpushbutton.h:55: warning: Missing image: windows-pushbutton.jpg widgets.qdoc:28: warning: Missing image: windowsvista-treeview.png Change-Id: I2ebf2aa809f8d532f597624f6ed2f9d636e860a6 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | Doc: replace screenshot widgets tutorial with more updated versionNico Vertriest2017-10-181-0/+0
| | | | | | | | | | | | | | | Change-Id: I2b4fcd02c13fcd6569ebf035197da361aba40afd Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Liang Qi2017-10-173-3/+3
| |\ \ | | | | | | | | | | | | refs/staging/5.10
| | * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-163-3/+3
| | |\| | | | | | | | | | | | | Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
| | | * QSystemTrayIcon/Windows: Fix position of context menu with High DPI scalingFriedemann Kleint2017-10-161-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply scale factor of screen. Task-number: QTBUG-63781 Change-Id: I1b5630edbdf6bb356955a7d70458a885af441953 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| | | * Remove some unused, local variablesJędrzej Nowacki2017-10-142-2/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: I453162d2d396bb3427064d3b1593bb6c71376605 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | | * QDockWidget - improve resizeThorbjørn Lund Martsum2017-10-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On high DPI (e.g Apple Retina) user resizes of QDockWidgets (with custom titlebars) could fail. There was a cursor position check in mouse move event bailing out if the cursor pos was not within the widget. The problem was that we could be on the edge (or maybe even cross it?). Furthermore there is (/was) no similar check when setting the cursor to be a resize cursor, so users will obviously expect the resize to occur. This solves a part of QTBUG-63526 [ChangeLog][QtWidgets][QDockWidget] Fixed an issue in QDockWidgets where the widget would not resize despite showing a resize cursor. Task-number: QTBUG-63526 Change-Id: Ifa842a109071552506da3a82822d903dc252c8cd Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-1716-147/+236
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/fortuneclient/client.cpp examples/network/fortuneserver/server.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h src/plugins/platforms/cocoa/qcocoabackingstore.h src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoascreen.h src/plugins/platforms/ios/qiosbackingstore.h src/plugins/sqldrivers/oci/qsql_oci.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
| * | | macOS: Mark the widget's container as embedded when placed into NSMenuItemv5.10.0-beta2Tor Arne Vestbø2017-10-161-0/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we'll end up creating a NSPanel for the QMacNativeWidget which is never closed, even if the backing NSView is moved to a new superview. Ideally this would be based on [NSView viewDidMoveToSuperview] and [NSView viewDidMoveToWindow], with retain/releases of the corresponding NSWindow, but that needs more research, especially as AppKit on macOS 10.13 will always keep a strong reference to the NSWindow. Task-number: QTBUG-63443 Change-Id: I9eec5ea871373d00dedf154600bf7005898cf37a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * | QMacStyle: smooth QMenu corners for realOleg Yadrov2017-10-052-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's been for years that QMenu's rounded corners in qmacstyle_mac were done via QWidget::setMask(QRegion). Unfortunately, QRegion mask does not work well with retina displays and also does not support translucency. That's why in this change we explicitly make QMenu's background transparent and then draw a rectangle with rounded corners in QMacStyle::drawPrimitive(PE_PanelMenu). This not only gives much better result than the mask-based approach, but also de-HIThemes QMenu. As a consequence, QComboBoxPrivateContainer doesn't get any mask from QMacStyle anymore. Therefore, when the mask is empty, we need to paint PE_PanelMenu before invoking QFrame's paint event handler. Made-with: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Change-Id: Ia9236176113f23b86e45507fa6ddf77236084ce3 Reviewed-by: Oleg Yadrov <oleg.yadrov@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| * | Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Liang Qi2017-10-0511-75/+147
| |\ \ | | | | | | | | | | | | refs/staging/5.10
| | * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-0411-75/+147
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/corelib/global/qglobal.h src/corelib/tools/qcryptographichash.cpp src/corelib/tools/qcryptographichash.h src/corelib/tools/qmessageauthenticationcode.cpp src/plugins/platforms/windows/qwindowswindow.h tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST Change-Id: Ib68112de985a3d714c2071f47c10e907e4f0229a
| | | * Fix crash when reparenting window containerPaul Olav Tvete2017-09-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindowContainer assumed that a widget could never change from native to non-native. This is not a fact when the window container is reparented to toplevel and back. In this case, usesNativeWidgets would be stuck at true, and parentWasChanged() would go down the native widget path, triggering an assert. The solution is to always recalculate the usesNativeWidgets bool. Task-number: QTBUG-63168 Change-Id: I88178259878ace9eb5de2ee45ff5e69b170da71c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
| | | * Return focus to correct widget after showing menuPaul Olav Tvete2017-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By the time we call setKeyboardMode(true), the menu may already have taken focus. This change sets keyboardFocusWidget before opening the popup, and makes sure that keyboardFocusWidget is not set to the popup. (We cannot remove the assignment from setKeyboardMode(), since it's called from several places.) [ChangeLog][QtWidgets] Fixed widget losing focus after showing menu second time. Task-number: QTBUG-56860 Change-Id: Ic01726bf694e6f365dd7b601ad555156e0fdf6c5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * Make QDateTimeParser a separate featureEdward Welbourne2017-09-252-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was being mis-described in some places by a QT_CONFIG(timezone) test, replacing older QT_BOOTSTRAPPED checks; but it has no time-zone dependency (until 5.10). So make it a separate feature in its own right. It turns out QAbstractSpinBox's presumed dependency on datetimeedit was an illusion caused by use of QDATETIMEEDIT_*_MIN symbols actually provided by datetimeparser; so remove its bogus dependency. Change-Id: Ibc12f4a9ee35acb64a39a1c7a15d2934b5710dc0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * QCompleter: Send activated() signal only once on return keyGabriel de Dietrich2017-09-222-12/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the complex event forwarding logic between QCompleter, QComboBox, QLineEdit and QWidgetLineControl, in some cases the same single user return key press could result in duplicated activated() signals being emitted by QComboBox. The first one would be emitted because QLineEdit emitted editingFinished() as a result of QCompleter::eventFilter() having forwarded the return key press event to QComboBox. The second one, would happen right after, as QCompleter::eventFilter() would process the same event on behalf of its popup. (We recall that QCompleter is installed as its own popup event filter. That's also the case for the completer's widget, although the purpose there is limited to focus-out events). The current fix consists on skipping the emit as a result of QLineEdit::editingFinished() if the completer's popup is still active. For this to be accurate, it helps to test whether the completer's popup is visible, so we will not be hiding it in QWidgetLineControl::processKeyEvent() anymore. Indeed, we know that if the popup is visible, that means that processKeyEvent() was called after being forwarded by the completer's popup event filter. Furthermore, the popup will be hidden by its event filter shortly after it returns from said event forwarding call. Based on a patch by Alexey Chernov <4ernov@gmail.com>. Task-number: QTBUG-51858 Task-number: QTBUG-51889 Change-Id: I013f6c3000ae37b5b0ec20eaf5cf7746c9c903e3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * Avoid calling QCompleter::popup() internallyGabriel de Dietrich2017-09-223-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCompleter::popup() is used to lazily create the popup itself. However, we oftentimes call this function only to check if the popup is visible. Change-Id: I55531e1e6810c02a44f5f65124cf641b1a89de69 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * QTabWidget: Don't build expensive parts of the style option when hiddenGabriel de Dietrich2017-09-221-34/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We end up calling setUpLayout() quite a few times and, in particular, every time we add a new tab. Even if the tab widget is hidden, we set the layout item margins to ensure that whatever layout will contain the tab widget can get the proper sizing. For all practical purposes, layout item margins don't depend on the contents itself, but are rather a simple constant returned by the style. This means that QStyleOptionTabWidgetFrame ::tabBarSize, among a few other properties, is not needed right away. This property in particular is quite expensive to compute because it requires measuring the text size of each tab. This can lead to a quadratic behavior: the size of each tab's text will be computed for each tab we add. Besides, text size computing has become a relatively expensive function in itself (see QTBUG-53151, for example). The current solution just uses a partially initialized style option object for the sole purpose of getting the tab widget's layout item margins from the style. The performance improvements detailed show the creation time for QTabWidget with the specified amount of tabs (times in ms): Tabs Before After ------------------- 1 6 5 5 6 6 10 8 6 50 57 17 100 178 21 200 673 33 Task-number: QTBUG-55126 Change-Id: I79505dbd0014f6ed185da28047d8b68f9462ba94 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * Fix QGraphicsEffect draw error size in decimal scale factorIceyer Lee2017-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QT_SCALE_FACTOR=1.5 or other decimal, QWidget draw QGraphicsEffect in error size. Use QPaintDevice::devicePixelRatioF instead QPaintDevice::devicePixelRatio() will fix it. Change-Id: I423e224d73b948ecdeca0e6b24c51f12a724a0ba Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | | * Itemviews: Set the WA_InputMethodEnabled attribute correctlyAndy Shaw2017-09-201-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When focus is put back onto an itemview and the current item is editable then the WA_InputMethodEnabled attribute should be set. Likewise this should be set/unset when the current index changes too, depending on whether the index is editable or not. Change-Id: Iaea075e669efd21bdaa89a49c500c449272d098b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * QGestureManager::filterEventThroughContexts(): Reduce debug outputFriedemann Kleint2017-09-201-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Log only relevant input events which are ignored. This reduces the output when COIN re-runs failing item view tests with full debug output enabled. Change-Id: Ifce9a56fdf313b7572baff9de8fb298b38e8b33a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | Let QPlatformBackingStore handle its own QOpenGLContextTor Arne Vestbø2017-10-053-29/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The resources allocated by QPlatformBackingStore are owned by the class, and should be allocated in a context the class also owns. This removes the asymmetry of having to pass in a context to composeAndFlush, while having to make the same context current before destroying the platform backingstore. The context owned by QPlatformBackingStore is shared with the associated window though a new QWindowPrivate::shareContext() API. The result is that on e.g. iOS, the backingstore does not need to tie the resource allocation of QPlatformBackingStore to the global share context, but can instead tie them to the per-window context, and hence clean them up after each window is closed. Task-number: QTBUG-56653 Change-Id: Ic1bcae50dafeeafaa8d16a7febd83b840ec6367a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * | | Widgets: change QWidget::setTabOrder to understand compound widgetsRichard Moe Gustavsen2017-10-041-43/+56
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A "compound widget" is a widget that has a focus proxy set to an inner child. This is normal for complex black-box components where focus handling is delegated to the children. Since the compound can have several children, a local tab order might exist between them. The current implementation of setTabOrder had no idea about compound widgets. As such, when connecting two compounds in the tab chain, it would just break up their inner tab order and cause tabbing to ignore children other than the proxy. The new implementation recognizes compound widgets, and add some extra code to figure out the correct tab targets. This way, the local tab order between the children will be preserved. This implementation was inspired by the patches of Marek Wieckowski posted in the linked bug report, and later modified by Nikita Krupenko. [ChangeLog][Widgets] QWidget::setTabOrder() will now preserve the local tab order inside a widget if it has a focus proxy set to an inner child. Task-number: QTBUG-10907 Change-Id: I0673d39d70ec8c6bf64af30bf978d67c651b2f3c Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * | Doc: Add 2 QtWidgets examples to highlighted examplesNico Vertriest2017-09-291-0/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-60635 Change-Id: I458cb09101c3423fb2abd3011e6f340e31cd0b42 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | QPlainTextEdit: draw placeholder text correctly when it wrapsRichard Moe Gustavsen2017-10-123-11/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 382faed introduced placeholder text to QPlainTextEdit. But the code relied on the text begin short enough to fit inside the width of the text edit. If the text was longer, and therefore wrapped, drawing artifacts would show. This patch will listen for text changes and check if the placeholder text should show or not, and if so, issue a full update to ensure that the whole placeholder text is either fully drawn or hidden. And then we allow to the placeholder text to be drawn inside the full rect of the text edit. Task-number: QTBUG-61875 Change-Id: I808472839ab397340080b56407c76e74f9ad1ae6 Reviewed-by: David Faure <david.faure@kdab.com>
* | | QWizard/Windows: Remove code for Windows < 7Friedemann Kleint2017-09-293-14/+3
| | | | | | | | | | | | | | | Change-Id: I1021ede67fe1396cdea3114d310e293fad2bcd76 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | Remove pointer checkJesus Fernandez2017-09-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The win pointer is valid because it is ensured before the check. It cannot be null. Coverity-Id: 21652 Change-Id: Iec8c1710d33a4eeb3820cd70bd94bd5b02fa0b41 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-26135-763/+935
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
| * | Widgets: be able to tab to a widget that has a focus proxyRichard Moe Gustavsen2017-09-251-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When tabbing/searching for the next focus widget, the current code would check if the next widget in the focus chain had a focus proxy, and if so, ignore it. The exact reason for this behavior is not clearly understood, but some widgets (e.g QSpinBox) has children (a QLineEdit) that sets the parent as focus proxy. If we didn't ignore children with focus proxy, tabbing from a QSpinBox would lead us to find the inner QLineEdit, which (because of its proxy), would lead us back to the QSpinBox. And therefore not be able to tab out. But ignoring the focus proxy has other problems. Normally a focus proxy is the next sibling to the widget it acts as a proxy for, and tabbing to the widget will therefore appear correct. But if the focus proxy is not the next sibling, the logic will fail, since the tab would anyway give focus to the next sibling. This becomes very apparent if the focus proxy is a child of the widget, since then its likely that the focus proxy is not the _first_ child among all the children. So tabbing to the parent would not give focus to the proxy. This patch will change this logic so that you are allowed to tab to a widget with a focus proxy. But we check that if you do so, you actually end up moving focus in the right direction. If not, we ignore it like before. This will ensure that we tab correctly when dealing with focus proxies, and especially when focus proxies are used to construct compound widgets. [ChangeLog][Widgets] When tabbing to a widget with focus proxy, focus will now be given to the proxy rather than just being ignored. Task-number: QTBUG-10907 Change-Id: I66d1da5c941fdd984bb2783cc355ca65b553b5dd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * | Widgets: add QWidgetPrivate::deepestFocusProxy()Richard Moe Gustavsen2017-09-252-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out searching for the deepest focus proxy in to a private function. Other than being called from QWidget::setFocus(), this function will also be used in subsequent patches. Change-Id: I4450a42e362eccb64f8a88c7ea83b415101973b9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-2099-463/+600
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
| | * Convert features.menu to QT_[REQUIRE_]CONFIGStephan Binner2017-09-1955-116/+184
| | | | | | | | | | | | | | | Change-Id: I031356411294b259ebd2b22c53159c93fd92af6e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Convert features.textedit to QT_[REQUIRE_]CONFIGStephan Binner2017-09-1919-64/+66
| | | | | | | | | | | | | | | Change-Id: I0fb0e658796484f374586d8d1f0f1b9167ab30d2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * QMenu: Fix size on high DPI + multi screenThorbjørn Lund Martsum2017-09-132-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calculating item sizes (used for menu size) the styles consider the widget screen. This widget screen could be a wrong default or an obsolete value. This patch ensures the screen is correct set on popup. [ChangeLog][QtWidgets][QMenu] Fixed menu size issue when using high DPI on multi-screen system. Task-number: QTBUG-59794 Change-Id: I84461441d5d33cb8dc04ab1acb9630fbfc8c5514 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Morten Kristensen <msk@nullpointer.dk> Reviewed-by: Per Liboriussen <liborius@chelys.dk> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| | * Convert features.slider to QT_[REQUIRE_]CONFIGStephan Binner2017-09-1214-40/+47
| | | | | | | | | | | | | | | Change-Id: I03adb5e34071aa106bbfe7caa2d41a93e8d1e263 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Convert features.lineedit to QT_[REQUIRE_]CONFIGStephan Binner2017-09-1228-59/+80
| | | | | | | | | | | | | | | Change-Id: I509977994b11a7fc0c109bfcc83aadeee6c9b0b8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Convert features.spinbox to QT_[REQUIRE_]CONFIGStephan Binner2017-09-1229-82/+98
| | | | | | | | | | | | | | | Change-Id: Idecb6927c20ff009795b0ad94bbb7199df98a8f8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Convert features.sizegrip to QT_[REQUIRE_]CONFIGStephan Binner2017-09-1214-49/+61
| | | | | | | | | | | | | | | Change-Id: Ieac4ae1f0b8b84e943c00da9903346a44e57138c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>