summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qcolordialog.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Convert features.colordialog to QT_[REQUIRE_]CONFIGStephan Binner2017-07-021-5/+0
| | | | | Change-Id: If2ac57a10f38002db5a49be3882dfc507a84a3df Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Build fix for -no-feature-shortcutPaul Olav Tvete2017-03-031-1/+4
| | | | | Change-Id: I99144b114b3c2eacb56b522b3059aa53a6bbd969 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* doc: Removed illegal qdoc commentsMartin Smith2017-01-051-5/+1
| | | | | | | | | Some member functions of a class declared in a cpp file were documented, but they should not have been documented. Change-Id: I9ce621bd858ebf1ad916beaf217d1c4d9feabbce Reviewed-by: Martin Smith <martin.smith@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-291-2/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/uikit/xcodebuild.mk tests/auto/other/lancelot/tst_lancelot.cpp tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp Change-Id: Ia0ae2de86094120281abd445138877c2cc3e882c
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-281-2/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qfiledialog.cpp tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp Change-Id: I34bc8a990f8f526889a95a5c7099ef557b9681ad
| | * Q(Color|File)Dialog: Fix several UBs (invalid cast/member call) in ↵Marc Mutz2016-09-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private::canBeNativeDialog() Found by UBSan: qcolordialog.cpp:86:5: runtime error: downcast of address 0x7ffdf50c1ec0 which does not point to an object of type 'QColorDialog' 0x7ffdf50c1ec0: note: object is of type 'QDialog' fd 7f 00 00 d8 6e c7 23 b7 2a 00 00 50 c1 af 01 00 00 00 00 b0 70 c7 23 b7 2a 00 00 00 00 1a 1e ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QDialog' #0 0x2ab720e4ec97 in QColorDialogPrivate::q_func() const qcolordialog.cpp:86 #1 0x2ab720e4ec97 in QColorDialogPrivate::canBeNativeDialog() const qcolordialog.cpp:1865 #2 0x2ab720e84ed6 in QDialog::setVisible(bool) qdialog.cpp:696 #3 0x2ab720e6c1fa in QDialog::~QDialog() qdialog.cpp:357 #4 0x2ab720e2b276 in QColorDialog::~QColorDialog() qcolordialog.cpp:2187 #5 0x2ab720e5e2c6 in QColorDialog::getColor(QColor const&, QWidget*, QString const&, QFlags<QColorDialog::ColorDialogOption>) qcolordialog.cpp:2148 #6 0x2ab720e5e473 in QColorDialog::getRgba(unsigned int, bool*, QWidget*) qcolordialog.cpp:2176 #7 0x407180 in tst_QColorDialog::testGetRgba() tst_qcolordialog.cpp:118 qfiledialog_p.h:112:5: runtime error: downcast of address 0x7ffd6858cc60 which does not point to an object of type 'QFileDialog' 0x7ffd6858cc60: note: object is of type 'QDialog' a1 2b 00 00 d8 1e 5e 0c a1 2b 00 00 b0 af 01 20 a1 2b 00 00 b0 20 5e 0c a1 2b 00 00 00 00 46 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QDialog' #0 0x2ba10980a9e7 in QFileDialogPrivate::q_func() const qfiledialog_p.h:112 #1 0x2ba10980a9e7 in QFileDialogPrivate::canBeNativeDialog() const qfiledialog.cpp:695 #2 0x2ba1097efe36 in QDialog::setVisible(bool) qdialog.cpp:696 #3 0x2ba1097d715a in QDialog::~QDialog() qdialog.cpp:357 #4 0x2ba109854c4b in QFileDialog::~QFileDialog() qfiledialog.cpp:380 #5 0x4179dc in tst_QFiledialog::init() tst_qfiledialog.cpp:175 Fix by replacing Q_Q with the the equivalent expression for QDialog. We can't re-use QDialogPrivate::q_func() here, since that is private, and probably should stay like that. Also fix an invalid member call in QColorDialogPrivate::canBeNativeDialog(): qcolordialog.cpp:2050:5: runtime error: member call on address 0x7ffdf50c1ec0 which does not point to an object of type 'QColorDialog' 0x7ffdf50c1ec0: note: object is of type 'QDialog' fd 7f 00 00 d8 6e c7 23 b7 2a 00 00 50 c1 af 01 00 00 00 00 b0 70 c7 23 b7 2a 00 00 00 00 1a 1e ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QDialog' #0 0x2ab720e4e5ea in QColorDialog::options() const qcolordialog.cpp:2050 #1 0x2ab720e4e8c8 in QColorDialogPrivate::canBeNativeDialog() const qcolordialog.cpp:1870 #2 0x2ab720e84ed6 in QDialog::setVisible(bool) qdialog.cpp:696 #3 0x2ab720e6c1fa in QDialog::~QDialog() qdialog.cpp:357 #4 0x2ab720e2b276 in QColorDialog::~QColorDialog() qcolordialog.cpp:2187 #5 0x2ab720e5e2c6 in QColorDialog::getColor(QColor const&, QWidget*, QString const&, QFlags<QColorDialog::ColorDialogOption>) qcolordialog.cpp:2148 #6 0x2ab720e5e473 in QColorDialog::getRgba(unsigned int, bool*, QWidget*) qcolordialog.cpp:2176 #7 0x407180 in tst_QColorDialog::testGetRgba() tst_qcolordialog.cpp:118 by accessing the data member directly instead of through the Public API. Fix the same code in QFileDialog, even though the autotest coverage is too limited for UBSan to point that one out explicitly. This commit amends abe8b4ab9b5243b477c72f3e900d4f6cca79b5c5, in which it should have been included in the first place... Change-Id: Iff0538eba61d2381359f0b61f35918d643f7aa0c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-291-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cf53aa21bf0f8fbd13c0ce2d33ddf7bc63d0d76a and 3aaa5d6b32130d3eeac872a59a5a44bfb20dfd4a were reverted because of reconstruction in 5.7. defineTest(qtConfTest_checkCompiler) in configure.pri is smart enough to cover the case in a9474d1260a8c8cc9eae14f2984098919d9684e5. DirectWrite: Fix advances being scaled to 0 Since 131eee5cd, the stretch of a font can be 0, meaning "whatever the font provides". In combination with ec7fee96, this would cause advances in the DirectWrite engine to be scaled to 0, causing the QRawFont test to fail. Conflicts: configure mkspecs/features/uikit/device_destinations.sh mkspecs/features/uikit/xcodebuild.mk src/corelib/global/qglobal.cpp src/corelib/global/qnamespace.qdoc src/plugins/platforms/cocoa/qcocoamenuitem.h src/plugins/platforms/windows/qwindowsservices.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp src/widgets/kernel/qapplication.cpp tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-291-1/+2
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/winrt/qwinrtclipboard.cpp Change-Id: Ic6d58be3d1ed2bb507f2ba06c82361afd9f9ddb9
| | * QColorDialog::getRgba: Fixed ignoring of initial alpha valueThorbjørn Lindeijer2016-08-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for this method explicitly states that the initial color+alpha is used, but its implementation used a QColor constructor that ignores the alpha value. Change-Id: I71721386e7fae0761e079d8840ec0124a8c14e33 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-161-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/global/qglobal.cpp src/corelib/tools/qstring.cpp src/network/socket/qabstractsocket.cpp src/network/socket/qnativesocketengine_unix.cpp src/plugins/platforms/eglfs/api/qeglfsglobal.h Change-Id: Id5dfdbd30fa996f9b4b66a0b030b7d3b8c0ef288
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-131-4/+4
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/io/qsettings.cpp src/corelib/itemmodels/qstringlistmodel.cpp tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp Change-Id: I1c6c306ef42c3c0234b19907914b19da706b4a03
| | * Doc: Change instances of '(Mac) OS X' to 'macOS'Topi Reinio2016-08-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-231-29/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/wince80colibri-armv7-msvc2012/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/corelib/global/qnamespace.h src/corelib/global/qnamespace.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/tools/tools.pri src/network/ssl/qsslconfiguration_p.h src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/plugins/platforms/windows/windows.pri src/src.pro src/tools/bootstrap/bootstrap.pro src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/dialogs/qfilesystemmodel.cpp tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-29/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| | * Remove dead code from QColorDialogThiago Macieira2016-05-141-29/+6
| | | | | | | | | | | | | | | | | | | | | Detected by GCC 6. Change-Id: I24a735698d3c4a719fc9ffff1425f193511406f9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QtWidgets: Introduce delegating constructors.Friedemann Kleint2016-05-021-3/+1
| | | | | | | | | | | | | | | | | | | | | Reduce code duplication by chaining constructors. Change-Id: I0229556a417153063ac6d14d35765c85e6fe1fe8 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QtWidgets: Remove Windows CE.Friedemann Kleint2016-04-071-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove Windows CE-specific files, #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: I102745aaca9d9737f2108fe7618111743d5ae980 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-03-221-15/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/common/wince/qplatformdefs.h src/plugins/platforms/directfb/qdirectfbbackingstore.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp Change-Id: Ied4d31264a9afca9514b51a7eb1494c28712793c
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-111-15/+0
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define and undef in src/corelib/tools/qsimd_p.h. This change is also squashed with "Fall back to c++11 standard compiler flag for host builds" which is done by Peter Seiderer. Conflicts: mkspecs/features/default_post.prf src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch src/3rdparty/sqlite/sqlite3.c src/corelib/tools/qsimd_p.h src/gui/kernel/qevent.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/bearer/blackberry/blackberry.pro src/plugins/platforms/cocoa/qcocoasystemsettings.mm src/plugins/platformthemes/gtk2/gtk2.pro src/plugins/styles/bb10style/bb10style.pro src/sql/drivers/sqlite2/qsql_sqlite2.cpp tools/configure/configureapp.cpp Task-number: QTBUG-51644 Done-with: Peter Seiderer <ps.report@gmx.net> Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
| | * Fix GCC 6 -Wunused-functions warningsMarc Mutz2016-03-051-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 6 is able to identify member functions that are unused. Remove them. Change-Id: Ic77548164b38a1cd3c957d2c57a5bccb979bc02e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Q{File,Font,Color,Message}DialogOptions are no value classesMarc Mutz2016-03-011-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These classes are only held in QSharedPointer, so optimize for that: 1. Disable default ctor, copy ctor and assignment operator, destructor and swap for public users. 2. Add create() to return an instance in a shared pointer. 3. Allocate public and private classes in one memory block, use QSharedPointer::create() to also add the QSharedPointer control block to the same memory allocation. As a consequence, this reduces the creation of a Q*DialogOptions into a shared pointer by two memory allocations. Add a macro to enable atomic updates to QtQuick and other users outside QtBase. [ChangeLog][QtGui] [QFileDialogOptions/QFontDialogOptions/QMessageDialogOptions/QColorDialogOptions] This class no longer has value semantics, but needs to be held in QSharedPointer (as it always was). To copy an instance, use the clone() method. Change-Id: I4c81220e0a8286a310df1c224a30eca34824c4e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Add attribute Qt::AA_DontUseNativeDialogs.Friedemann Kleint2016-02-171-3/+4
| | | | | | | | | | | | | | | | | | | | The attribute can be set to suppress native dialogs for example for testing purposes. Task-number: QTBUG-51074 Change-Id: I35611e07e00b7a060f22b49d6ab6f3b8627f8aca Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Clean up cancel operation handling on OS XTor Arne Vestbø2015-09-271-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic for handling cancel operations was spread out through the code base and sometimes hard-coded to only include the Escape key shortcut, missing the Command+. shortcut. We now intercept both attempts at cancel operations from the system through cancelOperation, which we forward as normal key events. A new QKeySequence::StandardKey has been added for the Cancel sequence, which maps to Escape on all platforms, and Command+. in addition for OS X. The hard-coded logic in QWidget and subclasses for dealing with closing the dialogs has been replaced with this key sequence, which allows clients to override the behavior. Note that the widget code is not wrapped in checks for QT_NO_SHORTCUT, as we don't care about keeping widgets building and working under that define. The logic in QCocoaWindow to bypass windowShouldClose when delivering IM events has been removed as we now handle that specific case by also forwarding Escape as a cancel operation. Task-number: QTBUG-47557 Task-number: QTBUG-45771 Task-number: QTBUG-44076 Change-Id: Ibe0b3a4819f8659d246a2142dd7d9cd3a826ef78 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Remove Q_DEAD_CODE_FROM_QT4_MAC sectionsMorten Johan Sørvig2015-08-131-50/+1
| | | | | | | | The native OS X color dialog wrapper is now implemented in qcocoadialoghelper.mm in the Cocoa platform plugin. Change-Id: Idc4088df93960dd68507d11a9895277e34a18b96 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* QColorDialog: move all helper classes into the unnamed namespaceMarc Mutz2015-03-131-2/+12
| | | | | | | | | | Effects on Linux GCC 4.9 stripped release builds: text -984B data +-0B relocs +-0 Change-Id: Iff914e745939f183ba51b4e625ff795d6b44023a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Inline qcolordialog_p.h into qcolordialog.cppMarc Mutz2015-03-131-1/+117
| | | | | | | | | This is preparation of moving all the helper classes into the unnamed namespace. Change-Id: I1028fc0b3661a58ca678f5bd839c64109c2a4884 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Make it more obvious that Q_WS_ is dead code, and should perhaps be portedTor Arne Vestbø2015-02-031-4/+4
| | | | | | | | | | | | We still have a bunch of Q_WS_ ifdefs in our code, which are easy to mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming the ifdefs we make it clear that the code in question is dead. In incremental follow-ups, we can then selectively either remove, or port, the pieces that are dead code. Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-211-5/+51
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * QColorDialog: Don't loose focus while color pickingSérgio Martins2015-01-091-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows mouse grabbing doesn't work across processes, which means we're interacting with other windows when picking colors. Workaround that by having a transparent 1x1 window below the cursor at all times so we catch the mouse click. Clicking before the window is below the cursor won't happen because our timer interval is 30ms, so it's quite fast. It's hacky but it's what we can do for a feature which was very broken on Windows. Task-number: QTBUG-43663 Change-Id: I295378e033ddc6d9c2230335f0953a727c21e1dd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * Windows: Fix QColorDialog's live updates while picking outside colorSérgio Martins2015-01-061-4/+36
| | | | | | | | | | | | | | | | | | | | | | | | Microsoft's SetCapture() doesn't work on windows owned by other processes, so instead we use a timer. This is the same approach as used by qttools/src/pixeltool. The mouse move approach however is more elegant and doesn't hammer the CPU with QCursor::pos() calls when idle. For this reason the workaround is Q_OS_WIN only. Task-number: QTBUG-34538 Change-Id: I40a6f7df5bf2a3a29ade8fe4a92f5b5c4ece7efb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | QColorDialog: Fix build with QT_SMALL_COLORDIALOGSérgio Martins2015-01-171-70/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nonTouchUI wasn't defined anywhere, this Q_WS_S60 codepath was partially removed during the Qt4->Qt5 port, but some cruft remained. It's not worth saving, because: - QML is now the way to go for touch UI code - It's ugly, didn't build, won't be missed and more importantly: The current layouting code is already very difficult to read, since we have "normal" mode, QT_SMALL_COLORDIALOG normal and QT_SMALL_COLORDIALOG touch. (and WINCE ifdefs in the mix) This will make the ifdef hell a bit better. Change-Id: I6daa07cbc8da94ccfe1d0c8d3e870c0678c541fc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | QColorDialog: Fix flickering when using "Pick screen color"Sérgio Martins2015-01-061-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | With non-monospaced fonts the dialog constantly resized itself when hovering with the mouse. This patch has the side effect of fixing another annoyance. Don't present duplicated information to the user, the color name is already shown in the HTML line edit and it's also updated dynamically. Task-number: QTBUG-43448 Change-Id: Ieaeda2a5b876cf15391616aed7d30ed352b463df Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | QColorDialog: fix a crash on small displaysGiuseppe D'Angelo2015-01-051-1/+2
| | | | | | | | | | | | | | | | | | On a small display leftLay is left initialized to a null pointer, therefore don't try to dereference it. Task-number: QTBUG-43643 Change-Id: I9d22dac88a3a853ce154a6f64b35fc113abd9262 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QColorDialog: merge two consecutive ifs with the same testGiuseppe D'Angelo2015-01-051-2/+0
| | | | | | | | | | | | Change-Id: I931bf8f61f95c879522daabf4fc9d6f5801a307b Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-291-2/+13
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
| * QColorDialog: Fix a few layouting issues.Sérgio Martins2014-12-221-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | Fixes combo-boxes being too big and some alignment issues that were not present in Qt4. See screenshot in JIRA task. Tested with QT_SMALL_COLORDIALOG too. Task-number: QTBUG-43501 Change-Id: I2aefb64be1c5f3c4894149d85e1a12c9c0cc3d62 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | QColorDialog: Move string into retranslateStrings()Sérgio Martins2014-12-231-1/+2
| | | | | | | | | | Change-Id: I802b3e3463f77777cb0f25b60fc069da32d1c467 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | QColorDialog: Add missing accelerator keySérgio Martins2014-12-221-1/+1
| | | | | | | | | | Change-Id: Ibafe9f1bf36a8c19fb7f3f66e425db2e7d9f84ca Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Remove Q_NO_USING_KEYWORDThiago Macieira2014-12-201-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a lot of code now requiring it. Any compiler that doesn't support the keyword is too old for Qt now. The last time anyone asked about this macro was for QTBUG-27393 and we don't know which compiler that was. As a necessity, this patch contains a reversal of a0c3a57aed5cde37017733e7cf5e41cc6a1174aa [ChangeLog][Compiler Specific Changes] Qt 5.5 now unconditionally uses the "using" keyword. Compilers that do not support this keyword are deprecated and will not be able to build Qt. Previous versions of Qt may or may not compile, as no testing was done to ensure it worked. Change-Id: Ief042f34aba555a095d1f342a0ee7ee9feadf42d Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-181-9/+25
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/platformsupport/platformcompositor/qopenglcompositor.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I5422868500be695584a496dbbbc719d146bc572d
| * QColorDialog: Fix matching against predefined colors.Sérgio Martins2014-12-161-4/+4
| | | | | | | | | | | | | | | | | | The grids are filled top to bottom, left to right, so use division to get the column. Task-number: QTBUG-43371 Change-Id: I02ad518512858ed71e0e3a0cae8c4e02d537a9b9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * QColorDialog: Fix picking screen colors inside QColorPickerSérgio Martins2014-12-131-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If you click "Pick screen color" and move mouse over QColorPicker (the square with gradients) unexpected things will happen: black will be picked half the times. This is because QColorPicker's black cross is painted under our mouse cursor. Although "pick screen color"'s use case is to pick colors in other windows, there's no reason to not make it work on QColorDialog itself too. Task-number: QTBUG-43288 Change-Id: I03ca02148cc15ad41d545723d4ac4f5a82842b4b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-031-30/+30
|/ | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Refactor custom/standard color selectors in QColorDialog.Friedemann Kleint2014-07-081-25/+33
| | | | | | | | Introduce an enumeration for the rows/columns and use std::find() to find the matching colors. Change-Id: If8b7f76d48beab470f6cac0bfdeaf56058237e94 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Implement QWidget::grabCursor(const QCursor&).Friedemann Kleint2014-07-031-8/+3
| | | | | | | | Implement using QGuiApplication::setOverrideCursor(). Task-number: QTBUG-39311 Change-Id: I83e289bfd5e911c31f08df9a4fc17fb8a0cf27f2 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-011-15/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
| * QColorDialog: Do not update custom/standard color cells while picking.Friedemann Kleint2014-06-251-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delay the updating of the custom/standard color cells to the mouse release of the color pick. This makes it possible to pre-select a custom color cell for assignment before the pick and prevents that from changing when its color is crossed by accident. Rename the existing method QColorDialogPrivate::setCurrentColor(QRgb) to setCurrentRgbColor() and move QColor::setCurrentColor() to QColorDialogPrivate, introducing an enumeration for specifying what to set. Task-number: QTBUG-39792 Change-Id: Ibfe96e345589346e8c72976a0335e901798f2766 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>