Fixed deprecated method QFlags::Zero (#2508)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Paweł 2021-03-13 16:27:13 +01:00 committed by GitHub
parent be21e5b52d
commit d1a10d3c1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View file

@ -65,8 +65,8 @@ void HighlightModel::afterInit()
setBoolItem(usernameRow[Column::PlaySound], setBoolItem(usernameRow[Column::PlaySound],
getSettings()->enableSelfHighlightSound.getValue(), true, getSettings()->enableSelfHighlightSound.getValue(), true,
false); false);
usernameRow[Column::UseRegex]->setFlags(0); usernameRow[Column::UseRegex]->setFlags({});
usernameRow[Column::CaseSensitive]->setFlags(0); usernameRow[Column::CaseSensitive]->setFlags({});
QUrl selfSound = QUrl(getSettings()->selfHighlightSoundUrl.getValue()); QUrl selfSound = QUrl(getSettings()->selfHighlightSoundUrl.getValue());
setFilePathItem(usernameRow[Column::SoundPath], selfSound, false); setFilePathItem(usernameRow[Column::SoundPath], selfSound, false);
@ -74,22 +74,22 @@ void HighlightModel::afterInit()
auto selfColor = ColorProvider::instance().color(ColorType::SelfHighlight); auto selfColor = ColorProvider::instance().color(ColorType::SelfHighlight);
setColorItem(usernameRow[Column::Color], *selfColor, false); setColorItem(usernameRow[Column::Color], *selfColor, false);
this->insertCustomRow(usernameRow, 0); this->insertCustomRow(usernameRow, {});
// Highlight settings for whispers // Highlight settings for whispers
std::vector<QStandardItem *> whisperRow = this->createRow(); std::vector<QStandardItem *> whisperRow = this->createRow();
setBoolItem(whisperRow[Column::Pattern], setBoolItem(whisperRow[Column::Pattern],
getSettings()->enableWhisperHighlight.getValue(), true, false); getSettings()->enableWhisperHighlight.getValue(), true, false);
whisperRow[Column::Pattern]->setData("Whispers", Qt::DisplayRole); whisperRow[Column::Pattern]->setData("Whispers", Qt::DisplayRole);
whisperRow[Column::ShowInMentions]->setFlags(0); // We have /whispers whisperRow[Column::ShowInMentions]->setFlags({}); // We have /whispers
setBoolItem(whisperRow[Column::FlashTaskbar], setBoolItem(whisperRow[Column::FlashTaskbar],
getSettings()->enableWhisperHighlightTaskbar.getValue(), true, getSettings()->enableWhisperHighlightTaskbar.getValue(), true,
false); false);
setBoolItem(whisperRow[Column::PlaySound], setBoolItem(whisperRow[Column::PlaySound],
getSettings()->enableWhisperHighlightSound.getValue(), true, getSettings()->enableWhisperHighlightSound.getValue(), true,
false); false);
whisperRow[Column::UseRegex]->setFlags(0); whisperRow[Column::UseRegex]->setFlags({});
whisperRow[Column::CaseSensitive]->setFlags(0); whisperRow[Column::CaseSensitive]->setFlags({});
QUrl whisperSound = QUrl whisperSound =
QUrl(getSettings()->whisperHighlightSoundUrl.getValue()); QUrl(getSettings()->whisperHighlightSoundUrl.getValue());
@ -106,14 +106,14 @@ void HighlightModel::afterInit()
setBoolItem(subRow[Column::Pattern], setBoolItem(subRow[Column::Pattern],
getSettings()->enableSubHighlight.getValue(), true, false); getSettings()->enableSubHighlight.getValue(), true, false);
subRow[Column::Pattern]->setData("Subscriptions", Qt::DisplayRole); subRow[Column::Pattern]->setData("Subscriptions", Qt::DisplayRole);
subRow[Column::ShowInMentions]->setFlags(0); subRow[Column::ShowInMentions]->setFlags({});
setBoolItem(subRow[Column::FlashTaskbar], setBoolItem(subRow[Column::FlashTaskbar],
getSettings()->enableSubHighlightTaskbar.getValue(), true, getSettings()->enableSubHighlightTaskbar.getValue(), true,
false); false);
setBoolItem(subRow[Column::PlaySound], setBoolItem(subRow[Column::PlaySound],
getSettings()->enableSubHighlightSound.getValue(), true, false); getSettings()->enableSubHighlightSound.getValue(), true, false);
subRow[Column::UseRegex]->setFlags(0); subRow[Column::UseRegex]->setFlags({});
subRow[Column::CaseSensitive]->setFlags(0); subRow[Column::CaseSensitive]->setFlags({});
QUrl subSound = QUrl(getSettings()->subHighlightSoundUrl.getValue()); QUrl subSound = QUrl(getSettings()->subHighlightSoundUrl.getValue());
setFilePathItem(subRow[Column::SoundPath], subSound, false); setFilePathItem(subRow[Column::SoundPath], subSound, false);
@ -129,17 +129,17 @@ void HighlightModel::afterInit()
getSettings()->enableRedeemedHighlight.getValue(), true, false); getSettings()->enableRedeemedHighlight.getValue(), true, false);
redeemedRow[Column::Pattern]->setData( redeemedRow[Column::Pattern]->setData(
"Highlights redeemed with Channel Points", Qt::DisplayRole); "Highlights redeemed with Channel Points", Qt::DisplayRole);
redeemedRow[Column::ShowInMentions]->setFlags(0); redeemedRow[Column::ShowInMentions]->setFlags({});
// setBoolItem(redeemedRow[Column::FlashTaskbar], // setBoolItem(redeemedRow[Column::FlashTaskbar],
// getSettings()->enableRedeemedHighlightTaskbar.getValue(), true, // getSettings()->enableRedeemedHighlightTaskbar.getValue(), true,
// false); // false);
// setBoolItem(redeemedRow[Column::PlaySound], // setBoolItem(redeemedRow[Column::PlaySound],
// getSettings()->enableRedeemedHighlightSound.getValue(), true, // getSettings()->enableRedeemedHighlightSound.getValue(), true,
// false); // false);
redeemedRow[Column::FlashTaskbar]->setFlags(0); redeemedRow[Column::FlashTaskbar]->setFlags({});
redeemedRow[Column::PlaySound]->setFlags(0); redeemedRow[Column::PlaySound]->setFlags({});
redeemedRow[Column::UseRegex]->setFlags(0); redeemedRow[Column::UseRegex]->setFlags({});
redeemedRow[Column::CaseSensitive]->setFlags(0); redeemedRow[Column::CaseSensitive]->setFlags({});
QUrl RedeemedSound = QUrl RedeemedSound =
QUrl(getSettings()->redeemedHighlightSoundUrl.getValue()); QUrl(getSettings()->redeemedHighlightSoundUrl.getValue());

