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)
- Dev: Highlight checks now use non-capturing groups for the boundaries. (#5784)
- 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: Support Boost 1.87. (#5832)
- 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}")
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00)
add_compile_definitions(QT_WARN_DEPRECATED_UP_TO=0x050F00)
add_compile_definitions(QT_NO_KEYWORDS)
# registers the native messageing host
option(CHATTERINO_DEBUG_NATIVE_MESSAGES "Debug native messages" OFF)
+2 -2
View File
@@ -182,7 +182,7 @@ public:
QVector<int> roles = QVector<int>();
roles.append(role);
emit dataChanged(index, index, roles);
this->dataChanged(index, index, roles);
}
return true;
@@ -218,7 +218,7 @@ public:
this->headerData_[section][role] = value;
emit this->headerDataChanged(Qt::Horizontal, section, section);
this->headerDataChanged(Qt::Horizontal, section, section);
return true;
}
+1 -1
View File
@@ -54,7 +54,7 @@ void loadUncached(std::shared_ptr<NetworkData> &&data)
QObject::connect(&requester, &NetworkRequester::requestUrl, worker,
&NetworkTask::run);
emit requester.requestUrl();
requester.requestUrl();
}
void loadCached(std::shared_ptr<NetworkData> &&data)
+1 -1
View File
@@ -21,7 +21,7 @@ class NetworkRequester : public QObject
{
Q_OBJECT
signals:
Q_SIGNALS:
void requestUrl();
};
+2 -2
View File
@@ -29,7 +29,7 @@ public:
NetworkTask &operator=(NetworkTask &&) = delete;
// NOLINTNEXTLINE(readability-redundant-access-specifiers)
public slots:
public Q_SLOTS:
void run();
private:
@@ -43,7 +43,7 @@ private:
QTimer *timer_{}; // parent: this
// NOLINTNEXTLINE(readability-redundant-access-specifiers)
private slots:
private Q_SLOTS:
void timeout();
void finished();
};
+1 -1
View File
@@ -116,7 +116,7 @@ public:
/// @see #hasThumbnail(), #thumbnail()
void setThumbnail(ImagePtr thumbnail);
signals:
Q_SIGNALS:
/// @brief Emitted when this link's state changes
///
/// @param state The new state
+1 -1
View File
@@ -22,7 +22,7 @@ public:
virtual void start() = 0;
signals:
Q_SIGNALS:
void changed(bool enabled);
};
+2 -2
View File
@@ -57,7 +57,7 @@ private:
QFile file_;
QNetworkReply *reply_{};
signals:
Q_SIGNALS:
void downloadComplete();
};
@@ -314,7 +314,7 @@ AvatarDownloader::AvatarDownloader(const QString &avatarURL,
{
this->file_.close();
}
emit downloadComplete();
downloadComplete();
this->deleteLater();
});
}
+1 -1
View File
@@ -89,7 +89,7 @@ public:
static bool supportsCustomWindowFrame();
signals:
Q_SIGNALS:
void topMostChanged(bool topMost);
protected:
+2 -2
View File
@@ -136,7 +136,7 @@ ColorPickerDialog::ColorPickerDialog(QColor color, QWidget *parent)
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QObject::connect(buttonBox, &QDialogButtonBox::accepted, this, [this] {
emit this->colorConfirmed(this->color());
this->colorConfirmed(this->color());
this->close();
});
QObject::connect(buttonBox, &QDialogButtonBox::rejected, this,
@@ -156,7 +156,7 @@ void ColorPickerDialog::setColor(const QColor &color)
return;
}
this->color_ = color;
emit this->colorChanged(color);
this->colorChanged(color);
}
} // namespace chatterino
+2 -2
View File
@@ -13,11 +13,11 @@ public:
QColor color() const;
signals:
Q_SIGNALS:
void colorChanged(QColor color);
void colorConfirmed(QColor color);
public slots:
public Q_SLOTS:
void setColor(const QColor &color);
private:
+1 -1
View File
@@ -25,7 +25,7 @@ public:
std::shared_ptr<Hotkey> data();
protected slots:
protected Q_SLOTS:
/**
* @brief validates the hotkey
*
@@ -26,7 +26,7 @@ public:
protected:
void themeChangedEvent() override;
public slots:
public Q_SLOTS:
void updateSuggestions(const QString &text);
private:
+3 -3
View File
@@ -290,7 +290,7 @@ void Button::mousePressEvent(QMouseEvent *event)
this->mouseDown_ = true;
emit this->leftMousePress();
this->leftMousePress();
if (this->menu_ && !this->menuVisible_)
{
@@ -317,13 +317,13 @@ void Button::mouseReleaseEvent(QMouseEvent *event)
if (isInside)
{
emit leftClicked();
leftClicked();
}
}
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);
signals:
Q_SIGNALS:
void leftClicked();
void clicked(Qt::MouseButton button);
void leftMousePress();
+1 -1
View File
@@ -147,7 +147,7 @@ void NotebookButton::mouseReleaseEvent(QMouseEvent *event)
update();
emit leftClicked();
leftClicked();
}
Button::mouseReleaseEvent(event);
+1 -1
View File
@@ -31,7 +31,7 @@ protected:
void hideEvent(QHideEvent *) override;
void showEvent(QShowEvent *) override;
signals:
Q_SIGNALS:
void leftClicked();
private:
+1 -1
View File
@@ -67,7 +67,7 @@ private:
bool eventFilter(QObject *obj, QEvent *event) override;
private slots:
private Q_SLOTS:
void insertCompletion(const QString &completion);
};
+1 -1
View File
@@ -36,7 +36,7 @@ void SettingsDialogTab::setSelected(bool _selected)
// height: <checkbox-size>px;
this->selected_ = _selected;
emit selectedChanged(selected_);
selectedChanged(selected_);
}
SettingsPage *SettingsDialogTab::page()
+1 -1
View File
@@ -37,7 +37,7 @@ public:
const QString &name() const;
signals:
Q_SIGNALS:
void selectedChanged(bool);
private:
+4 -4
View File
@@ -9,14 +9,14 @@ SignalLabel::SignalLabel(QWidget *parent, Qt::WindowFlags f)
void SignalLabel::mouseDoubleClickEvent(QMouseEvent *ev)
{
emit this->mouseDoubleClick(ev);
this->mouseDoubleClick(ev);
}
void SignalLabel::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
emit leftMouseDown();
leftMouseDown();
}
event->ignore();
@@ -26,7 +26,7 @@ void SignalLabel::mouseReleaseEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
emit leftMouseUp();
leftMouseUp();
}
event->ignore();
@@ -34,7 +34,7 @@ void SignalLabel::mouseReleaseEvent(QMouseEvent *event)
void SignalLabel::mouseMoveEvent(QMouseEvent *event)
{
emit this->mouseMove(event);
this->mouseMove(event);
event->ignore();
}
+1 -1
View File
@@ -15,7 +15,7 @@ public:
explicit SignalLabel(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SignalLabel() override = default;
signals:
Q_SIGNALS:
void mouseDoubleClick(QMouseEvent *ev);
void leftMouseDown();
+1 -1
View File
@@ -156,7 +156,7 @@ void AlphaSlider::setAlpha(int alpha)
this->alpha_ = alpha;
this->color_.setAlpha(alpha);
emit this->colorChanged(this->color_);
this->colorChanged(this->color_);
this->update();
}
+2 -2
View File
@@ -15,10 +15,10 @@ public:
int alpha() const;
signals:
Q_SIGNALS:
void colorChanged(QColor color) const;
public slots:
public Q_SLOTS:
void setColor(QColor color);
protected:
+1 -1
View File
@@ -16,7 +16,7 @@ public:
QColor color() const;
// NOLINTNEXTLINE(readability-redundant-access-specifiers)
public slots:
public Q_SLOTS:
void setColor(const QColor &color);
protected:
+1 -1
View File
@@ -162,7 +162,7 @@ void ColorInput::emitUpdate()
{
this->updateComponents();
// our components triggered this update, emit the new color
emit this->colorChanged(this->currentColor_);
this->colorChanged(this->currentColor_);
}
} // namespace chatterino
+2 -2
View File
@@ -17,10 +17,10 @@ public:
QColor color() const;
signals:
Q_SIGNALS:
void colorChanged(QColor color);
public slots:
public Q_SLOTS:
void setColor(QColor color);
private:
+1 -1
View File
@@ -158,7 +158,7 @@ void HueSlider::setHue(int hue)
this->color_.getHsv(&h, &s, &v, &a);
this->color_.setHsv(this->hue_, s, v, a);
emit this->colorChanged(this->color_);
this->colorChanged(this->color_);
this->update();
}
+2 -2
View File
@@ -15,10 +15,10 @@ public:
int hue() const;
signals:
Q_SIGNALS:
void colorChanged(QColor color) const;
public slots:
public Q_SLOTS:
void setColor(QColor color);
protected:
+1 -1
View File
@@ -186,7 +186,7 @@ void SBCanvas::emitUpdatedColor()
{
this->color_.setHsv(this->hue_, this->saturation_, this->brightness_,
this->color_.alpha());
emit this->colorChanged(this->color_);
this->colorChanged(this->color_);
}
} // namespace chatterino
+2 -2
View File
@@ -17,10 +17,10 @@ public:
int saturation() const;
int brightness() const;
signals:
Q_SIGNALS:
void colorChanged(QColor color) const;
public slots:
public Q_SLOTS:
void setColor(QColor color);
protected:
+1 -1
View File
@@ -213,7 +213,7 @@ void GenericListView::focusPreviousCompletion()
void GenericListView::requestClose()
{
emit this->closeRequested();
this->closeRequested();
}
} // namespace chatterino
+1 -1
View File
@@ -26,7 +26,7 @@ public:
void refreshTheme(const Theme &theme);
signals:
Q_SIGNALS:
void closeRequested();
private:
+1 -1
View File
@@ -177,7 +177,7 @@ private:
pajlada::Signals::SignalHolder signalHolder_;
std::vector<boost::signals2::scoped_connection> bSignals_;
public slots:
public Q_SLOTS:
void addSibling();
void deleteFromContainer();
void changeChannel();
+1 -1
View File
@@ -102,7 +102,7 @@ private:
pajlada::Signals::SignalHolder channelConnections_;
std::vector<boost::signals2::scoped_connection> bSignals_;
public slots:
public Q_SLOTS:
void reloadChannelEmotes();
void reloadSubscriberEmotes();
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
bool hidden{false};
private slots:
private Q_SLOTS:
void editTextChanged();
friend class Split;