summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QErrorMessage: replace a QPair with a structMarc Mutz2017-02-221-5/+11
| | | | | | | | Instead of the incomprehensible "names" .first and .second, the code can now use .content and .type. Change-Id: I7fe320ded33a07fb8ff77ac96c17fc5ee1079da3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QWindow: Remove "_q_foreignWinId" dynamic propertyTor Arne Vestbø2017-02-221-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The platform plugins reading this out of the QWindow was a layering violation, and propagates the notion that a window can shape shift into representing a new native handle, while none of the platform plugins support this. A foreign QWindow is created via the factory function fromWinId(), at which point we can pass the WId all the way to the platform plugin as function arguments, where the platform will create a corresponding platform-window. The platform window can then answer the question of whether or not it's representing a foreign window, which determines a few behavioral changes here and there, as well as supplying the native window handle back for QWindow::winId(); [ChangeLog][QtGui][QWindow] The "_q_foreignWinId" dynamic property is no longer set nor read. [ChangeLog][QtGui][QPA] The function createForeignWindow() has been added to QPlatormIntegration and is now responsible for creating foreign windows. The function isForeignWindow() in QPlatformWindow has been added, and platforms should implement this to return true for windows created by createForeignWindow(). Task-number: QTBUG-58383 Change-Id: If84142f95172f62b9377eb5d2a4d792cad36010b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* QSizePolicy: add C++14-style constexpr where possibleMarc Mutz2017-02-221-8/+8
| | | | | | | | | | | | | | This is straight-forward, since, unlike with transposed(), we can assume that every compiler that supports C++14 constexpr also supports C++11 uniform initialization. For Clang and GCC, this is clear. For MSVC, we might need to reconsider this, as, according to qcompilerdetection.h, 2015 still does not support uniform initialization (but not C++14 constexpr, either), and we don't know what 2017 will support. Change-Id: Idac7aa929d275645478a926896dca0dff166e114 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QErrorMessage: handle all message typesMarc Mutz2017-02-211-1/+7
| | | | | | | | | | | | | | | | | The perils of adding a default: case to a switch over an enum type: the compiler no longer warns when the enum is extended. Provide strings for QtCriticalMsg and QtInfoMsg, too. [ChangeLog][QtWidgets][QErrorMessage] No longer displays critical (QtCriticalMsg) and informational (QtInfoMsg) messages as if they were debug (QtDebugMsg) ones. Change-Id: Id6776081be736ad92423ec016988dcd92a963cc7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QWidget: update the font when the screen is changedOlivier Goffart2017-02-201-0/+1
| | | | | | | | | | | | | The screen may change the dpi so the font dpi is also changed. We must tell QWidget that the font has changed by sending the FontChanged event to all sub widgets so they can update their geometry. Task-number: QTBUG-48242 Change-Id: Ibcdcc0c96429b8cd16311928298294f47a23e816 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Widgets: Update micro focus in QLineEdit and friendsJarkko Koivikko2017-02-174-0/+10
| | | | | | | | | | | | QLineEdit, QAbstractSpinBox and QComboBox did not notify micro focus changes to the input context. In particular, the updates were missed during pre-edit stage. This change adds the missing bindings to QWidget::updateMicroFocus(). Change-Id: I9a7fff962f46dbabd8fb02836c206bace115793b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix typo in apidoc.Frederik Schwarzer2017-02-171-1/+1
| | | | | | Change-Id: Ibd71c1ed653769637aa176dfb52c4594141be8ce Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9Liang Qi2017-02-171-1/+1
|\
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-161-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp Change-Id: I632c400d909f8c204f55743aadc7886af2f15dfb
| | * QFileDialog: Protect against nullptr dereferenceKevin Funk2017-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the QFileDialog receives a language change event, and native dialogs are used, this code path dereference a nullptr in the qFileDialogUi member. Protect by checking the return value of QFileDialogPrivate::usingWidgets() as done in other places deferencing qFileDialogUi. Fixes a crash in GammaRay Change-Id: I3e9eb81c75d9fc983519a58c5ec06e316ac80263 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QWindowsVistaStyle: Set theme flag noContent for PE_FrameLineEditFriedemann Kleint2017-02-161-0/+1
|/ / | | | | | | | | | | | | | | | | When the flag is not set, custom background colors for QLineEdit will not work. Set the flag as does QWindowsXpStyle. Task-number: QTBUG-57862 Change-Id: I6e653c2cdc8cc523673e1629bf42f833c8504431 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Take window frame into account when dragging dock widgetSergio Martins2017-02-161-1/+3
| | | | | | | | | | | | | | | | | | | | Dock widgets with custom titlebar are frameless by default, so this isn't usually a problem. However, the user can override the default and make it non-frameless (by just removing the native title bar, not the frame). Task-number: QTBUG-58843 Change-Id: Iff7a2a719cb2f326f2f81bbfb1b53ba01a63f3e1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Lazily create QPlatformWindow for Qt::Desktop windowsTor Arne Vestbø2017-02-161-7/+12
| | | | | | | | | | | | | | | | | | | | QDesktopWidget only needs a QWindow to access its screen, and has no use for the platform window. To keep old code working that may have called winId() on the QDekstopWidget we still ensure it gets created lazily, even if that will just create hidden fake windows on many platforms. Change-Id: I2d05b96dfeebeaf3f1278cfef6301ef4cb855a57 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Fix minor typos in apidocFrederik Schwarzer2017-02-151-1/+1
| | | | | | | | | | Change-Id: I5ce9599a60ea336b469807df075e491f0e6df680 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-141-9/+4
|\| | | | | | | Change-Id: I2bd2e61bae1eab4fc74fa6accd741ed9ae1f0669
| * QFormLayout: take the correct row in takeRow()Marc Mutz2017-02-081-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I didn't even try to understand what the old code was trying to do; once you're told by a user that the code is wrong, you see that it is. Fixed by just using the row as passed to takeRow() instead of trying to do some storage-index calculations. The m_matrix indexing operator does it all for us. Added a test that checks that the expected field widget gets returned. Fixed expected test data that was wrong, and just checking that the implementation behaves as implemented, instead of as documented. Amends change 8fbae648db3bc51bafacfe1f88e40561d357e60a. [ChangeLog][QtWidget][QFormLayout] The functions takeRow() and removeRow(), new in 5.8.0, now take and remove the correct row. Task-number: QTBUG-58693 Task-number: QTBUG-15990 Change-Id: I7185ccbc6c03e2579741cad5c0c821d3ed165474 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Windows styles/wizard: Do not invoke winId() of desktop windowsFriedemann Kleint2017-02-132-13/+4
| | | | | | | | | | | | | | | | | | | | | | Call the Win32 API GetDesktopWindow() to obtain a HWND of the desktop instead of calling QApplicationPrivate::getHWNDForWidget() for desktop windows. This allows for lazily creating desktop platform windows. Observed in some tests where no window is visible. Change-Id: I97074f69606b3d74f3fbc90acb4a077d52eeb84d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Prevent Qt::ForeignWindow from propagating into QWidget for non-toplevelsTor Arne Vestbø2017-02-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | Qt::ForeignWindow implies Qt::Window, which QtWidgets interprets as a top level window, but this is not the case on a QtGui level. A foreign window can be a child window as well, so we have to make sure the QWindow state is not propagated to QWidget, which would result in the QWidget becoming top level. Change-Id: Ie0c2d769ce92e6988a4d62da46f5fc2da74bdf08 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add QPlatformWindow::isForeignWindow()Tor Arne Vestbø2017-02-091-3/+6
| | | | | | | | | | | | | | | | Simplifies code at call sites and allows for refactoring how to decide if a window is foreign or not at a later point. Change-Id: Icc51a83bac187f4975535366b53b4990832b6c82 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-0810-75/+98
|\| | | | | | | | | | | | | | | Conflicts: configure.json mkspecs/win32-icc/qmake.conf Change-Id: Ibf40546b024d644c7d9ed490bee15b82597f4d3f
| * Fix result handling in QDialog::doneSamuel Gaist2017-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The setData method of an item view would get an incorrect value of a QDialog's result. This patch changes the order of functions called to fix that. [ChangeLog][QtWidgets][QDialog] Fixed a bug where accessing the result of QDialog's result could yield an incorrect value in some situation like using it as a delegate for item views. Task-number: QTBUG-6018 Task-number: QTBUG-12156 Task-number: QTBUG-14430 Change-Id: I6ee4b6e8cacf6a806631c05c6c5dbcff925df65e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * QInputDialog: prevent crash in static get*() functions when parent gets deletedMarc Mutz2017-02-062-65/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As explained in https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0 creating dialogs on the stack is a bad idea if the application or the dialog's parent window can be closed by means other than user interaction (such as a timer or an IPC call). Since we cannot know whether Qt is used to build such an application, we must assume it is, create the dialog on the heap, and monitor its lifetime with a QPointer. Instead of using manual resource management, add a minimal implementation of QAutoPointer, and use that in all static get*() functions. Task-number: QTBUG-54693 Change-Id: I6157dca18608e02be1ea2c2defbc31641defc9d1 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
| * Clear dock indicator when not over a floating dock group windowSergio Martins2017-02-012-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | The rubberband is shown depending if there's a current hovered dock widget, but there were a few places that were not calling updateGapIndicator(). Additionally, the rubberband will also disappear if the currentHoveredFloat is destroyed externally (would leave a ghost rubber band behind). Task-number: QTBUG-58049 Change-Id: Iafdf234aa04b0ee280e51f8fa2fd212c86610cd1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Doc: Normalize \since usageTopi Reinio2017-01-313-3/+3
| | | | | | | | | | | | | | | | | | | | | | Although it's permitted to specify the project name together with a version number for \since, it's unnecessary for Qt classes and functions. This change also normalizes the version formatting: '<major>.<minor>' Change-Id: Ie5a43662077d13c31e241bcde8a7a2849d27d330 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * Fix build with -no-feature-animationPaul Olav Tvete2017-01-302-1/+8
| | | | | | | | | | Change-Id: Ieecb9cdbf4373e295148ae5b3d59c43aaf46175e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix some qdoc warnings for 5.9Friedemann Kleint2017-02-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings: src/network/access/qhstspolicy.cpp:158: warning: Undocumented parameter 'expiry' in QHstsPolicy::setExpiry() src/network/access/qhstspolicy.cpp:178: warning: Undocumented parameter 'include' in QHstsPolicy::setIncludesSubDomains() src/network/access/qhstspolicy.cpp:178: warning: Can't link to 'includeSubdomains()' src/widgets/kernel/qsizepolicy.cpp:402: warning: Cannot find 'transposed(...)' in '\fn' QSizePolicy QSizePolicy::transposed() src/widgets/kernel/qsizepolicy.h:165: warning: No documentation for 'QSizePolicy::transposed()' src/widgets/util/qundostack.cpp:164: warning: Undocumented parameter 'obsolete' in QUndoCommand::setObsolete() Fix the signature of the QStaticByteArrayMatcher member functions. The warnings src/corelib/tools/qbytearraymatcher.cpp:372: warning: Cannot find 'indexIn(...)' in '\fn' QStaticByteArrayMatcher::indexIn(const char *haystack, int hlen, int from) src/corelib/tools/qbytearraymatcher.cpp:382: warning: Cannot find 'indexIn(...)' in '\fn' QStaticByteArrayMatcher::indexIn(const QByteArray &haystack, int from) remain, though since apparently qdoc is thrown off by the constructor. Change-Id: I157359a881ff3fbc80d2eeb52dd5c27249d009c4 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QTabBar: fix vertical tabs appearanceOleg Yadrov2017-02-021-3/+13
| | | | | | | | | | | | | | | | | | | | Fail to take into account vertical tabs led to that vertical tabs were displayed wrong in some cases (for example, QMovableTabWidget was one pixel shorter than it should be). Task-number: QTBUG-58266 Change-Id: I90411eeaa6055538634b62b5d5bd5fa5013b0015 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Merge remote-tracking branch 'gerrit/dev' into HEADOswald Buddenhagen2017-02-0158-223/+517
|\ \
| * | QCommonStyle: fix a few typos and formatting issuesOleg Yadrov2017-01-311-5/+5
| | | | | | | | | | | | | | | Change-Id: I7855795bf010865d5c2b8dd51538c446cdff1974 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * | QSizePolicy: implement transpose() via transposed()Marc Mutz2017-01-311-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | Having two implementations was nice for testing, but now remove one of them. Change-Id: I70dc7d16496427dd36ba2464c9f650ec865202b1 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
| * | QtWidgets: convert some users of QSizePolicy::transpose() to transposed()Marc Mutz2017-01-313-9/+3
| | | | | | | | | | | | | | | Change-Id: I492c3825ac10145c6ca69029ad1bcda6efc971b7 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-3038-111/+301
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| | * QKeySequenceEdit: Allow for the case where pressing SHIFT+letter gives a ↵Andy Shaw2017-01-271-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | different letter On some keyboard layouts it is possible that pressing SHIFT+letter does not give the upper case version of the character. So we depend on QKeyMapper here to give us the right keysequence as then it will compare against a shortcut created with this combination then. Task-number: QTBUG-57928 Task-number: QTBUG-57931 Change-Id: I9421f3ab4d3f8d1ee42f9680200d4b017d551057 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | * Fix dock widget having the wrong parent after a dragSergio Martins2017-01-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When dragging a dock widget from a floating group to the main window reparentWidgets() is supposed to be called. It's usually triggered by some unrelated event, like a LayoutRequest. Instead of relying on luck for reparentWidgets() to get called be explicit, otherwise the dock widget that was dropped into main window will still have as parent the floating group window. The item.skip() condition seems overly restrictive. Task-number: QTBUG-58036 Change-Id: I65b5699e1acb6ca9bedb10620daa055fa9d91943 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Remove duplicated feature definitionPaul Olav Tvete2017-01-261-7/+1
| | | | | | | | | | | | | | | | | | | | | The "spinbox" feature was defined twice, and in two different ways. Change-Id: Iabc8939036e2166c5c5a417181ae8fb244829123 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-lineeditPaul Olav Tvete2017-01-261-0/+4
| | | | | | | | | | | | | | | Change-Id: I171aed5d134db88f211da0e1a6ce236e32f3c35c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-whatsthisPaul Olav Tvete2017-01-251-0/+2
| | | | | | | | | | | | | | | Change-Id: I2f31357e91b01f826ef44710f477b80fde1f3fbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-treewidgetPaul Olav Tvete2017-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | Make sure the feature is defined before testing it. Change-Id: I4d4b555c9f2629c8a3ca58cf52efff279f6a78f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Compile with -no-feature-tooltipPaul Olav Tvete2017-01-253-0/+6
| | | | | | | | | | | | | | | Change-Id: I6093559dd7b8df578ebd050655fb9bd07e5f6809 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-toolbuttonPaul Olav Tvete2017-01-253-2/+12
| | | | | | | | | | | | | | | Change-Id: I16495548fa3ed24409883fadab08ddb8545efd0d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-tabbarPaul Olav Tvete2017-01-254-5/+26
| | | | | | | | | | | | | | | Change-Id: I97c5345f2627743876aa05a94ffc03f2a6012b6c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-tabwidgetPaul Olav Tvete2017-01-251-11/+9
| | | | | | | | | | | | | | | Change-Id: I0fbabdfec763f1647bf85582afe088a3e5b42e1f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-sliderPaul Olav Tvete2017-01-252-1/+3
| | | | | | | | | | | | | | | Change-Id: I36e5c850068c2f9ac2ae078a3734ddb88d88c532 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-texteditPaul Olav Tvete2017-01-252-1/+5
| | | | | | | | | | | | | | | Change-Id: I4a75c134803043180c57287ca352e26e3422204c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix styles compilation with features removed, round 2Paul Olav Tvete2017-01-254-11/+72
| | | | | | | | | | | | | | | Change-Id: I8f09a8844e5edc1ad3e3dfd39eca9f3b42c5c828 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-rubberbandPaul Olav Tvete2017-01-251-1/+2
| | | | | | | | | | | | | | | Change-Id: Ida6698c4868507ccbf5b4c5e3eb1d2f5a7109f53 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-menubarPaul Olav Tvete2017-01-251-2/+9
| | | | | | | | | | | | | | | Change-Id: I23b23fcaf6fcc655d38a06495127b108975f4a58 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-menuPaul Olav Tvete2017-01-253-2/+10
| | | | | | | | | | | | | | | Change-Id: I8f9d5ef6b7f7102e56816677f1d3a5b5144b7083 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Compile with -no-feature-itemviewsPaul Olav Tvete2017-01-253-5/+11
| | | | | | | | | | | | | | | Change-Id: I23506f06df35f124f5eb9fcc8426c63b407a0872 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix build with -no-feature-graphicsviewPaul Olav Tvete2017-01-251-0/+3
| | | | | | | | | | | | | | | Change-Id: I9ae724ddf90efc9e951d475e3332083e6f8207d6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>