View file

@ -160,7 +160,7 @@ void NotebookButton::dragEnterEvent(QDragEnterEvent *event)
auto e = new QMouseEvent(QMouseEvent::MouseButtonPress, auto e = new QMouseEvent(QMouseEvent::MouseButtonPress,
QPointF(this->width() / 2, this->height() / 2), QPointF(this->width() / 2, this->height() / 2),
Qt::LeftButton, Qt::LeftButton, 0); Qt::LeftButton, Qt::LeftButton, {});
Button::mousePressEvent(e); Button::mousePressEvent(e);
delete e; delete e;
} }
@ -172,7 +172,7 @@ void NotebookButton::dragLeaveEvent(QDragLeaveEvent *)
auto e = new QMouseEvent(QMouseEvent::MouseButtonRelease, auto e = new QMouseEvent(QMouseEvent::MouseButtonRelease,
QPointF(this->width() / 2, this->height() / 2), QPointF(this->width() / 2, this->height() / 2),
Qt::LeftButton, Qt::LeftButton, 0); Qt::LeftButton, Qt::LeftButton, {});
Button::mouseReleaseEvent(e); Button::mouseReleaseEvent(e);
delete e; delete e;
} }

View file

@ -12,7 +12,7 @@ class SignalLabel : public QLabel
Q_OBJECT Q_OBJECT
public: public:
explicit SignalLabel(QWidget *parent = nullptr, Qt::WindowFlags f = 0); explicit SignalLabel(QWidget *parent = nullptr, Qt::WindowFlags f = {});
virtual ~SignalLabel() override = default; virtual ~SignalLabel() override = default;
signals: signals: