Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/common/SignalVectorModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class SignalVectorModel : public QAbstractTableModel,

QVector<int> roles = QVector<int>();
roles.append(role);
emit dataChanged(index, index, roles);
this->dataChanged(index, index, roles);
}

return true;
Expand Down Expand Up @@ -218,7 +218,7 @@ class SignalVectorModel : public QAbstractTableModel,

this->headerData_[section][role] = value;

emit this->headerDataChanged(Qt::Horizontal, section, section);
this->headerDataChanged(Qt::Horizontal, section, section);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/network/NetworkPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/common/network/NetworkPrivate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NetworkRequester : public QObject
{
Q_OBJECT

signals:
Q_SIGNALS:
void requestUrl();
};

Expand Down
4 changes: 2 additions & 2 deletions src/common/network/NetworkTask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class NetworkTask : public QObject
NetworkTask &operator=(NetworkTask &&) = delete;

// NOLINTNEXTLINE(readability-redundant-access-specifiers)
public slots:
public Q_SLOTS:
void run();

private:
Expand All @@ -43,7 +43,7 @@ public slots:
QTimer *timer_{}; // parent: this

// NOLINTNEXTLINE(readability-redundant-access-specifiers)
private slots:
private Q_SLOTS:
void timeout();
void finished();
};
Expand Down
2 changes: 1 addition & 1 deletion src/providers/links/LinkInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class LinkInfo : public QObject
/// @see #hasThumbnail(), #thumbnail()
void setThumbnail(ImagePtr thumbnail);

signals:
Q_SIGNALS:
/// @brief Emitted when this link's state changes
///
/// @param state The new state
Expand Down
2 changes: 1 addition & 1 deletion src/singletons/StreamerMode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class IStreamerMode : public QObject

virtual void start() = 0;

signals:
Q_SIGNALS:
void changed(bool enabled);
};

Expand Down
4 changes: 2 additions & 2 deletions src/singletons/Toasts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class AvatarDownloader : public QObject
QFile file_;
QNetworkReply *reply_{};

signals:
Q_SIGNALS:
void downloadComplete();
};

Expand Down Expand Up @@ -314,7 +314,7 @@ AvatarDownloader::AvatarDownloader(const QString &avatarURL,
{
this->file_.close();
}
emit downloadComplete();
downloadComplete();
this->deleteLater();
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/BaseWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class BaseWindow : public BaseWidget

static bool supportsCustomWindowFrame();

signals:
Q_SIGNALS:
void topMostChanged(bool topMost);

protected:
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/dialogs/ColorPickerDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -156,7 +156,7 @@ void ColorPickerDialog::setColor(const QColor &color)
return;
}
this->color_ = color;
emit this->colorChanged(color);
this->colorChanged(color);
}

} // namespace chatterino
4 changes: 2 additions & 2 deletions src/widgets/dialogs/ColorPickerDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class ColorPickerDialog : public BasePopup

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:
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dialogs/EditHotkeyDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class EditHotkeyDialog final : public QDialog

std::shared_ptr<Hotkey> data();

protected slots:
protected Q_SLOTS:
/**
* @brief validates the hotkey
*
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dialogs/switcher/QuickSwitcherPopup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class QuickSwitcherPopup : public BasePopup
protected:
void themeChangedEvent() override;

public slots:
public Q_SLOTS:
void updateSuggestions(const QString &text);

private:
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/helper/Button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void Button::mousePressEvent(QMouseEvent *event)

this->mouseDown_ = true;

emit this->leftMousePress();
this->leftMousePress();

if (this->menu_ && !this->menuVisible_)
{
Expand All @@ -317,13 +317,13 @@ void Button::mouseReleaseEvent(QMouseEvent *event)

if (isInside)
{
emit leftClicked();
leftClicked();
}
}

if (isInside)
{
emit clicked(event->button());
clicked(event->button());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/Button.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Button : public BaseWidget

void setMenu(std::unique_ptr<QMenu> menu);

signals:
Q_SIGNALS:
void leftClicked();
void clicked(Qt::MouseButton button);
void leftMousePress();
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/NotebookButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void NotebookButton::mouseReleaseEvent(QMouseEvent *event)

update();

emit leftClicked();
leftClicked();
}

Button::mouseReleaseEvent(event);
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/NotebookButton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class NotebookButton : public Button
void hideEvent(QHideEvent *) override;
void showEvent(QShowEvent *) override;

signals:
Q_SIGNALS:
void leftClicked();

private:
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/ResizingTextEdit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ResizingTextEdit : public QTextEdit

bool eventFilter(QObject *obj, QEvent *event) override;

private slots:
private Q_SLOTS:
void insertCompletion(const QString &completion);
};

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/SettingsDialogTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void SettingsDialogTab::setSelected(bool _selected)
// height: <checkbox-size>px;

this->selected_ = _selected;
emit selectedChanged(selected_);
selectedChanged(selected_);
}

SettingsPage *SettingsDialogTab::page()
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/SettingsDialogTab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SettingsDialogTab : public BaseWidget

const QString &name() const;

signals:
Q_SIGNALS:
void selectedChanged(bool);

private:
Expand Down
8 changes: 4 additions & 4 deletions src/widgets/helper/SignalLabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -26,15 +26,15 @@ void SignalLabel::mouseReleaseEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
emit leftMouseUp();
leftMouseUp();
}

event->ignore();
}

void SignalLabel::mouseMoveEvent(QMouseEvent *event)
{
emit this->mouseMove(event);
this->mouseMove(event);
event->ignore();
}

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/SignalLabel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SignalLabel : public QLabel
explicit SignalLabel(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SignalLabel() override = default;

signals:
Q_SIGNALS:
void mouseDoubleClick(QMouseEvent *ev);

void leftMouseDown();
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/color/AlphaSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
4 changes: 2 additions & 2 deletions src/widgets/helper/color/AlphaSlider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class AlphaSlider : public QWidget

int alpha() const;

signals:
Q_SIGNALS:
void colorChanged(QColor color) const;

public slots:
public Q_SLOTS:
void setColor(QColor color);

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/color/ColorButton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ColorButton : public QAbstractButton
QColor color() const;

// NOLINTNEXTLINE(readability-redundant-access-specifiers)
public slots:
public Q_SLOTS:
void setColor(const QColor &color);

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/color/ColorInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/widgets/helper/color/ColorInput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class ColorInput : public QWidget

QColor color() const;

signals:
Q_SIGNALS:
void colorChanged(QColor color);

public slots:
public Q_SLOTS:
void setColor(QColor color);

private:
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/color/HueSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
4 changes: 2 additions & 2 deletions src/widgets/helper/color/HueSlider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class HueSlider : public QWidget

int hue() const;

signals:
Q_SIGNALS:
void colorChanged(QColor color) const;

public slots:
public Q_SLOTS:
void setColor(QColor color);

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/color/SBCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/widgets/helper/color/SBCanvas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class SBCanvas : public QWidget
int saturation() const;
int brightness() const;

signals:
Q_SIGNALS:
void colorChanged(QColor color) const;

public slots:
public Q_SLOTS:
void setColor(QColor color);

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/listview/GenericListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void GenericListView::focusPreviousCompletion()

void GenericListView::requestClose()
{
emit this->closeRequested();
this->closeRequested();
}

} // namespace chatterino
Loading
Loading