summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qlineedit_p.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential leak of QPropertyAnimation in QLineEditIconButtonMilian Wolff2024-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When startOpacityAnimation is triggered and the animation doesn't finish, it might get leaked during shutdown as shown by valgrind: ``` ==133963== 600 (16 direct, 584 indirect) bytes in 1 blocks are definitely lost in loss record 2,326 of 2,356 ==133963== at 0x4841FA3: operator new(unsigned long) (vg_replace_malloc.c:483) ==133963== by 0x12698E2D: QLineEditIconButton::startOpacityAnimation(double) (qlineedit_p.cpp:437) ==133963== by 0x1269900D: displayWidgets(std::vector<QLineEditPrivate::SideWidgetEntry, std::allocator<QLineEditPrivate::SideWidgetEntry> > const&, bool) (qlineedit_p.cpp:459) ==133963== by 0x126A1084: QLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qlineedit.cpp:276) ==133963== by 0x152D781E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3935) ==133963== by 0x1269AB01: QLineEdit::textChanged(QString const&) (moc_qlineedit.cpp:447) ==133963== by 0x126A0EF8: QLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qlineedit.cpp:255) ==133963== by 0x152D781E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3935) ==133963== by 0x126A1A94: QWidgetLineControl::textChanged(QString const&) (moc_qwidgetlinecontrol_p.cpp:273) ==133963== by 0x126A4C35: QWidgetLineControl::finishChange(int, bool, bool) (qwidgetlinecontrol.cpp:736) ==133963== by 0x126A4F05: QWidgetLineControl::internalSetText(QString const&, int, bool) (qwidgetlinecontrol.cpp:772) ==133963== by 0x12698AF4: setText (qwidgetlinecontrol_p.h:251) ==133963== by 0x12698AF4: QLineEditPrivate::setText(QString const&) (qlineedit_p.cpp:277) ``` Note that the line numbers above are potentially slightly off as that backtrace was recorded on Qt 5.15.9. Pick-to: 6.7 6.6 6.5 6.2 5.15 Change-Id: Ie79744d98d2783e4644e18ec51892c0bc43c1557 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QLineEdit: Use pmf-style connectsChristian Ehrlicher2024-01-101-41/+67
| | | | | | | | Port all string-based signal/slots connections to pmf-style connects. Pick-to: 6.7 Change-Id: I975232a3fedf82cd3327638a0ee119d1f2a90d84 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Fix build with -no-feature-animationTasuku Suzuki2023-03-041-1/+1
| | | | | | Pick-to: 6.5 Change-Id: Ibd786bc140051ed09d65c6a784ad52c6a1ef7987 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-toolbuttonTasuku Suzuki2023-02-111-1/+1
| | | | | | Pick-to: 6.5 Change-Id: Id583165602e84ea0fae972c377ced30e4a4d96cb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace QT_NO_ACCESSIBILITY with QT_CONFIG(accessibility)Allan Sandfeld Jensen2022-06-151-2/+2
| | | | | | | Pick-to: 6.4 Change-Id: Iee4bd8970810be1b23bdba65a74de912401dca65 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QStyle: allow styles to control the margin around icons in QLineEditWang Peng2021-08-171-1/+1
| | | | | | | | | The styles can't control the margin of the icon container, and its value is hardcoded to a quarter of the iconSize, which is very unfriendly. Add a PixelMetric enum value to allow styles to control the margin. Change-Id: I21274b68d24150db7be78513fe9125f775aa2b00 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix placement of placeholder text in QLineEdits with action iconsVolker Hilsheimer2021-07-061-2/+3
| | | | | | | | | | | | | | | | | | | | After dc794f7622bc00f7ca50fab65d6965695d6d2972, side widgets only got space if they were not fading out, but the logic was not correctly accounting for side widgets that never fade, such as buttons added via QLineEdit::addAction. Fix this to give visible widgets space, unless they are fading out. That was the intent of the original change. Rename the variable to make its purpose clearer, and reset it at the end of the fade-out animation. Add a much-needed test that relies on private APIs to verify that the effective margins are calculated correctly. Fixes: QTBUG-94824 Pick-to: 6.2 6.1 5.15 Change-Id: If2ee6be52be9e4f9be1e91f72f27681ce27def6d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix misplacement of placeholder text in QLineEdit with RTL contentFan RuiJie2021-06-041-3/+11
| | | | | | | | | | | | | | | | | | | | | | | The placeholder text was rendered in the wrong position after clicking on the clear button in a QLineEdit with right-to-left content. The button was still taking up space while it was fading out, so the first paintEvent rendered the placeholder with space reserved for the clear button. Once the button gets hidden, no new update was issued, so garbage was left behind. Fix this by not giving a fading-out clear button any margin space. The result of this is that the placeholder text is visible underneath the fading-out clear button. This is preferable to the placeholder text being first rendered next to the fading-out clear button, and then popping to the edge when the clear button is hidden (which would have been the result of issuing a complete update for the line edit at the end of the fade-out animation). Fixes: QTBUG-93742 Pick-to: 6.1 6.0 5.15 Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: Id0429362a60bba6839aa02068b00edb15e3ab8ab Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Android: Add select and copy capability to read-only text widgetsPiotr Mikolajczyk2021-03-301-0/+12
| | | | | | | | | | | | | | | | In case of a read-only text editing widget it was imposibble to copy text from it. In QtWidgets you could not even see the selection handless. Text selection in QtWidgets module was filtered depending on readOnly property of the widget. Additionally, in InputMethod the read-only state was translated into disabled. Patch also makes the edit menu to be aware of the read-only status of the control - the menu items are different for rw and ro controls. Task-number: QTBUG-91417 Change-Id: Ic7b27f78678eeaa87a38607af787f254db1383b8 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Add setting the ICON size attribute in lineedit to the style pluginTang Haixiang2021-03-121-1/+1
| | | | | | | | | When the font is large enough, using PM_SmallIconSize will get a large lineedit,but the icon is very small. This is very unsightly, and the style plug-in hopes to be able to define the size of the icon by itself. Change-Id: I0e35b331301472541d3378e748dbcd074d5419a2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QLineEdit: Fix editingFinished() not being emitted when pressing the clear ↵Dong Rui2021-02-221-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. Pick-to: 5.15 6.0 Fixes: QTBUG-83295 Change-Id: Ie4bc6d9a2f27f89163c05c4c15175540c7631a30 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Fix redundant emission of editingFinished from QLineEdit with Return keyChristian Heimlich2020-09-231-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Port QtBase to the new QIcon::pixmap() APIMorten Johan Sørvig2020-08-291-2/+1
| | | | | | | | | | | | | | The target devicePixelRatio can now be passed to the pixmap() function, instead of a QWindow pointer. This allows us to remove some usage of the QWidget pointer in the styles, since the DPR is accessible from the passed in painter. The QWidget pointer is still used in places where we don't have a painter. Task-number: QTBUG-85885 Change-Id: Ifecc669f5bad655e289a936d71bafe02605f21a4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QLineEdit: Fix cursor drawing issuesLu YaNing2020-07-231-1/+2
| | | | | | | | | | | | | | | | Entering Chinese in some fonts in an English environment causes the cursor drawing coordinates to exceed the updated coordinates, leaving behind stale pixels at the top. Keep the refresh and draw area calculation methods the same when rendering the contents in QLineEdit::paintEvent, and when calculating the update area in QLineEditPrivate::adjustedControlRect. Fixes: QTBUG-85569 Pick-to: 5.15 Change-Id: I978cb56f24f961086b1271e56d07ad1ced16f8ff Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port QtWidgets from QStringRef to QStringViewLars Knoll2020-06-101-1/+1
| | | | | Change-Id: Ibe348e7aea838ab8c2d628bb43709c867a506637 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-081-1/+1
| | | | | | | Many of these were generated by clazy using the new qevent-accessors check. Change-Id: Ie17af17f50fdc9f47d7859d267c14568cc350fd0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtWidgets: fix a few more int/char -> QChar conversionsMarc Mutz2020-04-301-1/+1
| | | | | | | | | | They were masked by all QChar ctors being made explicit, except the char16_t one, which was left as the only viable choice. Change-Id: I210d50dc243391ad2c7dd353ba9ae40147585d04 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove QGuiAction again and split QAction implementation up insteadVolker Hilsheimer2020-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | Duplicating the number of classes is a high price to pay to be able to have some QAction functionality behave differently, or be only available in widgets applications. Instead, declare the entire API in QtGui in QAction* classes, and delegate the implementation of QtWidgets specific functionality to the private. The creation of the private is then delegated to the Q(Gui)ApplicationPrivate instance through a virtual factory function. Change some public APIs that are primarily useful for specialized tools such as Designer to operate on QObject* rather than QWidget*. APIs that depend on QtWidgets types have been turned into inline template functions, so that they are instantiated only at the caller side, where we can expect the respective types to be fully defined. This way, we only need to forward declare a few classes in the header, and don't need to generate any additional code for e.g. language bindings. Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-091-3/+3
|\ | | | | | | Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
| * Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | QAction: Properly port to the new configure systemFriedemann Kleint2019-11-011-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QT_REQUIRE_CONFIG in the headers of classes to be disabled. Add headers/source files in the .pro file depending on the configure feature in libraries and tests. Add the necessary exclusions and use QT_CONFIG. Only the widgets/kernel tests were made to compile since also the buttons depend on the action feature and it would become too involved. Task-number: QTBUG-69478 Change-Id: Id5bf88bc108f2bbb14dce8625bfdcb7eb0deb8e3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Extract QGuiAction(Group) from QAction(Group) into QtGuiFriedemann Kleint2019-10-311-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simply moving QAction to QtGui was not deemed possible since it operates on a set of controls of some kind. The approach to extract a base class was taken instead, named QGuiAction following the QGuiApplication scheme. QAction remains in widgets, but changes base class. For QActionGroup, the functions addAction(text/icon), which create an action, cannot be implemented in QtGui, hence a base class is needed, too (unless they are deprecated and removed). - Extract base classes providing functionality not based on QtWidgets, using virtuals in QGuiActionPrivate to provide customization points - Change QActionEvent to take QGuiAction, removing the need to forward declare QAction in QtGui [ChangeLog][QtGui] Added QGuiAction(Group) and made the equivalent existing classes in Qt Widgets derive from them. This provides basic functionality for implementing actions in QML. Task-number: QTBUG-69478 Change-Id: Ic490a5e3470939ee8af612d46ff41d4c8c91fbdf Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QLineEdit: use QMargins internally instead of 4 x intMarc Mutz2019-07-301-11/+6
| | | | | | | | | | | Replace the four ints xTextMargin with one QMargins member, and the effectiveXTextMargin() function with effectiveTextMargins(). The left and right effective margins were always used together, so this in no case leads to extra work, compared to separate functions. Change-Id: I46d061919ffac297142213ccb4033caa0288b554 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add accessors for QWindow and QScreen to QWidgetPrivateFriedemann Kleint2019-06-181-3/+1
| | | | | | | | | | | | | | | | | Rewrite the existing accessor QWidgetPrivate::windowHandle() to accept a mode enumeration that has an "Any" convenience. Based on that, add QWidgetPrivate::associatedScreen(), which is seful in many places where scaling is performed. Prototypically simplify the code. Task-number: QTBUG-62094 Task-number: QTBUG-73231 Change-Id: I516288363d329bce9bc94e4951106f9357bc6cde Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QLineEdit: don't emit editingFinished if nothing was doneSamuel Gaist2019-02-121-0/+7
| | | | | | | | | | | | | | | | | | | When a modal dialog is called from a slot connected to the editingFinished signal, the chain of events resulting from the focus returning to this widget will make the editingFinished signal emitted again. This patch uses a new variable to keep track of the fact that there was a modification. Once editingFinished was emitted, that flag is cleared so next time the signal will be emitted again only if a modification was made to the line edit content. [ChangeLog][QtWidget][QLineEdit] Behavior change: now the editingFinished signal is emitted only once after the line edit content was edited. Fixes: QTBUG-40 Change-Id: Ia4760bad8717f1758c3939132c446b4b4c6cd498 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QDrag: mark QDrag::start() as deprecatedChristian Ehrlicher2019-01-231-1/+1
| | | | | | | | | | QDrag::start() is deprecated since Qt4. Therefore annotate it with Q_DEPRECATED so it can be removed in Qt6. Change-Id: I5b82c482fa579f357cc67e38b86e6fe587f18ded Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix calculation of text margin if line edit contains side widgetsVitaly Fanaskov2018-11-261-28/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation leads to infinite chain of showing/hidden line edit under circumstances described in QTBUG-54676. We basically got the situation when size hint were calculated differently depending on the line edit visibility state. In this case toolbar layout have to show/hide extension button and line edit a lot of times and can never leave this "loop" (please note, that the chain is much more complicated in reality): Resize toolbar -> Set layout geometry -> Size is OK to display line edit -> Set layout geometry -> Hide extension button -> Set layout geometry (wrong size is calculated here, so "run out of space") -> Hide line edit -> Set layout geometry -> Show extension button -> Set layout geometry - > Size is OK to display line edit ... And we're in the "loop" Clear button is hidden if there is no text in a line edit. In the previous implementation, the button was always visible, only opacity was changing in order to "hide" the button. It resulted to incorrect size hints (regular and minimum). In the current implementation the button is really hidden/shown, and size hints calculated correctly. Also updated unit test for line edit. Remove code duplication in functions for calculation text margin Fixes: QTBUG-54676 Change-Id: I4549c9ea98e10b750ba855a07037f6392276358b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-171-1/+3
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
| * Modernize the "animation" featureLiang Qi2018-10-121-1/+3
| | | | | | | | | | | | Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | QLineEdit: take the size of actions' icons from a styleAlexander Volkov2018-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | The height of a line edit depends on the height of its font, which in turn depends on DPI. So use the DPI-scaled icon size from a style instead of hard-coded values. Task-number: QTBUG-65627 Change-Id: Ic1f5af61b0d6346cfbc828817c4a3a39296a41ba Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Fix build with '-no-feature-action' configurationValentin Fokin2018-07-121-0/+6
| | | | | | | | | | | | | | Task-number: QTBUG-68353 Change-Id: Ia949e4a72a363df5fba86504e5f7e3ce8a3ad347 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-071-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/kernel/qeventdispatcher_cf.mm src/gui/kernel/qguiapplication_p.h src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/qioseventdispatcher.mm src/plugins/platforms/windows/qwindowsdrag.h src/plugins/platforms/windows/qwindowsinternalmimedata.h src/plugins/platforms/windows/qwindowsmime.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
| * Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-05-291-3/+4
| | | | | | | | | | | | | | | | | | We move QInternalMimeData to a separate file, because this class is used, even if draganddrop is disabled. From now on, include qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData. Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | QLineEdit: Add an inputRejected() signal for when a key is not allowedAndy Shaw2018-06-011-0/+1
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtWidgets][QLineEdit] Added inputRejected() signal for when a key press is not accepted by the QLineEdit. For instance, when an invalid key is pressed for a validator set. Task-number: QTBUG-57448 Change-Id: I39182a78b07b37c6da01905b8da4c57930e3454b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | qlineedit: Use QIcon::Active for pressed action buttonKai Uwe Broulik2018-03-061-3/+1
|/ | | | | | | | | | | | | | | Qt should be using its own API in the way it's meant to be. If there's an issue with Qt's built-in styles it has to be fixed there. Otherwise this causes problems with styles, such as KDE's Breeze, which make use of both Selected and Active states for icons. However, Qt's built-in styles do not have hover effects for tool bar buttons and menu items, so there's somewhat of a conflict here which was probably the reason for the workaround used. Change-Id: Ieaed580f548caf181b1005b4e82e3f2adc1f9ce5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QLineEdit: implement quick text selection by mouseElvis Angelaccio2018-02-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | This is a standard feature in GtkEntry widgets or HTML <input type="text"> elements. During a normal text selection by mouse (LeftButton press + mouse move event), it's now possible to quickly select all the text from the start of the selection to the end of the line edit by moving the mouse cursor down. By moving it up instead, all the text up to the start of the line edit gets selected. If the layout direction is right-to-left, the semantic of the mouse movement is inverted. This feature is only enabled if the y() of the mouse move event is bigger than a fixed threshold, to avoid unexpected selections in the normal case. This threshold is set by the QPlatformTheme and a value smaller than zero disables this feature. The threshold is updated whenever the style or the screen changes. [ChangeLog][QtWidgets][QLineEdit] Implemented quick text selection by mouse in QLineEdit. Change-Id: I4de33c2d11c033ec295de2b2ea81adf786324f4b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-261-7/+4
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
| * Convert features.lineedit to QT_[REQUIRE_]CONFIGStephan Binner2017-09-121-4/+0
| | | | | | | | | | Change-Id: I509977994b11a7fc0c109bfcc83aadeee6c9b0b8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.spinbox to QT_[REQUIRE_]CONFIGStephan Binner2017-09-121-0/+1
| | | | | | | | | | Change-Id: Idecb6927c20ff009795b0ad94bbb7199df98a8f8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.completer to QT_[REQUIRE_]CONFIGStephan Binner2017-09-041-3/+3
| | | | | | | | | | Change-Id: If45a46c08b37d245229a39f3d6ffbb34154934f2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-2/+2
|/ | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Convert features.graphicsview to QT_[REQUIRE_]CONFIGStephan Binner2017-08-151-0/+1
| | | | | Change-Id: I1083097802772624e5d414678b4612308683a56f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.itemviews to QT_[REQUIRE_]CONFIGStephan Binner2017-07-251-0/+2
| | | | | | | The QT_NO_ITEMVIEWS queries in corelib/ seem to had no effect at all. Change-Id: I494ee2309a96b0cf25de18781fc9a675878a2ee9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QLineEdit: Make the clear button always the leftmost buttonElvis Angelaccio2017-04-191-0/+11
| | | | | | | | | | | | | | QLineEditIconButton currently draws a fully transparent pixmap in its paintEvent() function, when the line edit is empty. This does not work when there is another trailing QAction that is visible even when the line edit has no text, as reported in QTBUG-59957. To fix this issue, make sure the clear button is always the leftmost button. Task-number: QTBUG-59957 Change-Id: I8a4f96aae07856aa0e1053ebb338ba9bdf052a16 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add GHS internal id TOOLS-26637 to bug workaround commentsKimmo Ollila2017-03-281-1/+2
| | | | | | Change-Id: I653e0b16e08e6167891603f47298554a87352765 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Workaround GHS compiler bugKimmo Ollila2017-03-271-0/+12
| | | | | | | | This temporary workaround allows to compile with GHS toolchain and should be removed when GHS provides patch to fix the compiler issue. Change-Id: I0d0eac8054e6ba2f448fed3d3c80a518e0d2af97 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QLineEditPrivate: introduce SideWidgetLocation classMarc Mutz2017-03-061-14/+13
| | | | | | | | | | | | ... as a replacement for QPair<enum, int>, and move some repsonsibilities into it. This avoids the repeated use of the magic number -1 to indicate invalid locations and does away with the confusing .first and .second, replacing them instead with proper names, .position and .index. Change-Id: If904c5333cecf8ce3d5160ca4be9264a13a2b72a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Build fix for -no-feature-actionPaul Olav Tvete2017-03-011-0/+10
| | | | | Change-Id: I62291af347dca7c1bb4a53d2cb698e4f1a38743d Reviewed-by: Lars Knoll <lars.knoll@qt.io>