summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QWidgetTextControl: ignore GroupSwitchModifier for BackSpaceIgor Kushnir2021-05-311-1/+1
| | | | | | | | | | | | | | | | | | "The keypad and group switch modifier should not make a difference" when matches a QKeySequence, see QKeyEvent::matches() implementation. Qt(xcb) treats AltGr as GroupSwitchModifier in hard code, which should come from Qt 4 era. Nowadays, with different xkb setups, Mode_switch could be different keys. When it is AltGr, Qt will get AltGr as GroupSwitchModifier. When it is not AltGr, another key like Less/Greaterkey(details in bug report), GroupSwitchModifier will not be set in the case. Fixes: QTBUG-36565 Change-Id: I7251963d41a70d61800d25e43d5012b859693f69 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 4b0b87b5c2173ee70eacfdd7cea08aea8a5164c8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Only scroll QMenu when there is a valid active actionZhang Hao2021-04-141-1/+1
| | | | | | | | | | | | | | | When changing the active action via QMenu::setActiveAction the menu will scroll to the active action, but we were scrolling the menu also when the active action was null, resulting in the menu scrolling back to the top. We fix this by guarding the call to scrollMenu. Fixes: QTBUG-92096 Change-Id: I998f99ddacec32640834d59a907d569fdda458f0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 94e03e506a0e953f72c21c4ca827174a3d1f0d73) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build without features.menuTasuku Suzuki2021-04-131-7/+7
| | | | | | | Change-Id: If7947839b8da5abc8ee84aace60cc7de7a053e04 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit d84bf703b505db470e5c7916e3cd630c3e456cef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QLineEdit: Fix editingFinished() not being emitted when pressing the clear ↵Dong Rui2021-02-231-1/+1
| | | | | | | | | | | | | | | button When pressing the clear button, the editingFinished() signal was not received when focussing out. Call _q_textEdited(QString()) when pressing the clear button. Fixes: QTBUG-83295 Change-Id: Ie4bc6d9a2f27f89163c05c4c15175540c7631a30 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit c5904cb96aed3b171c543a2cf0bed8f8ac5f95c4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMdiSubWindow: Set correct ControlLabel sizeMorten Johan Sørvig2021-02-191-2/+2
| | | | | | | | | | | The label pixmap may be a high-dpi pixmap. Set the ControlLabel fixed size to be the pixmap device independent size. Fixes: QTBUG-87871 Change-Id: Ib836e322d25599cb5e79011ea597e32ee1f8d093 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 33ddacdd24523acbdafcda0f520dd2d73c879cfb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QPlainTextEdit: adjust scroll bars when showing upWang Chuan2021-02-091-0/+1
| | | | | | | | | | | | The text of QPlainTextEdit might change when it is invisible, so an adjustment of scroll bars is needed when the QPlainTextEdit showing up, otherwise the range of scroll bars might be incorrect. Fixes: QTBUG-77937 Change-Id: I45c686c7e09ca7b2944c36122e9157de0ec4f0e0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 13ae47d98057c2ddca8c865b845973d7e4c8dd8b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows: Fix flicker when resizing translucent windows with QSizeGripFriedemann Kleint2021-02-011-3/+15
| | | | | | | | | | | Do not use the startSystemResize() functionality in that case. Fixes: QTBUG-90628 Fixes: QTBUG-73011 Change-Id: I8d4843c1715c7f75f9b41c904e6f1aebbf0e02d7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 90dc13ae5facf97a2760edf054d2e002d0eae5d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QLineEdit Cursor show white areaZhang Hao2021-01-291-2/+4
| | | | | | | | | | | | | fix QLineEdit Cursor Rect and InputMask area overlapping, the cursor rect area is white. when inputMask is set,we don't need draw cursor. Fixes: QTBUG-89578 Change-Id: Ibec7f8f1f7331a12438fd821c2002903260da10a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 795ea19ca0a7e484793655b35f19de8dbc88e987) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix that the placeholdertext of QCombobox is not drawnChunLin Wang2021-01-271-2/+4
| | | | | | | | | | If the current index is invalid,a placeholdertext will be displayed. Fixes: QTBUG-90595 Change-Id: Id4c6b9c959242b96ee0944b8fc3131a9a2fdcccc Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 6da6b6da4494439dc34e92fee7d69b5ad48a783d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix populating selection clipboard with keyboardVolodymyr Samokhatko2021-01-265-6/+23
| | | | | | | | Task-number: QTBUG-59879 Change-Id: I6948919fc90995c60a34b5bd6b4a225c1a59fd9b Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 976f28e7bb7cddb11459600f293868abcf7da948) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix small typo in the QMdiArea documentationOliver Eftevaag2021-01-181-1/+1
| | | | | | | | | | Added missing whitespace character in the documentation for QMdiArea, in the 'detailed explanation' section. Change-Id: I6be1d664bc15e3e461c5fc3d8f82311cc6ea60ea Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 3cb2b5bfe3e3c84dcd4c1a04c8c981dbaf85f0a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the tips still show when cursor move to another actionQiang Li2021-01-151-0/+2
| | | | | | | | | | | | In this case, the previous action's tip is still displayed when the cursor moves from one action with tip to another action without tip. Fixes: QTBUG-89082 Change-Id: I0a00595dc3d716725678487be9cbb363c4d3b392 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 3f3d5e6716d9130776b3613ccbd5595de7d4af8d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QComboBox: fix select all columns in the viewChristian Ehrlicher2021-01-131-2/+4
| | | | | | | | | | | | | | | When the QComboBox gets a custom view with multiple columns, only the first one is selected even the selection mode of the view is SelectRows. The selection changes afterwards properly honor the mode though. Therefore check for the selection mode and call setCurrentIndex() with the appropriate flags. Fixes: QTBUG-86776 Change-Id: Ieba7b9e009358e7b6e802b7847640161ec776c64 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b3b28faf2627aad3a0c47fb4c7c711e0d19984aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Simplify and fix issues with QMenuPrivate::moveWidgetToPlatformItemTor Arne Vestbø2021-01-042-49/+35
| | | | | | | | | | | | | | | | | | View embedding when QWidget is involved is a bit finicky. This change breaks down the steps needed to embed it into an NSMenu item, and simplifies the process by not relying on a container widget. The main issue is that QCocoaWindow::recreateWindowIfNeeded() will potentially create an NSWindow for the embedded view, resulting in a stray view. To prevent this we set the Qt::SubWindow flag on the window, but QWidget tends to reset this flag when the widget doesn't have a parent, so we need to be careful about which order we do the setup. Change-Id: I505f7c0a2d8e4350511fdb01a5e9b9c623a40a41 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit c30d05e794e49d69cbc981ae2ff21e5713c5a81f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAbstractButton: don't access nullptr in queryButtonList()Christian Ehrlicher2021-01-011-1/+3
| | | | | | | | | | | | | When a button has no parent, QAbstractButtonPrivate::queryButtonList() unconditionally accessed parent which results in a nullptr access. Did not crash because qt_qFindChildren_helper checks for nullptr and therefore could only be found with a sanitizer. Fixes: QTBUG-83865 Change-Id: I591e546e96acba50770935b9c3baaf08b09b833d Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> (cherry picked from commit f0818f6ed8a616dcc94785637039ac21468ef311) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make QPushButton on macOS use QFocusFrame to fix alignment problemsDoris Verria2020-12-212-1/+8
| | | | | | | | | | | | | | | Alignment problems occur for pushbuttons because they appear smaller then their actual widget geometry, which is used for their alignment in layouts. To fix, shift the pushbutton's rect to the left, adjust SE_PushButtonLayoutItem accordingly and use QFocusFrame to render the focus frame ring outside the widget's paintable area. Fixes: QTBUG-89133 Fixes: QTBUG-81452 Change-Id: Iee885a4fb3674d966e5ff3b5c04a0845521b2d72 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit c6379e34993370e7e2208b51be384b738ce35817) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't show focus rect for QCommandLinkButtonDoris Verria2020-12-111-0/+1
| | | | | | | | | | | | Since QPushButton sets WA_MacShowFocusRect attribute upon init, this will be set for QCommandLinkButton too. However, we do not want to draw the Mac focus frame for QCommandLink buttons so remove this attribute for them. Change-Id: Ida7a437a54be078caaebc2c0744243d50e14a87f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f8f955151a6a218e1d274663c7c309b8eb6ca92a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Override initStyleOption() for QCommandLinkButtonDoris Verria2020-12-112-0/+7
| | | | | | | | | | | | | | In QPushButton::initStyleOption() there is no style option feature set to distinguish QCommandLinkButtons. The QStyleOptionButton::CommandLink Button feature is only set during the paintEvent, but in some cases we need to check for this feature before painting. To fix, override initStyleOption for QCommandLinkButton and set the fea ture there. Change-Id: I8831a6be7da642dcf8830812d99681213e7515dc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit d3ee976acab59019fdd781691f29e6f12e4dedc8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Disable WA_QuitOnClose on menu item widget containerTor Arne Vestbø2020-12-101-0/+1
| | | | | | | | | | Otherwise it will prevent quitting of the application when the last window is closed, on account of (seemingly) being a top level window. Change-Id: Ib79615dd1e9394c96d39c8f9851005b4c073c165 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 6198ba217f3a9b31d44375b26f3635f15fc01b3d) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QSplashScreen: draw pixmap with SmoothTransfromMorten Johan Sørvig2020-12-081-0/+1
| | | | | | | | | | | | Use high-quality scaling to improve rendering in cases where the pixmap has to be scaled down, such as when drawing a @2x pixmap at 150%. Change-Id: I216b03b61dfa2cc2cc8c573e24a576424f6f5d17 Fixes: QTBUG-88982 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit fdc687913df2dbd92c7469082690381fea55e628) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-12-042-3/+3
| | | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 0440614af0bb08e373d8e3e40f90b6412c043d14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Adjust the format of code blocks in function mouseReleaseEventQiang Li2020-12-031-1/+1
| | | | | | | Change-Id: I8441b1c4f22ec04e34e8c2c5e9ccc69d34c67e01 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit d6dcf508a6a751c8c32273112957607b062899e8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix links to Application ExampleVolker Hilsheimer2020-12-026-8/+8
| | | | | | | | | | | The example was renamed in 6cb36d825d365988ea7a601218bdd3a329290469. Change-Id: Ic9daac60002c9988dfeb5c7dcde74edb69388f37 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com> (cherry picked from commit 0cc9a99865c4b6dfb1a212a5aba0fc5907f19b24) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restore pass-by-ref to QRect QCalendarWidget::paintCell()Edward Welbourne2020-11-272-2/+2
| | | | | | | | | | | Accidentally changed to pass-by-value while doing that to QDate, in commit af837734b2259201f126b206bd5299497e080f7b Task-number: QTBUG-86400 Change-Id: I8d2db532f537e5f82a5f3b36e72fcf7fefdd2ee5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 8db0d701e8b1fe00cdd5d71c18afff84de606013) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QtWidgets: Propagate event device when translating mouse eventsFriedemann Kleint2020-11-271-1/+2
| | | | | | | | | | | | There are a few places left over, for example the QTextEdit creating mouse events in a timer and notably QGraphicsView. Task-number: QTBUG-88678 Task-number: QTBUG-46412 Change-Id: I7ed23911be3b86b4b39fb478b947ec3b7a60761f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 21fa38b6ad0167673148709faa4907b220853c5a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 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>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-1620-126/+126
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Doc: Add missing brief statements for \property documentationTopi Reinio2020-11-123-5/+6
| | | | | | | | ... where applicable. Fixes: QTBUG-88232 Change-Id: I835df434765caededd35d5114965b4a1663e7942 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Get rid of all instance usage of QFontDatabaseVolker Hilsheimer2020-11-031-5/+4
| | | | | | | | 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>
* 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>
* 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>
* 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>
* QSplitter: Respect managed widget's growth/expand size policyAles Erjavec2020-10-231-5/+5
| | | | | | | | | | | Use qSmartMaxSize to get the maximum size a widget can take. [ChangeLog][QtWidgets][QSplitter] Respect QSizePolicy::Maximum and QSizePolicy::Fixed layout policy of child widgets. Fixes: QTBUG-87133 Change-Id: I166ef3f6608303b8695f5c05a7bf0d1be4653f4a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-231-1/+1
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Don't show QPushButton as hovered unless the mouse is within the bevelVolker Hilsheimer2020-10-223-1/+26
| | | | | | | | | | | | | | | Previous fixes made QPushButton correctly respect the style sheet boxing model (as it's documented to do), ignoring clicks that were within the margin area of the button (ie outside the bevel). However, a hover state selector in the style sheet would still be used for the entire widget. Turn on mouse tracking for widgets that have a hover state selector, and handle mouseMoveEvent to set an explicit hovered state only when the mouse hits the button. Use that state to initialize the style option. Fixes: QTBUG-87706 Change-Id: I2f423b760c85cfab9faac4be44a5c7dcf2ba1c23 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QTabBar: update index of last visible tab in insertTabStanislav Yelenskiy2020-10-211-3/+5
| | | | | | | | | | | | | | Index of the last visible tab was not updated, if a new tab was inserted after the current tab and before the last tab. When the new tab is inserted before the last visible tab, the index of the last tab increments by one. When the new tab is inserted after the last visible tab, then the newly inserted tab becomes the last visible. Fixes: QTBUG-86898 Change-Id: I2f4b7f705261ec35a5aa7b883ecdddba25f007b7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-074-19/+19
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-072-2/+2
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Convert a couple of APIs to use viewsLars Knoll2020-10-061-1/+1
| | | | | | | | | | | Try to get rid of APIs that use raw 'const {char, QChar} *, length' pairs. Instead, use QByteArrayView or QStringView. As QStringConverter is a new class, simply change the API to what we'd like to have. Also adjust hidden API in QStringBuilder and friends. Change-Id: I897d47f63a7b965f5574a1e51da64147f9e981f6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Eliminate QDateTimeParser's mutable parameters at lastEdward Welbourne2020-09-301-1/+2
| | | | | | | | | | | | | | | | I noticed that QDTP has a mutable member, text, which gets set at the end of each call to parse(); this makes all the in-out parameters redundant, since relevant methods can simply access - and modify - text, if it's set *at the start* of parse instaed. (There are no early returns to complicate matters.) This also makes StateNode::input redundant. At the same time, rename the mutable member, as several methods shadow it with parameter or local variable names; it is too generic. Change-Id: I2259cd87de5c84201b25c9633d11e59a4a4d57a1 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simplify the preamble of QDateTimeEditPrivate::stepBy()Edward Welbourne2020-09-271-11/+3
| | | | | | | | Repetition and needless complexity: eleven lines rewritten in three. Change-Id: I1dadbbc5329b18d3e25f38f73b69abd2d7aac30d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* fix QComboBox currentText return placeholderTextWang ChunLin2020-09-251-3/+2
| | | | | | | | | If it does not add item,the currentText should return empty string Fixes: QTBUG-86580 Pick-to: 5.15 Change-Id: I54c3a8b7ececfb1e62bcd7ac592feccaff3f8b48 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* fix qcombobox code styleWang ChunLin2020-09-251-2/+2
| | | | | | | | modify some code style Fixes: QTBUG-86793 Change-Id: I263bda1bd16dd34129ea5ae8948ad3eeaf833f3a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix redundant emission of editingFinished from QLineEdit with Return keyChristian Heimlich2020-09-234-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation of QLineEdit uses the "edited" bit-field flag to prevent unnecessary emissions of editingFinished() when a line edit loses focus but its contents have not changed since the last time the signal was emitted; however, this flag is only cleared when the signal is fired due to focus loss and not when the Return/Enter key is pressed. This causes an unexpected double emission of the signal when focus is lost following a press of the Return/Enter key if the line edit's text was not further altered between the two actions. This change includes the Return/Enter press as a trigger for clearing the "edited" flag to make editingFinished()'s behavior more consistent and expected. Prevents slots in user code from triggering twice in situations where the line edit's current contents have already been handled, but still allows the end-user to force an emission of the signal via Return/Enter. The effect of the "edited" flag on the signals behavior has also been noted in the signal description as it was previously omitted. [ChangeLog][QtWidgets][QLineEdit][Behavior Change] Pressing the Return/Enter key in a QLineEdit will now also prevent editingFinished() from firing due to focus loss if the contents of the line edit have not changed since the last time the signal was emitted. See - https://forum.qt.io/topic/116902/ Change-Id: I11aadd45341337b7852da8cf5802c7c9efdd614d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix qdoc warnings: QSplitterVolker Hilsheimer2020-09-231-5/+3
| | | | | | | Fix prototypes and parameter names. Change-Id: Ic43c72eaaf06f941f652440e750c91546707b79e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix some qdoc warnings: broken linksVolker Hilsheimer2020-09-211-1/+1
| | | | | | | We can't split a \l{Class::}member over two lines. Change-Id: Id4806402ab349fd20fbf65eee9502e2d08e21dc5 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Cleanup API of QMimeDataLars Knoll2020-09-212-2/+2
| | | | | | | | | | | | | Do not use QVariant::Type anymore, instead use QMetaType For some reason, this pushed the qvariant autotest over the limit where MSVC requires the /bigobj flag, so add that one. [ChangeLog][QtCore][QMimeData] The signature of the virtual retrieveData() function has changed and now takes a QMetaType instead of a QVariant::Type. Change-Id: Ib46773bd731ee2177b1ef74d8162d744be7017ef Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Small doc fixLars Knoll2020-09-121-1/+1
| | | | | | | Refer to QMetaType, not QVariant::Type Change-Id: I3e9284742b332095a26c03c68580ad0f6d4f9be7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>