From 5ca98829f7c5bf504e78bd51e6ceb534c023ae05 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 28 Dec 2021 20:09:08 +0100 Subject: [PATCH] Some qt6 prep --- .gitignore | 2 ++ src/BlurhashProvider.h | 8 ++++++-- src/Cache.cpp | 2 +- src/ChatPage.cpp | 5 ++--- src/CompletionProxyModel.cpp | 4 ++-- src/JdenticonProvider.h | 14 +++++++++----- src/LoginPage.cpp | 3 +-- src/MatrixClient.cpp | 4 ++-- src/MxcImageProvider.cpp | 10 +++++----- src/MxcImageProvider.h | 11 ++++++----- src/RegisterPage.cpp | 4 +--- src/TrayIcon.cpp | 5 ++++- src/TrayIcon.h | 6 +++++- src/UserSettingsPage.cpp | 3 +-- src/Utils.cpp | 6 +++--- src/WelcomePage.cpp | 2 +- src/dialogs/CreateRoom.cpp | 5 ++++- src/dialogs/FallbackAuth.cpp | 6 ++++-- src/dialogs/ImageOverlay.cpp | 1 - src/dialogs/Logout.cpp | 6 ++++-- src/dialogs/PreviewUploadOverlay.cpp | 8 +++++--- src/dialogs/ReCaptcha.cpp | 6 ++++-- src/main.cpp | 1 - src/timeline/InputBar.cpp | 8 ++++---- src/timeline/InputBar.h | 2 +- src/timeline/TimelineModel.cpp | 12 ++++++------ src/ui/FloatingButton.cpp | 1 + src/ui/MxcAnimatedImage.h | 2 +- src/ui/OverlayWidget.cpp | 2 +- src/ui/SnackBar.cpp | 2 +- src/ui/UserProfile.h | 2 +- src/voip/CallManager.h | 2 +- 32 files changed, 89 insertions(+), 66 deletions(-) diff --git a/.gitignore b/.gitignore index f34f1349..2129de34 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,8 @@ GPATH *.dylib vgcore.* +heaptrack.* +massif.* # Qt-es diff --git a/src/BlurhashProvider.h b/src/BlurhashProvider.h index 7f6f31c9..d32ce282 100644 --- a/src/BlurhashProvider.h +++ b/src/BlurhashProvider.h @@ -64,8 +64,12 @@ public: }; class BlurhashProvider - : public QObject - , public QQuickAsyncImageProvider + : +#if QT_VERSION < 0x60000 + public QObject + , +#endif + public QQuickAsyncImageProvider { Q_OBJECT public slots: diff --git a/src/Cache.cpp b/src/Cache.cpp index b1d03921..90b087db 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -3835,7 +3835,7 @@ Cache::displayName(const QString &room_id, const QString &user_id) static bool isDisplaynameSafe(const std::string &s) { - for (QChar c : QString::fromStdString(s).toUcs4()) { + for (QChar c : QString::fromStdString(s)) { if (c.isPrint() && !c.isSpace()) return false; } diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index a0e6f4d9..3b977ae6 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -62,7 +62,6 @@ ChatPage::ChatPage(QSharedPointer userSettings, QWidget *parent) topLayout_ = new QHBoxLayout(this); topLayout_->setSpacing(0); - topLayout_->setMargin(0); view_manager_ = new TimelineViewManager(callManager_, this); @@ -1303,7 +1302,7 @@ ChatPage::handleMatrixUri(QString uri) auto tempPath = uri_.path(QUrl::ComponentFormattingOption::FullyEncoded); if (tempPath.startsWith('/')) tempPath.remove(0, 1); - auto segments = tempPath.splitRef('/'); + auto segments = QStringView(tempPath).split('/'); if (segments.size() != 2 && segments.size() != 4) return false; @@ -1314,7 +1313,7 @@ ChatPage::handleMatrixUri(QString uri) return false; QString mxid2; - if (segments.size() == 4 && segments[2] == "e") { + if (segments.size() == 4 && segments[2] == QStringView(u"e")) { if (segments[3].isEmpty()) return false; else diff --git a/src/CompletionProxyModel.cpp b/src/CompletionProxyModel.cpp index 6354e91f..e32038e4 100644 --- a/src/CompletionProxyModel.cpp +++ b/src/CompletionProxyModel.cpp @@ -48,7 +48,7 @@ CompletionProxyModel::CompletionProxyModel(QAbstractItemModel *model, .toString() .toLower(); - for (const auto &e : string1.splitRef(splitPoints)) { + for (const auto &e : QStringView(string1).split(splitPoints)) { if (!e.isEmpty()) // NOTE(Nico): Use Qt::SkipEmptyParts in Qt 5.14 trie_.insert(e.toUcs4(), i); } @@ -59,7 +59,7 @@ CompletionProxyModel::CompletionProxyModel(QAbstractItemModel *model, .toLower(); if (!string2.isEmpty()) { - for (const auto &e : string2.splitRef(splitPoints)) { + for (const auto &e : QStringView(string2).split(splitPoints)) { if (!e.isEmpty()) // NOTE(Nico): Use Qt::SkipEmptyParts in Qt 5.14 trie_.insert(e.toUcs4(), i); } diff --git a/src/JdenticonProvider.h b/src/JdenticonProvider.h index c355eae7..08a934c2 100644 --- a/src/JdenticonProvider.h +++ b/src/JdenticonProvider.h @@ -53,8 +53,12 @@ public: }; class JdenticonProvider - : public QObject - , public QQuickAsyncImageProvider + : +#if QT_VERSION < 0x60000 + public QObject + , +#endif + public QQuickAsyncImageProvider { Q_OBJECT @@ -72,11 +76,11 @@ public slots: auto queryStart = id.lastIndexOf('?'); if (queryStart != -1) { id_ = id.left(queryStart); - auto query = id.midRef(queryStart + 1); - auto queryBits = query.split('&'); + auto query = id.mid(queryStart + 1); + auto queryBits = query.splitRef('&'); for (auto b : queryBits) { - if (b.startsWith("radius=")) { + if (b.startsWith(QStringView(u"radius="))) { radius = b.mid(7).toDouble(); } } diff --git a/src/LoginPage.cpp b/src/LoginPage.cpp index 656ee2d9..00a5b964 100644 --- a/src/LoginPage.cpp +++ b/src/LoginPage.cpp @@ -40,7 +40,6 @@ LoginPage::LoginPage(QWidget *parent) top_bar_layout_ = new QHBoxLayout(); top_bar_layout_->setSpacing(0); - top_bar_layout_->setMargin(0); back_button_ = new FlatButton(this); back_button_->setMinimumSize(QSize(30, 30)); @@ -497,7 +496,7 @@ void LoginPage::paintEvent(QPaintEvent *) { QStyleOption opt; - opt.init(this); + opt.initFrom(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } diff --git a/src/MatrixClient.cpp b/src/MatrixClient.cpp index 35277a69..38329f88 100644 --- a/src/MatrixClient.cpp +++ b/src/MatrixClient.cpp @@ -22,7 +22,7 @@ Q_DECLARE_METATYPE(mtx::responses::Sync) Q_DECLARE_METATYPE(mtx::responses::JoinedGroups) Q_DECLARE_METATYPE(mtx::responses::GroupProfile) -Q_DECLARE_METATYPE(nlohmann::json) +// Q_DECLARE_METATYPE(nlohmann::json) Q_DECLARE_METATYPE(std::string) Q_DECLARE_METATYPE(std::vector) Q_DECLARE_METATYPE(std::vector) @@ -54,7 +54,7 @@ init() qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); + // qRegisterMetaType(); qRegisterMetaType>(); qRegisterMetaType>(); qRegisterMetaType>("std::map"); diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp index 74b4bedc..96e1e094 100644 --- a/src/MxcImageProvider.cpp +++ b/src/MxcImageProvider.cpp @@ -32,15 +32,15 @@ MxcImageProvider::requestImageResponse(const QString &id, const QSize &requested auto queryStart = id.lastIndexOf('?'); if (queryStart != -1) { id_ = id.left(queryStart); - auto query = id.midRef(queryStart + 1); + auto query = QStringView(id).mid(queryStart + 1); auto queryBits = query.split('&'); for (auto b : queryBits) { - if (b == "scale") { + if (b == QStringView(u"scale")) { crop = false; - } else if (b.startsWith("radius=")) { + } else if (b.startsWith(QStringView(u"radius="))) { radius = b.mid(7).toDouble(); - } else if (b.startsWith("height=")) { + } else if (b.startsWith(u"height=")) { size.setHeight(b.mid(7).toInt()); size.setWidth(0); } @@ -109,7 +109,7 @@ MxcImageProvider::download(const QString &id, // Protect against synapse not following the spec: // https://github.com/matrix-org/synapse/issues/5302 && requestedSize.height() <= 600 && requestedSize.width() <= 800) { - QString fileName = QString("%1_%2x%3_%4_radius%5") + QString fileName = QStringLiteral("%1_%2x%3_%4_radius%5") .arg(QString::fromUtf8(id.toUtf8().toBase64( QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals))) .arg(requestedSize.width()) diff --git a/src/MxcImageProvider.h b/src/MxcImageProvider.h index 89c3d9aa..3f54a525 100644 --- a/src/MxcImageProvider.h +++ b/src/MxcImageProvider.h @@ -71,8 +71,12 @@ public: }; class MxcImageProvider - : public QObject - , public QQuickAsyncImageProvider + : +#if QT_VERSION < 0x60000 + public QObject + , +#endif + public QQuickAsyncImageProvider { Q_OBJECT public slots: @@ -85,7 +89,4 @@ public slots: std::function then, bool crop = true, double radius = 0); - -private: - // QThreadPool pool; }; diff --git a/src/RegisterPage.cpp b/src/RegisterPage.cpp index 062a04ab..646ef103 100644 --- a/src/RegisterPage.cpp +++ b/src/RegisterPage.cpp @@ -61,7 +61,6 @@ RegisterPage::RegisterPage(QWidget *parent) logo_->setPixmap(logo.pixmap(128)); logo_layout_ = new QHBoxLayout(); - logo_layout_->setMargin(0); logo_layout_->addWidget(logo_, 0, Qt::AlignHCenter); form_wrapper_ = new QHBoxLayout(); @@ -128,7 +127,6 @@ RegisterPage::RegisterPage(QWidget *parent) button_layout_ = new QHBoxLayout(); button_layout_->setSpacing(0); - button_layout_->setMargin(0); error_label_ = new QLabel(this); error_label_->setWordWrap(true); @@ -406,7 +404,7 @@ void RegisterPage::paintEvent(QPaintEvent *) { QStyleOption opt; - opt.init(this); + opt.initFrom(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } diff --git a/src/TrayIcon.cpp b/src/TrayIcon.cpp index 98a1d242..701f1249 100644 --- a/src/TrayIcon.cpp +++ b/src/TrayIcon.cpp @@ -69,7 +69,10 @@ MsgCountComposedIcon::clone() const } QList -MsgCountComposedIcon::availableSizes(QIcon::Mode mode, QIcon::State state) const +MsgCountComposedIcon::availableSizes(QIcon::Mode mode, QIcon::State state) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + const +#endif { Q_UNUSED(mode); Q_UNUSED(state); diff --git a/src/TrayIcon.h b/src/TrayIcon.h index 1ce7fb0b..207f35df 100644 --- a/src/TrayIcon.h +++ b/src/TrayIcon.h @@ -20,7 +20,11 @@ public: void paint(QPainter *p, const QRect &rect, QIcon::Mode mode, QIcon::State state) override; QIconEngine *clone() const override; - QList availableSizes(QIcon::Mode mode, QIcon::State state) const override; + QList availableSizes(QIcon::Mode mode, QIcon::State state) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + const +#endif + override; QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override; int msgCount = 0; diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp index f8c05e38..c8eedc28 100644 --- a/src/UserSettingsPage.cpp +++ b/src/UserSettingsPage.cpp @@ -771,7 +771,6 @@ UserSettingsPage::UserSettingsPage(QSharedPointer settings, QWidge topBarLayout_ = new QHBoxLayout; topBarLayout_->setSpacing(0); - topBarLayout_->setMargin(0); topBarLayout_->addWidget(backBtn_, 1, Qt::AlignLeft | Qt::AlignVCenter); topBarLayout_->addStretch(1); @@ -1443,7 +1442,7 @@ void UserSettingsPage::paintEvent(QPaintEvent *) { QStyleOption opt; - opt.init(this); + opt.initFrom(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } diff --git a/src/Utils.cpp b/src/Utils.cpp index aebb1bc6..1cfda279 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -389,7 +388,7 @@ utils::humanReadableFingerprint(const QString &ed25519) { QString fingerprint; for (int i = 0; i < ed25519.length(); i = i + 4) { - fingerprint.append(ed25519.midRef(i, 4)); + fingerprint.append(QStringView(ed25519).mid(i, 4)); if (i > 0 && i % 16 == 12) fingerprint.append('\n'); else if (i < ed25519.length()) @@ -513,7 +512,8 @@ utils::markdownToHtml(const QString &text, bool rainbowify) while ((boundaryEnd = tbf.toNextBoundary()) != -1) { charIdx++; // Split text to get current char - auto curChar = nodeText.midRef(boundaryStart, boundaryEnd - boundaryStart); + auto curChar = + QStringView(nodeText).mid(boundaryStart, boundaryEnd - boundaryStart); boundaryStart = boundaryEnd; // Don't rainbowify whitespaces if (curChar.trimmed().isEmpty() || codepointIsEmoji(curChar.toUcs4().first())) { diff --git a/src/WelcomePage.cpp b/src/WelcomePage.cpp index c7168789..e29d6576 100644 --- a/src/WelcomePage.cpp +++ b/src/WelcomePage.cpp @@ -81,7 +81,7 @@ void WelcomePage::paintEvent(QPaintEvent *) { QStyleOption opt; - opt.init(this); + opt.initFrom(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } diff --git a/src/dialogs/CreateRoom.cpp b/src/dialogs/CreateRoom.cpp index 30dbf83d..153d36c0 100644 --- a/src/dialogs/CreateRoom.cpp +++ b/src/dialogs/CreateRoom.cpp @@ -32,7 +32,10 @@ CreateRoom::CreateRoom(QWidget *parent) auto layout = new QVBoxLayout(this); layout->setSpacing(conf::modals::WIDGET_SPACING); - layout->setMargin(conf::modals::WIDGET_MARGIN); + layout->setContentsMargins(conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN); auto buttonLayout = new QHBoxLayout(); buttonLayout->setSpacing(15); diff --git a/src/dialogs/FallbackAuth.cpp b/src/dialogs/FallbackAuth.cpp index 2b8dfed9..0d8be237 100644 --- a/src/dialogs/FallbackAuth.cpp +++ b/src/dialogs/FallbackAuth.cpp @@ -25,11 +25,13 @@ FallbackAuth::FallbackAuth(const QString &authType, const QString &session, QWid auto layout = new QVBoxLayout(this); layout->setSpacing(conf::modals::WIDGET_SPACING); - layout->setMargin(conf::modals::WIDGET_MARGIN); + layout->setContentsMargins(conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN); auto buttonLayout = new QHBoxLayout(); buttonLayout->setSpacing(8); - buttonLayout->setMargin(0); openBtn_ = new QPushButton(tr("Open Fallback in Browser"), this); cancelBtn_ = new QPushButton(tr("Cancel"), this); diff --git a/src/dialogs/ImageOverlay.cpp b/src/dialogs/ImageOverlay.cpp index 551e0041..8890814d 100644 --- a/src/dialogs/ImageOverlay.cpp +++ b/src/dialogs/ImageOverlay.cpp @@ -4,7 +4,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include -#include #include #include #include diff --git a/src/dialogs/Logout.cpp b/src/dialogs/Logout.cpp index d10e4cdf..45cef6a5 100644 --- a/src/dialogs/Logout.cpp +++ b/src/dialogs/Logout.cpp @@ -25,11 +25,13 @@ Logout::Logout(QWidget *parent) auto layout = new QVBoxLayout(this); layout->setSpacing(conf::modals::WIDGET_SPACING); - layout->setMargin(conf::modals::WIDGET_MARGIN); + layout->setContentsMargins(conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN); auto buttonLayout = new QHBoxLayout(); buttonLayout->setSpacing(0); - buttonLayout->setMargin(0); confirmBtn_ = new QPushButton("Logout", this); cancelBtn_ = new QPushButton(tr("Cancel"), this); diff --git a/src/dialogs/PreviewUploadOverlay.cpp b/src/dialogs/PreviewUploadOverlay.cpp index 2e95bd91..338f0635 100644 --- a/src/dialogs/PreviewUploadOverlay.cpp +++ b/src/dialogs/PreviewUploadOverlay.cpp @@ -33,7 +33,6 @@ PreviewUploadOverlay::PreviewUploadOverlay(QWidget *parent) hlayout->addStretch(1); hlayout->addWidget(&cancel_); hlayout->addWidget(&upload_); - hlayout->setMargin(0); auto vlayout = new QVBoxLayout{this}; vlayout->addWidget(&titleLabel_); @@ -41,7 +40,10 @@ PreviewUploadOverlay::PreviewUploadOverlay(QWidget *parent) vlayout->addWidget(&fileName_); vlayout->addLayout(hlayout); vlayout->setSpacing(conf::modals::WIDGET_SPACING); - vlayout->setMargin(conf::modals::WIDGET_MARGIN); + vlayout->setContentsMargins(conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN); upload_.setDefault(true); connect(&upload_, &QPushButton::clicked, [this]() { @@ -217,4 +219,4 @@ PreviewUploadOverlay::keyPressEvent(QKeyEvent *event) } else { QWidget::keyPressEvent(event); } -} \ No newline at end of file +} diff --git a/src/dialogs/ReCaptcha.cpp b/src/dialogs/ReCaptcha.cpp index 0ae46bba..982c17b6 100644 --- a/src/dialogs/ReCaptcha.cpp +++ b/src/dialogs/ReCaptcha.cpp @@ -25,11 +25,13 @@ ReCaptcha::ReCaptcha(const QString &session, QWidget *parent) auto layout = new QVBoxLayout(this); layout->setSpacing(conf::modals::WIDGET_SPACING); - layout->setMargin(conf::modals::WIDGET_MARGIN); + layout->setContentsMargins(conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN, + conf::modals::WIDGET_MARGIN); auto buttonLayout = new QHBoxLayout(); buttonLayout->setSpacing(8); - buttonLayout->setMargin(0); openCaptchaBtn_ = new QPushButton("Open reCAPTCHA", this); cancelBtn_ = new QPushButton(tr("Cancel"), this); diff --git a/src/main.cpp b/src/main.cpp index b87e50ff..9d39fd8c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index 191160ea..edc21e54 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -140,7 +140,7 @@ InputBar::updateAtRoom(const QString &t) auto start = finder.position(); finder.toNextBoundary(); auto end = finder.position(); - if (start > 0 && end - start >= 4 && t.midRef(start, end - start) == "room" && + if (start > 0 && end - start >= 4 && t.mid(start, end - start) == "room" && t.at(start - 1) == QChar('@')) { roomMention = true; break; @@ -324,7 +324,7 @@ InputBar::message(const QString &msg, MarkdownOverride useMarkdown, bool rainbow QString body; bool firstLine = true; - for (const auto &line : related.quoted_body.split("\n")) { + for (auto line : related.quoted_body.splitRef(u'\n')) { if (firstLine) { firstLine = false; body = QString("> <%1> %2\n").arg(related.quoted_user, line); @@ -707,9 +707,9 @@ InputBar::showPreview(const QMimeData &source, const QString &path, const QStrin QSize dimensions; QString blurhash; - auto mimeClass = mime.split("/")[0]; + auto mimeClass = mime.splitRef(u'/')[0]; nhlog::ui()->debug("Mime: {}", mime.toStdString()); - if (mimeClass == "image") { + if (mimeClass == u"image") { QImage img = utils::readImage(data); dimensions = img.size(); diff --git a/src/timeline/InputBar.h b/src/timeline/InputBar.h index 65593244..c63a8618 100644 --- a/src/timeline/InputBar.h +++ b/src/timeline/InputBar.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include @@ -15,7 +16,6 @@ class TimelineModel; class CombinedImagePackModel; class QMimeData; class QDropEvent; -class QStringList; enum class MarkdownOverride { diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 217cd4c8..91400a40 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -643,7 +643,7 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r // only show read receipts for messages not from us if (acc::sender(event) != http::client()->user_id().to_string()) return qml_mtx_events::Empty; - else if (!id.isEmpty() && id[0] == "m") + else if (!id.isEmpty() && id[0] == 'm') return qml_mtx_events::Sent; else if (read.contains(id) || containsOthers(cache::readReceipts(id, room_id_))) return qml_mtx_events::Read; @@ -1029,7 +1029,7 @@ TimelineModel::setCurrentIndex(int index) if (!ChatPage::instance()->isActiveWindow()) return; - if (!currentId.startsWith("m")) { + if (!currentId.startsWith('m')) { auto oldReadIndex = cache::getEventIndex(roomId().toStdString(), currentReadId.toStdString()); auto nextEventIndexAndId = @@ -1759,16 +1759,16 @@ TimelineModel::formatTypingUsers(const std::vector &users, const QColor if (startIndex - index != 0) coloredUsername += - prefix + - uncoloredUsername.midRef(index, startIndex > 0 ? startIndex - index : -1) + - ""; + prefix + uncoloredUsername.mid(index, startIndex > 0 ? startIndex - index : -1) + + QStringLiteral(""); auto endIndex = uncoloredUsername.indexOf("", startIndex); if (endIndex > 0) endIndex += sizeof("") - 1; if (endIndex - startIndex != 0) - coloredUsername += uncoloredUsername.midRef(startIndex, endIndex - startIndex); + coloredUsername += + QStringView(uncoloredUsername).mid(startIndex, endIndex - startIndex); index = endIndex; } while (index > 0 && index < uncoloredUsername.size()); diff --git a/src/ui/FloatingButton.cpp b/src/ui/FloatingButton.cpp index 3f88e313..5dc777d2 100644 --- a/src/ui/FloatingButton.cpp +++ b/src/ui/FloatingButton.cpp @@ -2,6 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later +#include #include #include diff --git a/src/ui/MxcAnimatedImage.h b/src/ui/MxcAnimatedImage.h index c3ca24d1..0b678ab6 100644 --- a/src/ui/MxcAnimatedImage.h +++ b/src/ui/MxcAnimatedImage.h @@ -9,7 +9,7 @@ #include #include -class TimelineModel; +#include "timeline/TimelineModel.h" // This is an AnimatedImage, that can draw encrypted images class MxcAnimatedImage : public QQuickItem diff --git a/src/ui/OverlayWidget.cpp b/src/ui/OverlayWidget.cpp index 4e338753..f47c035c 100644 --- a/src/ui/OverlayWidget.cpp +++ b/src/ui/OverlayWidget.cpp @@ -72,7 +72,7 @@ OverlayWidget::paintEvent(QPaintEvent *event) Q_UNUSED(event); QStyleOption opt; - opt.init(this); + opt.initFrom(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } diff --git a/src/ui/SnackBar.cpp b/src/ui/SnackBar.cpp index 90187154..077cb9de 100644 --- a/src/ui/SnackBar.cpp +++ b/src/ui/SnackBar.cpp @@ -17,7 +17,7 @@ SnackBar::SnackBar(QWidget *parent) { QFont font; font.setPointSizeF(font.pointSizeF() * 1.2); - font.setWeight(50); + font.setWeight(QFont::Weight::Thin); setFont(font); boxHeight_ = QFontMetrics(font).height() * 2; diff --git a/src/ui/UserProfile.h b/src/ui/UserProfile.h index cd2f4740..c1d7a79c 100644 --- a/src/ui/UserProfile.h +++ b/src/ui/UserProfile.h @@ -12,6 +12,7 @@ #include #include "CacheCryptoStructs.h" +#include "timeline/TimelineModel.h" namespace verification { Q_NAMESPACE @@ -28,7 +29,6 @@ Q_ENUM_NS(Status) } class DeviceVerificationFlow; -class TimelineModel; class TimelineViewManager; class DeviceInfo diff --git a/src/voip/CallManager.h b/src/voip/CallManager.h index 22f31814..a9c522cf 100644 --- a/src/voip/CallManager.h +++ b/src/voip/CallManager.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "CallDevices.h" @@ -21,7 +22,6 @@ namespace mtx::responses { struct TurnServer; } -class QStringList; class QUrl; class CallManager : public QObject