summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qabstractspinbox.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make QDateTimeParser a separate featureEdward Welbourne2017-09-251-3/+10
| | | | | | | | | | | | | | It was being mis-described in some places by a QT_CONFIG(timezone) test, replacing older QT_BOOTSTRAPPED checks; but it has no time-zone dependency (until 5.10). So make it a separate feature in its own right. It turns out QAbstractSpinBox's presumed dependency on datetimeedit was an illusion caused by use of QDATETIMEEDIT_*_MIN symbols actually provided by datetimeparser; so remove its bogus dependency. Change-Id: Ibc12f4a9ee35acb64a39a1c7a15d2934b5710dc0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Convert features.menu to QT_[REQUIRE_]CONFIGStephan Binner2017-09-191-0/+2
| | | | | Change-Id: I031356411294b259ebd2b22c53159c93fd92af6e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.spinbox to QT_[REQUIRE_]CONFIGStephan Binner2017-09-121-4/+0
| | | | | Change-Id: Idecb6927c20ff009795b0ad94bbb7199df98a8f8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.datetimeedit to QT_[REQUIRE_]CONFIGStephan Binner2017-07-111-0/+2
| | | | | Change-Id: I083cd565fab8c33dc3633b71f962de099c2b3481 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.wheelevent to QT_CONFIGStephan Binner2017-06-281-1/+1
| | | | | Change-Id: I46083a9115c199d1ebe024ed5f64b160a27462f1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-061-0/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/widgets/widgets/qtabbar.cpp Change-Id: Iaa9daee5f7a6490d56257a3824730a35751ceb05
| * GCC 7: fix -Werror=implicit-fallthroughGiuseppe D'Angelo2017-04-041-0/+2
| | | | | | | | | | | | | | | | More fallthrough-are-errors fixed. Change-Id: I9a6cb6efe988400ed3f9cb95d1e426dac317e6c4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Widgets: Update micro focus in QLineEdit and friendsJarkko Koivikko2017-02-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | QLineEdit, QAbstractSpinBox and QComboBox did not notify micro focus changes to the input context. In particular, the updates were missed during pre-edit stage. This change adds the missing bindings to QWidget::updateMicroFocus(). Change-Id: I9a7fff962f46dbabd8fb02836c206bace115793b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-301-4/+2
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| * Remove reimplementations of removed featuresPaul Olav Tvete2017-01-251-4/+2
| | | | | | | | | | | | | | Avoid the "marked ‘override’, but does not override" compile error. Change-Id: I4b125f1951614045781f3059fbc5cb65dd26775c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Use QString::asprintf(), QStringBuilder, and the multi-arg overload of ↵Alexander Volkov2017-01-121-2/+2
|/ | | | | | | | | | | | | QString::arg() ... instead of sequential .arg(const QString &) callings. It saves memory allocations and prevents unexpected results if replacing strings contain place markers. Found with clazy's qstring-arg check. Change-Id: I3912275a6e11c6fb7559ff5623f2e8cde9b7f07a Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-291-0/+2
|\ | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/winrt/qwinrtclipboard.cpp Change-Id: Ic6d58be3d1ed2bb507f2ba06c82361afd9f9ddb9
| * QAbstractSpinBox: Clear 'cleared' flag on receiving a keypressFriedemann Kleint2016-08-251-0/+2
| | | | | | | | | | | | | | | | | | Prevent QAbstractSpinBoxPrivate::interpret() from bailing out in focus changes after text has been entered. Task-number: QTBUG-55249 Change-Id: I250b3c50f7db5de2e9356038df20f18ee059df11 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-151-2/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakeevaluator.cpp One side changed the iterator to use ranged-for, the other changed its body; they only conflicted because the latter had to add braces around the body, intruding on the for-line. Trivial resolution. Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
| * Fix misleading code in QAbstractSpinBox::event()Marc Mutz2016-07-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | A static_cast never returns nullptr unless its argument already was nullptr. But we dereferenced 'event' already by the time we reach this code, so the if is always true. Fix by removing the temporary variable. Change-Id: Ia869d37eda74f0bcdd616e1f57f429cc86e9e525 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Widgets: use QStringRef to optimize memory allocationAnton Kudryavtsev2016-06-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. Change-Id: I728c4338135f83d9cdff4d1ee1aed77f95d453b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.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-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QAbstractSpinBox::inputMethodQuery(): Consider input method hints set on the ↵Friedemann Kleint2015-09-221-1/+10
| | | | | | | | | | | | | | | spin box. The derived classes (QSpinBox, QDoubleSpinBox, QDateTimeEdit, QTimeEdit) set various input method hints on the spin box in the init() methods of their private classes which did not have any effect since QAbstractSpinBox::inputMethodQuery() was implemented to return the hints of the embedded QLineEdit only. Change it so that hints set on the QAbstractSpinBox are also considered. Change-Id: I76b7c4d3e0869589c110cf3a0b2c3f94201db5d5 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* QDoubleSpinBox: Set back an upper limit widthCaroline Chao2015-03-231-4/+13
| | | | | | | | | | The limit has been removed in the change a317ee0a6fa76d1166f6da8593d39eaf7afce83c. Task-number: QTBUG-44865 Change-Id: I7106f7e7a2653e1ab03d79861ac505d4666598eb Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Fix crash when accessing QStyleHints before QGuiApplication is constructed.Friedemann Kleint2015-02-251-1/+1
| | | | | | | | | | | Make styleHints a static member variable of QGuiApplicationPrivate and fix accessor accordingly. Extend tst_QApplication::settableStyleHints() to run without QApplication instance as well and add a similar test to QGuiApplication. Task-number: QTBUG-44499 Change-Id: I42b92ef38f7dd512d08d70accfa7dd4f09a22f01 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.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-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Fix spin box with fine grained wheel eventsAllan Sandfeld Jensen2014-09-231-2/+5
| | | | | | | | | | | Only step the value in the spin box when we have accumulated one wheel tick worth of wheel delta. Also fixes the obsolete contructors of QWheelEvent so they set the non obsolete properties. Change-Id: Ic6ea4b37afa8eec85a6ca7bdc0d919bf8fb02608 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Accessibility: QSpinBox should not have any childrenFrederik Gladhorn2014-08-191-0/+1
| | | | | | | | | | On both iOS and Android it is very confusing to be able to move the focus to both, the line edit and the outer frame that is the spin box. For Linux this fixes an issue that orca would not read the value correctly after pressing the up/down buttons. Task-number: QTBUG-39861 Task-number: QTBUG-39442 Change-Id: I73c50c91e9021324c52d168d537afd0ea719a48f Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Add ReadOnlyChange event to widgets that support setReadOnly(bool).David Faure2014-03-131-0/+2
| | | | | | | | | | | | This is useful for widget styles to react when widgets are set read-only, e.g. to update their palette accordingly. [ChangeLog][QtWidgets] All widgets with a setReadOnly method now send a ReadOnlyChange event (e.g. for app-specific palette changes) Change-Id: I74719a3e1b7d034d9bfc94305f846f42aae935bd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QAbstractSpinBox: use QSignalBlockerMarc Mutz2013-10-301-4/+2
| | | | | | | | | | This change changes the point where signals are unblocked again in QAbstractSpinBoxPrivate::updateEdit() to include the final update() call. This should not be a problem, as update() merely posts an event and shouldn't emit any signals. Change-Id: I4b2ae109f057792b573ad6ea168ca77c18c773d0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* added QAbstractSpinBox::setGroupSeparatorShown function.Oto Magaldadze2013-10-291-1/+26
| | | | | | | | | | | [ChangeLog][QtWidgets][QAbstractSpinBox] QTBUG-5142 - This will allow a group (thousand) separator to be shown in QSpinBox and QDoubleSpinBox widgets. Task-number: QTBUG-5142 Change-Id: I2e23f5f83c93bb092a2dbd784e06d17d40d42909 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-1/+1
| | | | | | | | | | | | | | | | | 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>
* QDateTime - Split QDateTimeParser into a separate fileJohn Layt2013-09-091-1/+1
| | | | | | | | | | | | | Not strictly needed yet, but helps to reduce the size of QDateTime and make it easier to read a major re-write. Imposes separation of parser which will be needed if we make QLocale always use the system backends, after which only QDateTimeEdit widget will need the parser and it can be moved there. Change-Id: I6a5e9a3edf6fe8ff2340af6afecd8ba4bfde9dd4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Ensure the QLineEdit::returnPressed() signal is still emittedAndy Shaw2013-04-211-0/+1
| | | | | | | | | The signal needs to be emitted directly as the event is not passed to the QLineEdit if the QSpinBox gets the Key_Return. Since this signal may be relied upon then we ensure it is emitted directly. Change-Id: I17cdec62c9f995bacfd7d3cc66d6324f26c84c67 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.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>
* Fix sizeHint for QAbstractSpinBoxCaroline Chao2013-02-121-18/+20
| | | | | | | | | | | | | | | | | | | The current size hint is not correct and the text is truncated when using prefix/suffix. Update QCommonStyle::sizeFromContents() to get the button and frame widths into account for the QSpinBox width. Update sizeFromContents() in the different styles to be consistent with the change in QCommonStyle. Update minimumSizeHint(), calculate it using the prefix and data range. The SpinBox can shrunk over the suffix if any. Task-number: QTBUG-28863 Change-Id: Ia742232edf8b11d0283e8136c2818928f8755103 Reviewed-by: J-P Nurmi <jpnurmi@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 incorrect size hint for abstract spinboxJens Bache-Wiig2012-11-151-12/+1
| | | | | | | | | | | | | | | This size hint was based on strange logic from an alternate universe. The size hint should only contain the text size and let the style add what is neccessary for the frame rect etc. Most styles have worked around this by simply ignoring it, however some styles could still break a bit. Note that we add 4 since that is the constant that the old code 'usually' ended up at and should be compatible with our existing styles. Change-Id: Iebdbcb8949dd8b7daa7d8cb96ae5ab7351e4f79d Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix integer overflow in QSpinBox.Stephen Kelly2012-10-221-2/+17
| | | | | Change-Id: Ic204d42fbdffc44576f7e76132bc53621e836299 Reviewed-by: Marc Mutz <marc.mutz@kdab.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>
* Documentation fixes.Frederik Gladhorn2012-09-211-13/+0
| | | | | Change-Id: I2e234ec4307bbe39359cdfa8b13e86661dad43b6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Replace some Q_WS_X11 by check for platform's name.Friedemann Kleint2012-07-161-6/+2
| | | | | Change-Id: I33d7ce31e01c355e0d9e05c98d6a84ea4f6d5bbd Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Doc: Modularize QtWidgets documentation.Casper van Donderen2012-05-091-2/+2
| | | | | | | | This change moves the snippets and images to the modularized directories. Change-Id: Idec1afb9db7ea6add1ca4cf25ec4019d8bce0c4d Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtWidgets]Thiago Macieira2012-05-031-7/+7
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: Ie8ac500f2f8ebe99b7525feaa7b39247e641a461 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove QAccessibleEvent child parameter.Frederik Gladhorn2012-03-191-2/+2
| | | | | | | | | This makes the api cleaner and generally the child should not be there. It is only sometimes more convenient not to create a QAccessibleInterface instance, so the functionallity is kept. Change-Id: I26018a6d3e0549f4d79856775b4167c5660e229d Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Accessibility: add text update eventsFrederik Gladhorn2012-03-191-2/+2
| | | | | Change-Id: Iece9d100b3f5a379d7d8e29dea67a10d0c918c06 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Use pointers for QAccessibleEvent.Frederik Gladhorn2012-03-151-2/+4
| | | | | | | | | At least on mac g++ badly wants to copy the event and cannot use the copy ctor. The sensible solution is thus to use pointers. This is in line with QCoreApplication::sendEvent. Change-Id: Icb58852be351ab04ffa17069989d7a07d4b377da Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Call updateAccessibility with the right index.Frederik Gladhorn2012-03-081-2/+2
| | | | | | | | | | In Qt 4 index 0 was the widget itself. With the cleanup of child index this now changed. The default constructor uses -1 as parameter to signify that the widget is the cause, not a child. Change-Id: I329a1cc91bf2d1d1d8534739acbddfe107f40364 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-14/+14
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Accessibility: Use new updateAccessibility() API in widgets.Friedemann Kleint2012-02-011-2/+2
| | | | | Change-Id: Id69cc28a54abc675a991f2c657a446f38313ac6e Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Platform style hints: Introduce keyboard repeat rate.Friedemann Kleint2012-01-101-10/+2
| | | | | Change-Id: I556c2ecec7d5368122875a659af3ae7db88aa481 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>