From 232ed0a7c0eb9a54503af550684f2308c4593fdd Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 12 Feb 2017 23:41:29 +0300 Subject: [PATCH] Fix build of the new TWidgetHelper<> for Clang and GCC. --- Telegram/SourceFiles/ui/twidget.h | 24 +++++++++---------- .../SourceFiles/ui/widgets/input_fields.h | 21 ---------------- Telegram/SourceFiles/ui/widgets/scroll_area.h | 4 ++-- 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/Telegram/SourceFiles/ui/twidget.h b/Telegram/SourceFiles/ui/twidget.h index c214bd225..36a27d35c 100644 --- a/Telegram/SourceFiles/ui/twidget.h +++ b/Telegram/SourceFiles/ui/twidget.h @@ -140,13 +140,13 @@ public: auto margins = getMargins(); x -= margins.left(); y -= margins.top(); - move(rtl() ? ((outerw > 0 ? outerw : parentWidget()->width()) - x - width()) : x, y); + Base::move(rtl() ? ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - Base::width()) : x, y); } void moveToRight(int x, int y, int outerw = 0) { auto margins = getMargins(); x -= margins.right(); y -= margins.top(); - move(rtl() ? x : ((outerw > 0 ? outerw : parentWidget()->width()) - x - width()), y); + Base::move(rtl() ? x : ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - Base::width()), y); } void setGeometryToLeft(int x, int y, int w, int h, int outerw = 0) { auto margins = getMargins(); @@ -154,7 +154,7 @@ public: y -= margins.top(); w -= margins.left() - margins.right(); h -= margins.top() - margins.bottom(); - setGeometry(rtl() ? ((outerw > 0 ? outerw : parentWidget()->width()) - x - w) : x, y, w, h); + Base::setGeometry(rtl() ? ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - w) : x, y, w, h); } void setGeometryToRight(int x, int y, int w, int h, int outerw = 0) { auto margins = getMargins(); @@ -162,25 +162,25 @@ public: y -= margins.top(); w -= margins.left() - margins.right(); h -= margins.top() - margins.bottom(); - setGeometry(rtl() ? x : ((outerw > 0 ? outerw : parentWidget()->width()) - x - w), y, w, h); + Base::setGeometry(rtl() ? x : ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - w), y, w, h); } QPoint myrtlpoint(int x, int y) const { - return rtlpoint(x, y, width()); + return rtlpoint(x, y, Base::width()); } QPoint myrtlpoint(const QPoint p) const { - return rtlpoint(p, width()); + return rtlpoint(p, Base::width()); } QRect myrtlrect(int x, int y, int w, int h) const { - return rtlrect(x, y, w, h, width()); + return rtlrect(x, y, w, h, Base::width()); } QRect myrtlrect(const QRect &r) const { - return rtlrect(r, width()); + return rtlrect(r, Base::width()); } void rtlupdate(const QRect &r) { - update(myrtlrect(r)); + Base::update(myrtlrect(r)); } void rtlupdate(int x, int y, int w, int h) { - update(myrtlrect(x, y, w, h)); + Base::update(myrtlrect(x, y, w, h)); } protected: @@ -214,10 +214,10 @@ protected: private: TWidget *tparent() { - return qobject_cast(parentWidget()); + return qobject_cast(Base::parentWidget()); } const TWidget *tparent() const { - return qobject_cast(parentWidget()); + return qobject_cast(Base::parentWidget()); } }; diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.h b/Telegram/SourceFiles/ui/widgets/input_fields.h index ec563db33..6ae2f2beb 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.h +++ b/Telegram/SourceFiles/ui/widgets/input_fields.h @@ -130,13 +130,6 @@ signals: void linksChanged(); protected: - void enterEventHook(QEvent *e) { - return QTextEdit::enterEvent(e); - } - void leaveEventHook(QEvent *e) { - return QTextEdit::leaveEvent(e); - } - bool viewportEvent(QEvent *e) override; void touchEvent(QTouchEvent *e); void paintEvent(QPaintEvent *e) override; @@ -272,13 +265,6 @@ signals: void blurred(); protected: - void enterEventHook(QEvent *e) { - return QLineEdit::enterEvent(e); - } - void leaveEventHook(QEvent *e) { - return QLineEdit::leaveEvent(e); - } - bool event(QEvent *e) override; void touchEvent(QTouchEvent *e); void paintEvent(QPaintEvent *e) override; @@ -746,13 +732,6 @@ protected: void resizeEvent(QResizeEvent *e) override; void contextMenuEvent(QContextMenuEvent *e) override; - void enterEventHook(QEvent *e) { - return QLineEdit::enterEvent(e); - } - void leaveEventHook(QEvent *e) { - return QLineEdit::leaveEvent(e); - } - virtual void correctValue(const QString &was, int32 wasCursor, QString &now, int32 &nowCursor) { } void setCorrectedText(QString &now, int &nowCursor, const QString &newText, int newPos); diff --git a/Telegram/SourceFiles/ui/widgets/scroll_area.h b/Telegram/SourceFiles/ui/widgets/scroll_area.h index f48112540..83fa8b122 100644 --- a/Telegram/SourceFiles/ui/widgets/scroll_area.h +++ b/Telegram/SourceFiles/ui/widgets/scroll_area.h @@ -211,8 +211,8 @@ protected: void moveEvent(QMoveEvent *e) override; void touchEvent(QTouchEvent *e); - void enterEventHook(QEvent *e); - void leaveEventHook(QEvent *e); + void enterEventHook(QEvent *e) override; + void leaveEventHook(QEvent *e) override; public slots: void scrollToY(int toTop, int toBottom = -1);