summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qsplitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-2/+2
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-1/+1
| | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWidget/QLineEdit: deprecate get{Contents,Text}Margins()Marc Mutz2019-07-301-4/+3
| | | | | | | | | | | | | | | We have contentsMargins() and textMargins() methods since 4.6 which are much more efficient and easier to use. [ChangeLog][QtWidgets][QLineEdit] The getTextMargins() member function has been deprecated in favor of textMargins(). [ChangeLog][QtWidgets][QWidget] The getContentsMargins() member function has been deprecated in favor of contentsMargins(). Change-Id: Ifdb890af6198fc682b94701786c67a5b945a4b4c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QSplitter: do not bypass the base class' overridesGiuseppe D'Angelo2019-05-151-1/+1
| | | | | | Change-Id: Ie58025191bb250914c13385d6e374e8d0c3f99b6 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Prefix textstream operators with Qt::Lars Knoll2019-05-021-1/+1
| | | | | | | As the non prefixed variants are deprecated Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-201-4/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformintegration.cpp src/gui/kernel/qplatformintegration.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/xcb/qxcbconnection_screens.cpp Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
| * Improve documentation for opaque resize in QSplitterJan Arve Sæther2019-03-181-4/+4
| | | | | | | | | | | | | | This also fixes the documentation for QStyle::SH_Splitter_OpaqueResize Change-Id: If8afb52ae300e9735a8bc6b065327f17d67f4323 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | QtGui/Network/OpenGl/Widgets/Xml: use \nullptr in documentationChristian Ehrlicher2019-02-201-2/+2
| | | | | | | | | | | | | | Replace null and '\c nullptr' with \nullptr in the documentation. Change-Id: I58934eea06943309ba895833f1991629870ab45b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QtWidgets: mark obsolete functions as deprecatedChristian Ehrlicher2019-02-061-0/+2
|/ | | | | | | | | | | | | | | Mark some long obsolete functions as deprecated so the can be removed with Qt6: - QLayout::margin()/setMargin() - QComboBox::autoCompletion()/setAutoCompletion() - QComboBox::autoCompletionCaseSensitivity() - QComboBox::setAutoCompletionCaseSensitivity() - QTextStream& operator<<(QTextStream&, const QSplitter&) - QTextStream& operator>>(QTextStream&, QSplitter&); Change-Id: Ic16b36bf647413b5b3ea2d9105981b95370b3178 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-201-4/+5
|\ | | | | | | Change-Id: I0bea38585382b5d9c8d7a013bf6bcb3a6008d159
| * QSplitter: fix doc for widget() and handle()Anton Kudryavtsev2018-04-181-4/+5
| | | | | | | | | | | | Change-Id: I7b8a0ba9f6b99eae22c2230c761d7a14045256db Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | QSplitter: some cleanupAnton Kudryavtsev2018-04-111-7/+6
| | | | | | | | | | | | | | Use nullptr instead of 0 for pointers Change-Id: I048e48eb4701c08af9d05df69d6f8a261db015cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-04-111-2/+2
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I0fd0adeca1590fffddd577873172f6d987a60412
| * QSplitter::indexOf: fix documentationAnton Kudryavtsev2018-04-101-2/+2
| | | | | | | | | | Change-Id: I2943c076879cbf229f209743b3b5c1f5fcd78302 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QSplitter: micro optimizationAnton Kudryavtsev2018-04-101-3/+1
|/ | | | | | | Use QStringBuilder to avoid needless allocation Change-Id: I483b7c4875539580234f4254e16a6cdb7737e7b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add more Q_FALLTHROUGH()Friedemann Kleint2018-01-121-1/+1
| | | | | | | | Silence g++ 7.X warnings. Change-Id: Id06d06e7e3b5be2cf3934d81f1891da58dea2649 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Convert features.splitter to QT_[REQUIRE_]CONFIGStephan Binner2017-08-101-3/+0
| | | | | Change-Id: I2eea5004938c581beb5a7c0c01409c576c5e5b39 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.rubberband to QT_[REQUIRE_]CONFIGStephan Binner2017-07-111-0/+2
| | | | | Change-Id: I6d634bafa6d26c1e78069fddd412e6de24f5775c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix UB in QSplitter::childEventOlivier Goffart2017-04-231-9/+10
| | | | | | | | | | | The widget might be in the QObject destructor when the event is received, so we can't static cast. There is no need to check for isWindow for ChildRemoved because it would not otherwise be on our list. Change-Id: Ifc0a2979f1f6720f1963399276a28ac4a3224fff Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove features.rubberband dependency of features.splitterStephan Binner2017-04-211-0/+6
| | | | | Change-Id: Ia55850f37f9384c8e00cef699fa308a02af64fd5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QSplitter::replaceWidget(): Add geometry related remarkGabriel de Dietrich2017-04-141-0/+4
| | | | | | | | | The late geometry update on the widget has been confusing some of our users. Change-Id: I7f2600322be0a0c54fac3beb42065413a0693f74 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Prefer rvalue versions of toLatin() and toUtf8()Anton Kudryavtsev2017-03-301-1/+1
| | | | | | | ... to re-use existing buffers. Change-Id: I7c42529b8cd4400520a59e658ab76f4f8e965cd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Prefer rvalue versions of toLower() and toUpper()Anton Kudryavtsev2017-03-281-1/+1
| | | | | | | ... to re-use existing buffers. Change-Id: Ib2bc938f1cf0451c1dbc012b3db022b878e987cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtWidgets: convert some users of QSizePolicy::transpose() to transposed()Marc Mutz2017-01-311-3/+1
| | | | | Change-Id: I492c3825ac10145c6ca69029ad1bcda6efc971b7 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QSplitterHandle: Ensure a minimum grab areaGabriel de Dietrich2016-12-231-5/+8
| | | | | | | | | | | | | This used to work only for 0- and 1-pixel wide handles. However, and paradoxically, 2- and 3-pixel wide handles would end up with narrower grab areas. We now ensure a 4 or 5 minimum grab area, depending on the handle width parity. The patch also clears the margins and mask if the handle size is increased at some point. Change-Id: I8a16e39fb34b5452d9021dbde8c22bec79df0243 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Introducing QSplitter::replaceWidget()Gabriel de Dietrich2016-12-021-3/+68
| | | | | | | | | | | | | | | | | | This new API addresses the use case where we want to replace a widget by another one inside the splitter. Up to now, the way of doing would include removing one widget and add the new one at the same place. However, this triggers a series of resize and paint events because of the successive changes in the splitter's children leading to a relayout of the remaining children. The new widget inherits the same properties as in the previous slot: geometry, visibility, and collapsed states. The previous widget, returned by the function, loses its parent and is hidden. Change-Id: I3dddf6b582d5ce2db8cff3c40bc46084263123ac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-121-1/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-1/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| | * QSplitter: Add note about ownership transfer to addWidget() and insertWidget()Stephan Binner2016-05-041-1/+5
| | | | | | | | | | | | | | | Change-Id: I971db2c25e4e667a416f58d148e18c4f11c349f1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QtWidgets: Introduce delegating constructors.Friedemann Kleint2016-05-021-4/+1
|/ / | | | | | | | | | | | | Reduce code duplication by chaining constructors. Change-Id: I0229556a417153063ac6d14d35765c85e6fe1fe8 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-211-0/+2
|\| | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| * QtWidgets: includemocsMarc Mutz2016-03-181-0/+2
| | | | | | | | | | | | | | | | A very simple way to save ~3KiB in test size and 440b in data size on GCC 5.3 Linux AMD64 release builds. Change-Id: I6619148cc497116b9772a00e1bc30d573a2b2534 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.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>
* | QtWidgets: use Q_UNLIKELY for every qWarning() (1)Marc Mutz2015-11-211-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qWarning(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. This change contains the changes to the util/, dialogs/ and widgets/ subdirs. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In QSystemTrayIcon::setVisible(), as a drive-by, I swapped the evaluation order of an &&-expression (newly wrapped in Q_UNLIKELY) to be more readable and more efficient (cheaper check first) at the same time. Change-Id: I3564c5a5deacba49d67d3989fb0b53e680c57fcb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* widgets: Use QList::reserve(), reduces reallocations.Sérgio Martins2015-06-231-2/+7
| | | | | Change-Id: I49cc03f365c77f142f62c8e77505ec09723a44d9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QFramePrivate & subclasses: declare dtor out-of-lineMarc Mutz2015-06-021-0/+4
| | | | | | | | | | | | | | De-duplicates vtables and enables RTTI on this class hierarchy. Export QFramePrivate, as QAbstractScrollAreaPrivate (a subclass) is exported, too. Change-Id: I541886373435dc49c4267190a7191e2436f4c95e Reported-by: Volker Krause <volker.krause@kdab.com> Task-number: QTBUG-45582 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* 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>
* Fix saving handle width in QSplitter::saveState()Alexander Volkov2014-09-161-1/+1
| | | | | | | | | | | QSplitter::handleWidth() returns either a style dependent value if d->handleWidth is negative or the value of d->handleWidth itself. So to preserve this choice after calling saveState()/restoreState() we should save and restore the value of d->handleWidth rather than a result of handleWidth() which is non-negative. Change-Id: Idc11f8063d34b6c4a5f9b0a0032868679766dfb9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QSplitter: Exclude top level widgets from child event handling.Friedemann Kleint2014-07-151-2/+4
| | | | | | | | | Prevent the splitter from adding them to the layout or showing them. Task-number: QTBUG-40132 Change-Id: Ife2be0bbd7e489570ef41f6f72a034b356c65f18 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-4/+4
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Extend QStyle API with a SH_Splitter_OpaqueResize styleHintRohan Garg2013-08-201-5/+14
| | | | | | | | | | | | Currently the default for QSplitter::opaqueResize is hard coded, which is less than ideal. Instead this should be provided as a style hint via QStyle so as to give a more uniform look to all applications. Change-Id: I5711811f7b672e36aafcd292ed320308570a0390 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix license headers stating QtGui for QtWidgets files.Jake Petroules2013-03-191-1/+1
| | | | | Change-Id: I0ca49e3e1f9f603f0b0f7f3553e854b871efe303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix typos and style in QSplitter documentationDavid Gil2012-12-051-18/+17
| | | | | | Change-Id: Ieacbfd06067ae1ca687030204125814bd9e48bd8 Reviewed-by: Johan Thelin <johan.thelin@pelagicore.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* De-inline some destructors in QtWidgetsMarc Mutz2012-11-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | Destructors should be out-of-line so that the compiler doesn't generate one per translation unit. Apart from creating more work for the compiler, it can also lead to duplicated vtables if the dtor is the first virtual function (reimplementation), and all other virtuals are inline, too. Duplicate vtables then break RTTI. In addition, having virtual dtors de-inlined allows us to add code to them in a BC way. As a final argument, this change may lead to less code app-side, since a sequence of cross-DLL calls (to member variable dtors) is replaced by a single cross-DLL call to the new out-of-line dtor. Change-Id: Ifb8c4aa992c75d61ba9ac8de5ab41d1e96b0a0b1 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Doc fixes.Frederik Gladhorn2012-11-031-1/+1
| | | | | Change-Id: Id2042c33a9762261756d1065781005dfef341797 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Make it obvious that adding a QLayout to QSplitter is not supported.Mitch Curtis2012-11-021-1/+8
| | | | | | | | | | | | | | | It does not make sense to add a QLayout to a QSplitter, since the splitter manages its child widgets in the same manner as a QLayout. The result of doing so is that the child widgets inside that layout will lead to the splitter and the layout fighting to position the child widgets. QSplitter::addWidget should be used to add widgets directly to the splitter instead. Change-Id: I640b463cae8673f87354d28636bff4dd3cfb9679 Reviewed-by: Samu Voutilainen <samu.voutilainen@gmail.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>