Disable QT keywords to avoid clashes with other libraries. (#5882)

This commit is contained in:
cmp
2025-02-02 04:08:11 -06:00
committed by GitHub
parent f629eecaa7
commit 65e97846aa
37 changed files with 51 additions and 49 deletions
+1
View File
@@ -22,6 +22,7 @@
- Bugfix: Fixed suspicious user treatment update messages not being searchable. (#5865) - Bugfix: Fixed suspicious user treatment update messages not being searchable. (#5865)
- Dev: Highlight checks now use non-capturing groups for the boundaries. (#5784) - Dev: Highlight checks now use non-capturing groups for the boundaries. (#5784)
- Dev: Updated Conan dependencies. (#5776) - Dev: Updated Conan dependencies. (#5776)
- Dev: Disable QT keywords (i.e. `emit`, `slots`, and `signals`). (#5882)
- Dev: Replaced usage of `parseTime` with `serverReceivedTime` for clearchat messages. (#5824, #5855) - Dev: Replaced usage of `parseTime` with `serverReceivedTime` for clearchat messages. (#5824, #5855)
- Dev: Support Boost 1.87. (#5832) - Dev: Support Boost 1.87. (#5832)
- Dev: Words from `TextElement`s are now combined where possible. (#5847) - Dev: Words from `TextElement`s are now combined where possible. (#5847)
+1
View File
@@ -3,6 +3,7 @@ set(VERSION_PROJECT "${LIBRARY_PROJECT}-version")
set(EXECUTABLE_PROJECT "${PROJECT_NAME}") set(EXECUTABLE_PROJECT "${PROJECT_NAME}")
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00) add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00)
add_compile_definitions(QT_WARN_DEPRECATED_UP_TO=0x050F00) add_compile_definitions(QT_WARN_DEPRECATED_UP_TO=0x050F00)
add_compile_definitions(QT_NO_KEYWORDS)
# registers the native messageing host # registers the native messageing host
option(CHATTERINO_DEBUG_NATIVE_MESSAGES "Debug native messages" OFF) option(CHATTERINO_DEBUG_NATIVE_MESSAGES "Debug native messages" OFF)
+2 -2
View File
@@ -182,7 +182,7 @@ public:
QVector<int> roles = QVector<int>(); QVector<int> roles = QVector<int>();
roles.append(role); roles.append(role);
emit dataChanged(index, index, roles); this->dataChanged(index, index, roles);
} }
return true; return true;
@@ -218,7 +218,7 @@ public:
this->headerData_[section][role] = value; this->headerData_[section][role] = value;
emit this->headerDataChanged(Qt::Horizontal, section, section); this->headerDataChanged(Qt::Horizontal, section, section);
return true; return true;
} }
+1 -1
View File
@@ -54,7 +54,7 @@ void loadUncached(std::shared_ptr<NetworkData> &&data)
QObject::connect(&requester, &NetworkRequester::requestUrl, worker, QObject::connect(&requester, &NetworkRequester::requestUrl, worker,
&NetworkTask::run); &NetworkTask::run);
emit requester.requestUrl(); requester.requestUrl();
} }
void loadCached(std::shared_ptr<NetworkData> &&data) void loadCached(std::shared_ptr<NetworkData> &&data)
+1 -1
View File
@@ -21,7 +21,7 @@ class NetworkRequester : public QObject
{ {
Q_OBJECT Q_OBJECT
signals: Q_SIGNALS:
void requestUrl(); void requestUrl();
}; };
+2 -2
View File
@@ -29,7 +29,7 @@ public:
NetworkTask &operator=(NetworkTask &&) = delete; NetworkTask &operator=(NetworkTask &&) = delete;
// NOLINTNEXTLINE(readability-redundant-access-specifiers) // NOLINTNEXTLINE(readability-redundant-access-specifiers)
public slots: public Q_SLOTS:
void run(); void run();
private: private:
@@ -43,7 +43,7 @@ private:
QTimer *timer_{}; // parent: this QTimer *timer_{}; // parent: this
// NOLINTNEXTLINE(readability-redundant-access-specifiers) // NOLINTNEXTLINE(readability-redundant-access-specifiers)
private slots: private Q_SLOTS:
void timeout(); void timeout();
void finished(); void finished();
}; };
+1 -1
View File
@@ -116,7 +116,7 @@ public:
/// @see #hasThumbnail(), #thumbnail() /// @see #hasThumbnail(), #thumbnail()
void setThumbnail(ImagePtr thumbnail); void setThumbnail(ImagePtr thumbnail);
signals: Q_SIGNALS:
/// @brief Emitted when this link's state changes /// @brief Emitted when this link's state changes
/// ///
/// @param state The new state /// @param state The new state
+1 -1
View File
@@ -22,7 +22,7 @@ public:
virtual void start() = 0; virtual void start() = 0;
signals: Q_SIGNALS:
void changed(bool enabled); void changed(bool enabled);
}; };
+2 -2
View File
@@ -57,7 +57,7 @@ private:
QFile file_; QFile file_;
QNetworkReply *reply_{}; QNetworkReply *reply_{};
signals: Q_SIGNALS:
void downloadComplete(); void downloadComplete();
}; };
@@ -314,7 +314,7 @@ AvatarDownloader::AvatarDownloader(const QString &avatarURL,
{ {
this->file_.close(); this->file_.close();
} }
emit downloadComplete(); downloadComplete();
this->deleteLater(); this->deleteLater();
}); });
} }
+1 -1
View File
@@ -89,7 +89,7 @@ public:
static bool supportsCustomWindowFrame(); static bool supportsCustomWindowFrame();
signals: Q_SIGNALS:
void topMostChanged(bool topMost); void topMostChanged(bool topMost);
protected: protected:
+2 -2
View File
@@ -136,7 +136,7 @@ ColorPickerDialog::ColorPickerDialog(QColor color, QWidget *parent)
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QObject::connect(buttonBox, &QDialogButtonBox::accepted, this, [this] { QObject::connect(buttonBox, &QDialogButtonBox::accepted, this, [this] {
emit this->colorConfirmed(this->color()); this->colorConfirmed(this->color());
this->close(); this->close();
}); });
QObject::connect(buttonBox, &QDialogButtonBox::rejected, this, QObject::connect(buttonBox, &QDialogButtonBox::rejected, this,
@@ -156,7 +156,7 @@ void ColorPickerDialog::setColor(const QColor &color)
return; return;
} }
this->color_ = color; this->color_ = color;
emit this->colorChanged(color); this->colorChanged(color);
} }
} // namespace chatterino } // namespace chatterino
+2 -2
View File
@@ -13,11 +13,11 @@ public:
QColor color() const; QColor color() const;
signals: Q_SIGNALS:
void colorChanged(QColor color); void colorChanged(QColor color);
void colorConfirmed(QColor color); void colorConfirmed(QColor color);
public slots: public Q_SLOTS:
void setColor(const QColor &color); void setColor(const QColor &color);
private: private:
+1 -1
View File
@@ -25,7 +25,7 @@ public:
std::shared_ptr<Hotkey> data(); std::shared_ptr<Hotkey> data();
protected slots: protected Q_SLOTS:
/** /**
* @brief validates the hotkey * @brief validates the hotkey
* *
@@ -26,7 +26,7 @@ public:
protected: protected:
void themeChangedEvent() override; void themeChangedEvent() override;
public slots: public Q_SLOTS:
void updateSuggestions(const QString &text); void updateSuggestions(const QString &text);
private: private:
+3 -3
View File
@@ -290,7 +290,7 @@ void Button::mousePressEvent(QMouseEvent *event)
this->mouseDown_ = true; this->mouseDown_ = true;
emit this->leftMousePress(); this->leftMousePress();
if (this->menu_ && !this->menuVisible_) if (this->menu_ && !this->menuVisible_)
{ {
@@ -317,13 +317,13 @@ void Button::mouseReleaseEvent(QMouseEvent *event)
if (isInside) if (isInside)
{ {
emit leftClicked(); leftClicked();
} }
} }
if (isInside) if (isInside)
{ {
emit clicked(event->button()); clicked(event->button());
} }
} }
+1 -1
View File
@@ -51,7 +51,7 @@ public:
void setMenu(std::unique_ptr<QMenu> menu); void setMenu(std::unique_ptr<QMenu> menu);
signals: Q_SIGNALS:
void leftClicked(); void leftClicked();
void clicked(Qt::MouseButton button); void clicked(Qt::MouseButton button);
void leftMousePress(); void leftMousePress();
+1 -1
View File
@@ -147,7 +147,7 @@ void NotebookButton::mouseReleaseEvent(QMouseEvent *event)
update(); update();
emit leftClicked(); leftClicked();
} }
Button::mouseReleaseEvent(event); Button::mouseReleaseEvent(event);
+1 -1
View File
@@ -31,7 +31,7 @@ protected:
void hideEvent(QHideEvent *) override; void hideEvent(QHideEvent *) override;
void showEvent(QShowEvent *) override; void showEvent(QShowEvent *) override;
signals: Q_SIGNALS:
void leftClicked(); void leftClicked();
private: private:
+1 -1
View File
@@ -67,7 +67,7 @@ private:
bool eventFilter(QObject *obj, QEvent *event) override; bool eventFilter(QObject *obj, QEvent *event) override;
private slots: private Q_SLOTS:
void insertCompletion(const QString &completion); void insertCompletion(const QString &completion);
}; };
+1 -1
View File
@@ -36,7 +36,7 @@ void SettingsDialogTab::setSelected(bool _selected)
// height: <checkbox-size>px; // height: <checkbox-size>px;
this->selected_ = _selected; this->selected_ = _selected;
emit selectedChanged(selected_); selectedChanged(selected_);
} }
SettingsPage *SettingsDialogTab::page() SettingsPage *SettingsDialogTab::page()
+1 -1
View File
@@ -37,7 +37,7 @@ public:
const QString &name() const; const QString &name() const;
signals: Q_SIGNALS:
void selectedChanged(bool); void selectedChanged(bool);
private: private:
+4 -4
View File
@@ -9,14 +9,14 @@ SignalLabel::SignalLabel(QWidget *parent, Qt::WindowFlags f)
void SignalLabel::mouseDoubleClickEvent(QMouseEvent *ev) void SignalLabel::mouseDoubleClickEvent(QMouseEvent *ev)
{ {
emit this->mouseDoubleClick(ev); this->mouseDoubleClick(ev);
} }
void SignalLabel::mousePressEvent(QMouseEvent *event) void SignalLabel::mousePressEvent(QMouseEvent *event)
{ {
if (event->button() == Qt::LeftButton) if (event->button() == Qt::LeftButton)
{ {
emit leftMouseDown(); leftMouseDown();
} }
event->ignore(); event->ignore();
@@ -26,7 +26,7 @@ void SignalLabel::mouseReleaseEvent(QMouseEvent *event)
{ {
if (event->button() == Qt::LeftButton) if (event->button() == Qt::LeftButton)
{ {
emit leftMouseUp(); leftMouseUp();
} }
event->ignore(); event->ignore();
@@ -34,7 +34,7 @@ void SignalLabel::mouseReleaseEvent(QMouseEvent *event)
void SignalLabel::mouseMoveEvent(QMouseEvent *event) void SignalLabel::mouseMoveEvent(QMouseEvent *event)
{ {
emit this->mouseMove(event); this->mouseMove(event);
event->ignore(); event->ignore();
} }
+1 -1
View File
@@ -15,7 +15,7 @@ public:
explicit SignalLabel(QWidget *parent = nullptr, Qt::WindowFlags f = {}); explicit SignalLabel(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SignalLabel() override = default; ~SignalLabel() override = default;
signals: Q_SIGNALS:
void mouseDoubleClick(QMouseEvent *ev); void mouseDoubleClick(QMouseEvent *ev);
void leftMouseDown(); void leftMouseDown();
+1 -1
View File
@@ -156,7 +156,7 @@ void AlphaSlider::setAlpha(int alpha)
this->alpha_ = alpha; this->alpha_ = alpha;
this->color_.setAlpha(alpha); this->color_.setAlpha(alpha);
emit this->colorChanged(this->color_); this->colorChanged(this->color_);
this->update(); this->update();
} }
+2 -2
View File
@@ -15,10 +15,10 @@ public:
int alpha() const; int alpha() const;
signals: Q_SIGNALS:
void colorChanged(QColor color) const; void colorChanged(QColor color) const;
public slots: public Q_SLOTS:
void setColor(QColor color); void setColor(QColor color);
protected: protected:
+1 -1
View File
@@ -16,7 +16,7 @@ public:
QColor color() const; QColor color() const;
// NOLINTNEXTLINE(readability-redundant-access-specifiers) // NOLINTNEXTLINE(readability-redundant-access-specifiers)
public slots: public Q_SLOTS:
void setColor(const QColor &color); void setColor(const QColor &color);
protected: protected:
+1 -1
View File
@@ -162,7 +162,7 @@ void ColorInput::emitUpdate()
{ {
this->updateComponents(); this->updateComponents();
// our components triggered this update, emit the new color // our components triggered this update, emit the new color
emit this->colorChanged(this->currentColor_); this->colorChanged(this->currentColor_);
} }
} // namespace chatterino } // namespace chatterino
+2 -2
View File
@@ -17,10 +17,10 @@ public:
QColor color() const; QColor color() const;
signals: Q_SIGNALS:
void colorChanged(QColor color); void colorChanged(QColor color);
public slots: public Q_SLOTS:
void setColor(QColor color); void setColor(QColor color);
private: private:
+1 -1
View File
@@ -158,7 +158,7 @@ void HueSlider::setHue(int hue)
this->color_.getHsv(&h, &s, &v, &a); this->color_.getHsv(&h, &s, &v, &a);
this->color_.setHsv(this->hue_, s, v, a); this->color_.setHsv(this->hue_, s, v, a);
emit this->colorChanged(this->color_); this->colorChanged(this->color_);
this->update(); this->update();
} }
+2 -2
View File
@@ -15,10 +15,10 @@ public:
int hue() const; int hue() const;
signals: Q_SIGNALS:
void colorChanged(QColor color) const; void colorChanged(QColor color) const;
public slots: public Q_SLOTS:
void setColor(QColor color); void setColor(QColor color);
protected: protected:
+1 -1
View File
@@ -186,7 +186,7 @@ void SBCanvas::emitUpdatedColor()
{ {
this->color_.setHsv(this->hue_, this->saturation_, this->brightness_, this->color_.setHsv(this->hue_, this->saturation_, this->brightness_,
this->color_.alpha()); this->color_.alpha());
emit this->colorChanged(this->color_); this->colorChanged(this->color_);
} }
} // namespace chatterino } // namespace chatterino
+2 -2
View File
@@ -17,10 +17,10 @@ public:
int saturation() const; int saturation() const;
int brightness() const; int brightness() const;
signals: Q_SIGNALS:
void colorChanged(QColor color) const; void colorChanged(QColor color) const;
public slots: public Q_SLOTS:
void setColor(QColor color); void setColor(QColor color);
protected: protected:
+1 -1
View File
@@ -213,7 +213,7 @@ void GenericListView::focusPreviousCompletion()
void GenericListView::requestClose() void GenericListView::requestClose()
{ {
emit this->closeRequested(); this->closeRequested();
} }
} // namespace chatterino } // namespace chatterino
+1 -1
View File
@@ -26,7 +26,7 @@ public:
void refreshTheme(const Theme &theme); void refreshTheme(const Theme &theme);
signals: Q_SIGNALS:
void closeRequested(); void closeRequested();
private: private:
+1 -1
View File
@@ -177,7 +177,7 @@ private:
pajlada::Signals::SignalHolder signalHolder_; pajlada::Signals::SignalHolder signalHolder_;
std::vector<boost::signals2::scoped_connection> bSignals_; std::vector<boost::signals2::scoped_connection> bSignals_;
public slots: public Q_SLOTS:
void addSibling(); void addSibling();
void deleteFromContainer(); void deleteFromContainer();
void changeChannel(); void changeChannel();
+1 -1
View File
@@ -102,7 +102,7 @@ private:
pajlada::Signals::SignalHolder channelConnections_; pajlada::Signals::SignalHolder channelConnections_;
std::vector<boost::signals2::scoped_connection> bSignals_; std::vector<boost::signals2::scoped_connection> bSignals_;
public slots: public Q_SLOTS:
void reloadChannelEmotes(); void reloadChannelEmotes();
void reloadSubscriberEmotes(); void reloadSubscriberEmotes();
void reconnect(); void reconnect();
+1 -1
View File
@@ -168,7 +168,7 @@ protected:
// set the height of the split input to 0 if we're supposed to be hidden instead // set the height of the split input to 0 if we're supposed to be hidden instead
bool hidden{false}; bool hidden{false};
private slots: private Q_SLOTS:
void editTextChanged(); void editTextChanged();
friend class Split; friend class Split;