diff --git a/ui/layers/box_content.h b/ui/layers/box_content.h index 8c738d1..d5eb32e 100644 --- a/ui/layers/box_content.h +++ b/ui/layers/box_content.h @@ -197,7 +197,7 @@ public: void scrollByDraggingDelta(int delta); -public slots: +public Q_SLOTS: void onScrollToY(int top, int bottom = -1); protected: @@ -260,7 +260,7 @@ protected: void paintEvent(QPaintEvent *e) override; void keyPressEvent(QKeyEvent *e) override; -private slots: +private Q_SLOTS: void onScroll(); void onInnerResize(); diff --git a/ui/platform/linux/ui_linux_wayland_integration.cpp b/ui/platform/linux/ui_linux_wayland_integration.cpp index 7cb7dd1..45f0112 100644 --- a/ui/platform/linux/ui_linux_wayland_integration.cpp +++ b/ui/platform/linux/ui_linux_wayland_integration.cpp @@ -11,6 +11,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include +// private headers are using keywords :( +#ifdef QT_NO_KEYWORDS +#define signals Q_SIGNALS +#define slots Q_SLOTS +#endif // QT_NO_KEYWORDS + #include #include #include diff --git a/ui/platform/win/ui_window_win.cpp b/ui/platform/win/ui_window_win.cpp index 7253b69..9a12ef5 100644 --- a/ui/platform/win/ui_window_win.cpp +++ b/ui/platform/win/ui_window_win.cpp @@ -351,7 +351,7 @@ bool WindowHelper::handleNativeEvent( } else if (wParam == SIZE_MINIMIZED) { state = Qt::WindowMinimized; } - emit window()->windowHandle()->windowStateChanged(state); + window()->windowHandle()->windowStateChanged(state); } updateMargins(); const auto changes = (wParam == SIZE_MINIMIZED diff --git a/ui/widgets/dropdown_menu.cpp b/ui/widgets/dropdown_menu.cpp index a8f1960..d70ddb8 100644 --- a/ui/widgets/dropdown_menu.cpp +++ b/ui/widgets/dropdown_menu.cpp @@ -95,7 +95,7 @@ void DropdownMenu::handleTriggered(const Menu::CallbackData &data) { if (!popupSubmenuFromAction(data)) { hideMenu(); _triggering = true; - emit data.action->trigger(); + data.action->trigger(); _triggering = false; if (_deleteLater) { _deleteLater = false; diff --git a/ui/widgets/dropdown_menu.h b/ui/widgets/dropdown_menu.h index 166616f..d852875 100644 --- a/ui/widgets/dropdown_menu.h +++ b/ui/widgets/dropdown_menu.h @@ -39,7 +39,7 @@ protected: void mouseMoveEvent(QMouseEvent *e) override; void mousePressEvent(QMouseEvent *e) override; -private slots: +private Q_SLOTS: void onHidden() { hideFinish(); } diff --git a/ui/widgets/inner_dropdown.h b/ui/widgets/inner_dropdown.h index be29bf4..e19a1ea 100644 --- a/ui/widgets/inner_dropdown.h +++ b/ui/widgets/inner_dropdown.h @@ -81,7 +81,7 @@ protected: int resizeGetHeight(int newWidth) override; -private slots: +private Q_SLOTS: void onHideAnimated() { hideAnimated(); } diff --git a/ui/widgets/input_fields.cpp b/ui/widgets/input_fields.cpp index 071ba62..bb51148 100644 --- a/ui/widgets/input_fields.cpp +++ b/ui/widgets/input_fields.cpp @@ -1081,7 +1081,7 @@ void FlatInput::focusInEvent(QFocusEvent *e) { update(); } QLineEdit::focusInEvent(e); - emit focused(); + focused(); } void FlatInput::focusOutEvent(QFocusEvent *e) { @@ -1095,7 +1095,7 @@ void FlatInput::focusOutEvent(QFocusEvent *e) { update(); } QLineEdit::focusOutEvent(e); - emit blurred(); + blurred(); } void FlatInput::resizeEvent(QResizeEvent *e) { @@ -1183,13 +1183,13 @@ void FlatInput::keyPressEvent(QKeyEvent *e) { if (wasText == newText) { // call correct manually correctValue(wasText, newText); _oldtext = newText; - if (wasText != _oldtext) emit changed(); + if (wasText != _oldtext) changed(); updatePlaceholder(); } if (e->key() == Qt::Key_Escape) { - emit cancelled(); + cancelled(); } else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { - emit submitted(e->modifiers()); + submitted(e->modifiers()); #ifdef Q_OS_MAC } else if (e->key() == Qt::Key_E && e->modifiers().testFlag(Qt::ControlModifier)) { auto selected = selectedText(); @@ -1205,7 +1205,7 @@ void FlatInput::onTextEdited() { correctValue(wasText, newText); _oldtext = newText; - if (wasText != _oldtext) emit changed(); + if (wasText != _oldtext) changed(); updatePlaceholder(); Integration::Instance().textActionsUpdated(); @@ -1585,7 +1585,7 @@ bool InputField::heightAutoupdated() { void InputField::checkContentHeight() { if (heightAutoupdated()) { - emit resized(); + resized(); } } @@ -1771,13 +1771,13 @@ void InputField::focusInEventInner(QFocusEvent *e) { : (width() / 2); setFocused(true); _inner->QTextEdit::focusInEvent(e); - emit focused(); + focused(); } void InputField::focusOutEventInner(QFocusEvent *e) { setFocused(false); _inner->QTextEdit::focusOutEvent(e); - emit blurred(); + blurred(); } void InputField::setFocused(bool focused) { @@ -2306,7 +2306,7 @@ void InputField::handleContentsChanged() { if (tagsChanged || (_lastTextWithTags.text != currentText)) { _lastTextWithTags.text = currentText; const auto weak = MakeWeak(this); - emit changed(); + changed(); if (!weak) { return; } @@ -2661,15 +2661,15 @@ void InputField::keyPressEventInner(QKeyEvent *e) { && revertFormatReplace()) { e->accept(); } else if (enter && enterSubmit) { - emit submitted(e->modifiers()); + submitted(e->modifiers()); } else if (e->key() == Qt::Key_Escape) { e->ignore(); - emit cancelled(); + cancelled(); } else if (e->key() == Qt::Key_Tab || e->key() == Qt::Key_Backtab) { if (alt || ctrl) { e->ignore(); } else if (_customTab) { - emit tabbed(); + tabbed(); } else if (!focusNextPrevChild(e->key() == Qt::Key_Tab && !shift)) { e->ignore(); } @@ -3828,13 +3828,13 @@ void MaskedInputField::focusInEvent(QFocusEvent *e) { _borderAnimationStart = (e->reason() == Qt::MouseFocusReason) ? mapFromGlobal(QCursor::pos()).x() : (width() / 2); setFocused(true); QLineEdit::focusInEvent(e); - emit focused(); + focused(); } void MaskedInputField::focusOutEvent(QFocusEvent *e) { setFocused(false); QLineEdit::focusOutEvent(e); - emit blurred(); + blurred(); } void MaskedInputField::setFocused(bool focused) { @@ -3960,14 +3960,14 @@ void MaskedInputField::keyPressEvent(QKeyEvent *e) { correctValue(wasText, wasCursor, newText, newCursor); _oldtext = newText; _oldcursor = newCursor; - if (wasText != _oldtext) emit changed(); + if (wasText != _oldtext) changed(); startPlaceholderAnimation(); } if (e->key() == Qt::Key_Escape) { e->ignore(); - emit cancelled(); + cancelled(); } else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { - emit submitted(e->modifiers()); + submitted(e->modifiers()); #ifdef Q_OS_MAC } else if (e->key() == Qt::Key_E && e->modifiers().testFlag(Qt::ControlModifier)) { auto selected = selectedText(); @@ -3985,7 +3985,7 @@ void MaskedInputField::onTextEdited() { correctValue(wasText, wasCursor, newText, newCursor); _oldtext = newText; _oldcursor = newCursor; - if (wasText != _oldtext) emit changed(); + if (wasText != _oldtext) changed(); startPlaceholderAnimation(); Integration::Instance().textActionsUpdated(); diff --git a/ui/widgets/input_fields.h b/ui/widgets/input_fields.h index 7619274..daee290 100644 --- a/ui/widgets/input_fields.h +++ b/ui/widgets/input_fields.h @@ -83,13 +83,13 @@ public: return _oldtext; } -public slots: +public Q_SLOTS: void onTextChange(const QString &text); void onTextEdited(); void onTouchTimer(); -signals: +Q_SIGNALS: void changed(); void cancelled(); void submitted(Qt::KeyboardModifiers); @@ -336,7 +336,7 @@ public: ~InputField(); -private slots: +private Q_SLOTS: void onTouchTimer(); void onDocumentContentsChange(int position, int charsRemoved, int charsAdded); @@ -347,7 +347,7 @@ private slots: void onFocusInner(); -signals: +Q_SIGNALS: void changed(); void submitted(Qt::KeyboardModifiers); void cancelled(); @@ -587,7 +587,7 @@ public: startPlaceholderAnimation(); } -public slots: +public Q_SLOTS: void onTextChange(const QString &text); void onCursorPositionChanged(int oldPosition, int position); @@ -595,7 +595,7 @@ public slots: void onTouchTimer(); -signals: +Q_SIGNALS: void changed(); void cancelled(); void submitted(Qt::KeyboardModifiers); diff --git a/ui/widgets/labels.h b/ui/widgets/labels.h index c4327c8..c43bf0f 100644 --- a/ui/widgets/labels.h +++ b/ui/widgets/labels.h @@ -166,7 +166,7 @@ protected: int resizeGetHeight(int newWidth) override; -private slots: +private Q_SLOTS: void onCopySelectedText(); void onCopyContextText(); diff --git a/ui/widgets/popup_menu.cpp b/ui/widgets/popup_menu.cpp index 38d0acc..22212bb 100644 --- a/ui/widgets/popup_menu.cpp +++ b/ui/widgets/popup_menu.cpp @@ -175,7 +175,7 @@ void PopupMenu::handleTriggered(const Menu::CallbackData &data) { if (!popupSubmenuFromAction(data)) { _triggering = true; hideMenu(); - emit data.action->trigger(); + data.action->trigger(); _triggering = false; if (_deleteLater) { _deleteLater = false; diff --git a/ui/widgets/scroll_area.cpp b/ui/widgets/scroll_area.cpp index 526bd06..b67f72b 100644 --- a/ui/widgets/scroll_area.cpp +++ b/ui/widgets/scroll_area.cpp @@ -76,8 +76,8 @@ void ScrollBar::updateBar(bool force) { if (h >= rh || !area()->scrollTopMax() || rh < _st->minHeight) { if (!isHidden()) hide(); bool newTopSh = (_st->topsh < 0), newBottomSh = (_st->bottomsh < 0); - if (newTopSh != _topSh || force) emit topShadowVisibility(_topSh = newTopSh); - if (newBottomSh != _bottomSh || force) emit bottomShadowVisibility(_bottomSh = newBottomSh); + if (newTopSh != _topSh || force) topShadowVisibility(_topSh = newTopSh); + if (newBottomSh != _bottomSh || force) bottomShadowVisibility(_bottomSh = newBottomSh); return; } @@ -105,8 +105,8 @@ void ScrollBar::updateBar(bool force) { } if (_vertical) { bool newTopSh = (_st->topsh < 0) || (area()->scrollTop() > _st->topsh), newBottomSh = (_st->bottomsh < 0) || (area()->scrollTop() < area()->scrollTopMax() - _st->bottomsh); - if (newTopSh != _topSh || force) emit topShadowVisibility(_topSh = newTopSh); - if (newBottomSh != _bottomSh || force) emit bottomShadowVisibility(_bottomSh = newBottomSh); + if (newTopSh != _topSh || force) topShadowVisibility(_topSh = newTopSh); + if (newBottomSh != _bottomSh || force) bottomShadowVisibility(_bottomSh = newBottomSh); } if (isHidden()) show(); } @@ -252,7 +252,7 @@ void ScrollBar::mousePressEvent(QMouseEvent *e) { } area()->setMovingByScrollBar(true); - emit area()->scrollStarted(); + area()->scrollStarted(); } void ScrollBar::mouseReleaseEvent(QMouseEvent *e) { @@ -260,7 +260,7 @@ void ScrollBar::mouseReleaseEvent(QMouseEvent *e) { setMoving(false); area()->setMovingByScrollBar(false); - emit area()->scrollFinished(); + area()->scrollFinished(); } if (!_over) { setMouseTracking(false); @@ -342,7 +342,7 @@ void ScrollArea::onScrolled() { } } if (em) { - emit scrolled(); + scrolled(); if (!_movingByScrollBar) { SendSynteticMouseEvent(this, QEvent::MouseMove, Qt::NoButton); } @@ -350,7 +350,7 @@ void ScrollArea::onScrolled() { } void ScrollArea::onInnerResized() { - emit innerResized(); + innerResized(); } int ScrollArea::scrollWidth() const { @@ -601,12 +601,12 @@ void ScrollArea::resizeEvent(QResizeEvent *e) { _verticalBar->recountSize(); _topShadow->setGeometry(QRect(0, 0, width(), qAbs(_st.topsh))); _bottomShadow->setGeometry(QRect(0, height() - qAbs(_st.bottomsh), width(), qAbs(_st.bottomsh))); - emit geometryChanged(); + geometryChanged(); } void ScrollArea::moveEvent(QMoveEvent *e) { QScrollArea::moveEvent(e); - emit geometryChanged(); + geometryChanged(); } void ScrollArea::keyPressEvent(QKeyEvent *e) { diff --git a/ui/widgets/scroll_area.h b/ui/widgets/scroll_area.h index d6c64c1..bcf2fdd 100644 --- a/ui/widgets/scroll_area.h +++ b/ui/widgets/scroll_area.h @@ -56,7 +56,7 @@ public: void paintEvent(QPaintEvent *e); -public slots: +public Q_SLOTS: void changeVisibility(bool shown); private: @@ -75,12 +75,12 @@ public: void hideTimeout(crl::time dt); -private slots: +private Q_SLOTS: void onValueChanged(); void onRangeChanged(); void onHideTimer(); -signals: +Q_SIGNALS: void topShadowVisibility(bool); void bottomShadowVisibility(bool); @@ -180,7 +180,7 @@ protected: void enterEventHook(QEvent *e) override; void leaveEventHook(QEvent *e) override; -public slots: +public Q_SLOTS: void scrollToY(int toTop, int toBottom = -1); void disableScroll(bool dis); void onScrolled(); @@ -189,7 +189,7 @@ public slots: void onTouchTimer(); void onTouchScrollTimer(); -signals: +Q_SIGNALS: void scrolled(); void innerResized(); void scrollStarted();