summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename Application ExampleVolker Hilsheimer2020-11-261-1/+1
| | | | | | | | | | Prefix it with "Qt Widgets -" to make it a bit clearer in the list of highlighted examples which module this one is about. Pick-to: 6.0 6.0.0 Change-Id: I0bf65b02db72173f1adfe0bcf8657be7905dbd6c Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QStackedLayout: fix a memory leakGiuseppe D'Angelo2020-11-231-1/+3
| | | | | | | | A layout takes ownership of the QLayoutItem passed to addItem. Change-Id: Iea3c64453f3cbf4f1b5660e505c1a35dca537833 Pick-to: 6.0 5.15 5.12 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Drop a [[maybe_unused]] on a variableGiuseppe D'Angelo2020-11-231-1/+1
| | | | | | | Turn it into an inline variable. Change-Id: Iab7fa2d53259ced0b1a78bf7368e0e862ba2c799 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Update CMake functions in Qt Widgets for Qt 6Kai Koehne2020-11-233-80/+12
| | | | | | Pick-to: 6.0 6.0.0 Change-Id: I4110e8695c75c40cec6f94bb94879b07282b29d3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace qt_make_unique with std::make_uniqueAllan Sandfeld Jensen2020-11-234-18/+10
| | | | | | | We can depend on C++14 now. Change-Id: Iee9796cd22dbfbb70d4bdb25f0eee1662a026d6d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QLayout: add a way to unset user-defined contents marginsGiuseppe D'Angelo2020-11-202-0/+14
| | | | | | | | | | | | Once user-defined margins are set on a layout, there's no way to unset them, except by abusing setContentsMargins and passing -1, which is a total API abuse (does a negative margin mean that contents *overflow* the layout?). Add a proper function. [ChangeLog][QtWidgets][QLayout] Added unsetContentsMargins(). Change-Id: I089788a7470f9649a8f00e42914dafb7242f12cd Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* widgets: Don't report new focus object during clearFocus() unless neededTor Arne Vestbø2020-11-201-6/+7
| | | | | | | | | | | | | | | We do not unconditionally clear focus_child like the existing comment said. We only do it if the focus_child was the widget that is clearing focus. So in many cases we'll end up with the same focus object as before. We can not report that as a focusObjectChanged to the window, as that will potentially trigger a reset or cancel of the current input method for the (unchanged) focus object. Fixes: QTBUG-86976 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I54367e46eda7a94d967f58960bd926c195dc09cc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFont: Prefer setFamilies() over setFamily()Andy Shaw2020-11-203-9/+9
| | | | | | | | | | | | | | | | By depending on setFamilies() then we can be sure that font names with spaces, commas, quotes and so on are correctly handled without being misinterpreted. For now it will split on the comma when a string containing one is passed to setFamily. But from Qt 6.2 this will be removed to preserve the family string as a convenience function. [ChangeLog][QtGui][QFont] Indicated that setFamilies/families is preferred over setFamily/family to ensure that font family names are preserved when spaces, commas and so on are used in the name. Change-Id: Id3c1a4e827756a4c928fed461a4aafa5a0f06633 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* wasm: fix showing tooltipsLorn Potter2020-11-191-1/+1
| | | | | | | Change-Id: I4c82ccc2bfa1019ef105ccf20982786097c126b9 Fixes: QTBUG-87227 Pick-to: 5.15 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Ensure that QMenu is polished before setting the screen in popup()David Redondo2020-11-181-1/+2
| | | | | | | | | | | | | | Some styles alter the widget that will influence the underlying platform window. An example is when a style would want to draw the menu with some transparency and sets the Qt::WA_TranslucentBackground attribute. This needs to happen before the platform window is created. However calling QWidgetPrivate::setScreen will end up creating the window and the surface format will be fixed at this point. Pick-to: 5.15 Change-Id: I707cf1de5c1614382cffbea1aae8cdb01f7de44a Reviewed-by: Nate Graham Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix x-height name in stylesheet docsFlorian Bruhin2020-11-171-1/+1
| | | | | | | | | | | The *height* of an x being called "ex width" makes no sense. Also, it seems like this measurement is typically called "x-height" rather than "ex height", see e.g. https://en.wikipedia.org/wiki/X-height Pick-to: 5.15 5.12 Change-Id: Id8e2c1aa9be1a4a60e667a076486777d34f1e76d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix QGraphicsItem crash if click right button of mouseZhang Yu2020-11-181-2/+6
| | | | | | | | | | | In this case, the 'parent' is QGraphicsTextItem which isn't a object inheriting from QWidget. Converting QGraphicsTextItem to QWidget by static_cast and using it as QWidget leads to crash. Fixes: QTBUG-88309 Pick-to: 5.15 Change-Id: I3c583f43125eb36841848434d1fa9a135b0e9f57 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of Q_COMPILER_CONSTEXPR checksAllan Sandfeld Jensen2020-11-171-4/+0
| | | | | | | Is required now. Change-Id: I62e95929d1649ea1390392230b619bd56d2a0349 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Update landing pages and module pages in qtbaseJerome Pasion2020-11-171-0/+2
| | | | | | | | | | -Qt SQL, Qt D-BUS, Qt GUI, Qt OpenGL, Qt Widgets, Qt Test, Qt Concurrent, Qt XML, Qt Network, Qt Core -language edits for consistency, add links Task-number: QTBUG-87155 Change-Id: Ic61350c9fa15090c802a42d8e9116219591eba73 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Allow QMutableSinglePointEvent to be copy- and default-constructedVolker Hilsheimer2020-11-172-6/+5
| | | | | | | | | | | | | | | | | Since QMutableSinglePointEvent is just an access-helper to QSinglePointEvent, we can safely create one from the other. This covers QMouseEvent as well with the right casting in place. And by making QMSPE default constructable, we can use it in code that needs to frequently copy event data, for example in QtQuick. This allows us to make the copy c'tor and assignment operators for QEvent classes protected, which prevents potentially dangerous (ie. slicing) implicit copies. Change-Id: I815774847cca63896f46c43df683053b3d952b61 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove old QtGui and QtWidgets examples from highlighted listVolker Hilsheimer2020-11-171-4/+1
| | | | | Change-Id: I86c879568dd71981abd417c1bfb71e4582599276 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-1642-187/+187
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Give QWidget::updateMicroFocus a parameter with defaultVolker Hilsheimer2020-11-162-5/+5
| | | | | | | | This allows for potential optimizations in widgets, e.g. no need to for the input method to query all data when only the cursor position changed. Change-Id: Idd1e554acd776ed4d225197ce80915d651ede904 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Adjust the format of code blocks in function pixelMetric()Xu Shitong2020-11-161-13/+16
| | | | | Change-Id: I1ef3c1beb686af090311297523d5d69380a62fbe Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QToolTip: don’t close again on Close eventMorten Johan Sørvig2020-11-121-1/+7
| | | | | | | | | | | | | Prevent recursion: hideTipImmediately() calls QWidget::close(), which will soon start calling QWindow::close(), which will send another close event. Fix this by calling hideTipImmediately() only for Close events not targeted for the tip label. Task-number: QTBUG-46701 Change-Id: I6fd373ce13aed860b0d4836d5fbf470374ed2543 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Purge QCoreApplicationPrivate::cloneEvent and overridesVolker Hilsheimer2020-11-125-172/+1
| | | | | | | | Not used anywhere in Qt 6, and if whatever needs this ever comes back, then we won't implement it like this. Change-Id: I99655ba5825644cef3686bbe50ca688b68f5c2a4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove Qt4Compatible paintingAllan Sandfeld Jensen2020-11-122-12/+0
| | | | | Change-Id: Ie54206ca9b509875568f2158e229fca9cb1860a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Fix documentation warnings for Qt WidgetsTopi Reinio2020-11-122-1/+10
| | | | | | | | | | - Exclude forwarding headers to Qt GUI as they caused the headers to be parsed twice. - Drop documentation for removed example Task-number: QTBUG-86295 Change-Id: I08eb46b7c7f813f103cc545f931896be99a3ccec Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add missing brief statements for \property documentationTopi Reinio2020-11-125-7/+9
| | | | | | | | ... where applicable. Fixes: QTBUG-88232 Change-Id: I835df434765caededd35d5114965b4a1663e7942 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix QGraphicsView's abuse of QEvent's d-pointer in Leave event handlingVolker Hilsheimer2020-11-112-7/+12
| | | | | | | | | | | | | | QGraphicsSceneEvent carries a widget pointer, and we can add a new event type. Assert that QGraphicsScene doesn't get Leave events from elsewhere. This was the only "usage" of QEvent's d-pointer in Qt, so with this gone we can reduce the size of QEvent by 8 bytes. Change-Id: I0513daf742de9084d0469d55b7a7f41b667e8081 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename remaining QEvent variables to m_ convention; init m_reservedShawn Rutledge2020-11-102-15/+15
| | | | | Change-Id: I08694657b7c9d2713d0cb33519698dbba3bfdffa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename "Porting" pages to "Changes"Jerome Pasion2020-11-092-3/+3
| | | | | | | | | | | | | | The content in the porting guides are closer to a changelog than a porting guide. At this point, it is easier for maintainers and contributors to write in a changelog than a guide. This change should help with readability and is closer to the usage of "Changes" in documentation. Part of a rename in other submodules. Task-number: QTBUG-87156 Change-Id: Ib59de7976fae19e7b39962e80161df6628e4070b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix broken link in QWidgetVolker Hilsheimer2020-11-091-1/+1
| | | | | | | \l expects the link target first, then link text second Change-Id: I4d8638c2c441c6d2949b1f011422c191df3ff619 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix qstylesheetstyle clip border errorLu YaNing2020-11-081-2/+2
| | | | | | | | | | | | The left border path clip error when border size is odd. That because borderClip calc path with border with divide 2. It should be 2.0 that make result to accurately real number. Pick-to: 5.15 Change-Id: I8c6f358afa4f3c8c9e5b263707ee145f6e5491c0 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix a few qdoc warningsVolker Hilsheimer2020-11-061-1/+1
| | | | | Change-Id: I7cc284ec56f02049d43a23c81659db94bfc3ff42 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix a bunch of qdoc warningsVolker Hilsheimer2020-11-061-1/+1
| | | | | | | Remove or fix references to removed APIs, and some qdoc syntax fixes. Change-Id: I67d71062cd7a29f4eb74b02199b1482af5e59fc0 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add multi key bindings to QShortcutAllan Sandfeld Jensen2020-11-042-5/+2
| | | | | | | | | | | This makes it feature comparable with QAction, and makes it possible to use as a backend for QAction, and fixes a few missing alternative keybindings in qtwidgets. Change-Id: Iaefc630b96c4743fc5ef429dc841870ddd99fc64 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Initial porting guide for QtGui and QtPrintSupportVolker Hilsheimer2020-11-041-13/+4
| | | | | | | | | Additional porting documentation for QtWidgets. Task-number: QTBUG-88149 Task-number: QTBUG-88151 Change-Id: Ia28f01a8d8d6eaee9d8f08af1a54b76e57620cab Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* InputMethod should call reset() function when proxywidget lost focusZhang Hao2020-11-041-1/+12
| | | | | | | | | | fix When the preview of input Chinese appears,the proxyWidget lose focus and does not call the reset method of inputMethod. Fixes: QTBUG-88016 Pick-to: 5.15 Change-Id: I82a66207b0d2046d768430ac3e93df86c1ed3681 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate QFontDatabase constructorVolker Hilsheimer2020-11-031-3/+3
| | | | | | | | Move private methods into the private class. Fixes: QTBUG-88114 Change-Id: I92fa52980ed5a0675eee310359d8875f614921e6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Get rid of all instance usage of QFontDatabaseVolker Hilsheimer2020-11-033-17/+13
| | | | | | | | All QFontDatabase APIs are static, use them accordingly. Task-number: QTBUG-88114 Change-Id: I0e4a7508646037e6e2812611262eed8b6d7ad3de Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QLayout: unify the constructorsGiuseppe D'Angelo2020-11-024-35/+12
| | | | | | | | | | | Drive-by, make QLayout constructor explicit, as it should have always been. [ChangeLog][QtWidgets][QLayout] The QLayout constructor taking a QWidget pointer is now explicit. Change-Id: If6accfb2e7e810fa08adacea9e674c99121f6bc6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QCombobox: propagate the palette to the embedded line editWang Chuan2020-11-021-0/+1
| | | | | | | | | | Let the new created embedded QLineEdit use the palette from QCombobox, when calling [setEditable(true)] Fixes: QTBUG-81533 Pick-to: 5.15 Change-Id: Ia406dd8122a348e185f0e94d027646b95eeaa76e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Remove usages of Q_FOREACHAllan Sandfeld Jensen2020-11-021-1/+1
| | | | | | | The last places outside tests, tools and qnx platform code Change-Id: I9918861888cf58bf5dbae5603febb8885fc67709 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Prefer versioned CMake library targetsv6.0.0-beta3Kai Koehne2020-11-011-1/+1
| | | | | | | | The non-versioned one's do miss some properties. It's therefore best to not advocate using them. Change-Id: I53645e65ed4de4e0100e59905c024cdfe40be0c5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Regenerate qtbase projectsAlexandru Croitor2020-10-302-8/+12
| | | | | | | | | | In preparation for some further regeneration. Also modify pro2cmake to add forgotten mapping for the Qt::EglFsKmsGbmSupportPrivate module. Change-Id: I92425c566c2b275b40eec8c652496290754ac385 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Doc: Fix links to the CMake manualTopi Reinio2020-10-301-1/+1
| | | | | | Task-number: QTBUG-86295 Change-Id: I7b2208284d65ec9182352490bd4c92458c5e5e37 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Organize QtOpenGLWidgets documentationVolker Hilsheimer2020-10-291-209/+0
| | | | | | | | | | | Move snippets to the right place, and give the widgets class a place to live. QtOpenGLWidgets is just a library, not a separate module, but we need a module page that the class can refer to for correct build instructions. Change-Id: I6d955ad3c4cd1003a828cc1f256deb6e7fb50ec4 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* doc : remove redundant ')'Hiweed Mandriva2020-10-291-1/+1
| | | | | | Change-Id: I84a1a08889e04b4d6a33384a3f91d5bf3976871c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Hiweed Mandriva <hiweedmandriva@163.com>
* doc : fix typo 'consise' => 'conciseHiweed Mandriva2020-10-291-1/+1
| | | | | Change-Id: Ife2fc3b61b03b741b41bd703c3caf8180c6868fa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPushButton: if mouse tracking is off, ignore state only updated when trackingVolker Hilsheimer2020-10-271-1/+1
| | | | | | | | | | | | | | Amends 3310e13a17d2249a86fa533e350744c5593be54f. The explicit hovering state is only updated when handling MouseMove events, and those are only delivered when mouseTracking is set. Without mouseTracking set, the state was always false, and QPushButton didn't set the MouseOver style flag. Ignore the new state if mouse tracking is not set. Task-number: QTBUG-87706 Change-Id: I2718fb23c206fd8dfd427edc987ff193ba1be8a0 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QLayout docs: explain better what the QWidget ctor arg doesAhmad Samir2020-10-274-23/+53
| | | | | | | | | | Make it clear in the docs that an alternative to calling QWidget::setLayout() is to pass the parent widget to the Q*BoxLayout constructor. This basically just copies the relevant bits from the the docs of QWidget and Q*Layout. Change-Id: Id196dcdf9a876d9141aa145f23a83c45f8cda5f8 Pick-to: 5.15 5.12 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Expunge WA_GroupLeaderShawn Rutledge2020-10-272-45/+6
| | | | | | | | | It's been deprecated since Qt 4.1. Task-number: QTBUG-85816 Change-Id: Iafc6340716556f54fc5472c60035bb57461b842f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Show the year correctly after it has been editedAndy Shaw2020-10-261-1/+1
| | | | | | | | | | | | When converting the year as an integer via the locale then it can add in group separators which would not be desired here. Therefore it should be converted via the QDate approach to get the right output for the year. Fixes: QTBUG-86307 Fixes: QTBUG-85966 Pick-to: 5.15 Change-Id: I092bd1e5f69e544843fd5f28c96b94c9066490c5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Display tooltips on the correct screenMorten Johan Sørvig2020-10-231-1/+3
| | | | | | | | | | | | | Display QTipLabel on the correct screen, also when the parent widget spans multiple screens. In this case, QWidget::screen() will return the main screen for the widget, which will not necessarily be the screen at the tool tip position. Fixes regression introduced by 7e2fded5. Change-Id: Iffb920b6658468c5032928eadbd749f58fe077a7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>