diff options
Diffstat (limited to 'src/widgets/widgets/qlineedit_p.h')
-rw-r--r-- | src/widgets/widgets/qlineedit_p.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h index 71a67e3d10..3f98aab901 100644 --- a/src/widgets/widgets/qlineedit_p.h +++ b/src/widgets/widgets/qlineedit_p.h @@ -85,12 +85,15 @@ class Q_AUTOTEST_EXPORT QLineEditIconButton : public QToolButton Q_OBJECT Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) public: - explicit QLineEditIconButton(QWidget *parent = 0); + explicit QLineEditIconButton(QWidget *parent = nullptr); qreal opacity() const { return m_opacity; } void setOpacity(qreal value); -#ifndef QT_NO_ANIMATION - void animateShow(bool visible) { startOpacityAnimation(visible ? 1.0 : 0.0); } +#if QT_CONFIG(animation) + void animateShow(bool visible); + + bool shouldHideWithText() const; + void setHideWithText(bool hide); #endif protected: @@ -100,13 +103,23 @@ protected: private slots: void updateCursor(); +#if QT_CONFIG(animation) + void onAnimationFinished(); +#endif + private: -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) void startOpacityAnimation(qreal endValue); #endif QLineEditPrivate *lineEditPrivate() const; qreal m_opacity; + +#if QT_CONFIG(animation) + bool m_hideWithText = false; + bool m_wasHidden = false; +#endif + }; #endif // QT_CONFIG(toolbutton) @@ -121,7 +134,7 @@ public: }; struct SideWidgetEntry { - explicit SideWidgetEntry(QWidget *w = 0, QAction *a = 0, int _flags = 0) : widget(w), action(a), flags(_flags) {} + explicit SideWidgetEntry(QWidget *w = nullptr, QAction *a = nullptr, int _flags = 0) : widget(w), action(a), flags(_flags) {} QWidget *widget; QAction *action; @@ -138,7 +151,7 @@ public: QLineEditPrivate() : control(0), frame(1), contextMenuEnabled(1), cursorVisible(0), - dragEnabled(0), clickCausedFocus(0), hscroll(0), vscroll(0), + dragEnabled(0), clickCausedFocus(0), edited(0), hscroll(0), vscroll(0), alignment(Qt::AlignLeading | Qt::AlignVCenter), leftTextMargin(0), topTextMargin(0), rightTextMargin(0), bottomTextMargin(0), lastTextSize(0), mouseYThreshold(0) @@ -163,6 +176,7 @@ public: bool inSelection(int x) const; QRect cursorRect() const; void setCursorVisible(bool visible); + void setText(const QString& text); void updatePasswordEchoEditing(bool); @@ -189,6 +203,7 @@ public: uint cursorVisible : 1; uint dragEnabled : 1; uint clickCausedFocus : 1; + uint edited : 1; int hscroll; int vscroll; uint alignment; |