Fix Qt5.15 issues

fixes #214
pull/218/head
Nicolas Werner 5 years ago
parent f8903f493f
commit 43d2ebc095
  1. 2
      src/LoginPage.cpp
  2. 8
      src/RegisterPage.cpp
  3. 10
      src/UserSettingsPage.cpp
  4. 4
      src/Utils.cpp
  5. 4
      src/dialogs/CreateRoom.cpp
  6. 10
      src/dialogs/ReadReceipts.cpp
  7. 1
      src/ui/Avatar.cpp
  8. 1
      src/ui/InfoMessage.cpp
  9. 3
      src/ui/Painter.h

@ -133,7 +133,7 @@ LoginPage::LoginPage(QWidget *parent)
form_layout_->addLayout(matrixidLayout_);
form_layout_->addWidget(password_input_);
form_layout_->addWidget(deviceName_, Qt::AlignHCenter, nullptr);
form_layout_->addWidget(deviceName_, Qt::AlignHCenter);
form_layout_->addLayout(serverLayout_);
button_layout_ = new QHBoxLayout();

@ -107,10 +107,10 @@ RegisterPage::RegisterPage(QWidget *parent)
tr("A server that allows registration. Since matrix is decentralized, you need to first "
"find a server you can register on or host your own."));
form_layout_->addWidget(username_input_, Qt::AlignHCenter, nullptr);
form_layout_->addWidget(password_input_, Qt::AlignHCenter, nullptr);
form_layout_->addWidget(password_confirmation_, Qt::AlignHCenter, nullptr);
form_layout_->addWidget(server_input_, Qt::AlignHCenter, nullptr);
form_layout_->addWidget(username_input_, Qt::AlignHCenter);
form_layout_->addWidget(password_input_, Qt::AlignHCenter);
form_layout_->addWidget(password_confirmation_, Qt::AlignHCenter);
form_layout_->addWidget(server_input_, Qt::AlignHCenter);
button_layout_ = new QHBoxLayout();
button_layout_->setSpacing(0);

@ -612,22 +612,22 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
topLayout_->addWidget(versionInfo);
connect(themeCombo_,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
[this](const QString &text) {
settings_->setTheme(text.toLower());
emit themeChanged();
});
connect(scaleFactorCombo_,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
[](const QString &factor) { utils::setScaleFactor(factor.toFloat()); });
connect(fontSizeCombo_,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
[this](const QString &size) { settings_->setFontSize(size.trimmed().toDouble()); });
connect(fontSelectionCombo_,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
[this](const QString &family) { settings_->setFontFamily(family.trimmed()); });
connect(emojiFontSelectionCombo_,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
[this](const QString &family) { settings_->setEmojiFontFamily(family.trimmed()); });
connect(trayToggle_, &Toggle::toggled, this, [this](bool disabled) {
settings_->setTray(!disabled);

@ -142,13 +142,13 @@ utils::descriptiveTime(const QDateTime &then)
const auto days = then.daysTo(now);
if (days == 0)
return then.time().toString(Qt::DefaultLocaleShortDate);
return QLocale::system().toString(then.time(), QLocale::ShortFormat);
else if (days < 2)
return QString(QCoreApplication::translate("descriptiveTime", "Yesterday"));
else if (days < 7)
return then.toString("dddd");
return then.date().toString(Qt::DefaultLocaleShortDate);
return QLocale::system().toString(then.date(), QLocale::ShortFormat);
}
DescInfo

@ -112,7 +112,7 @@ CreateRoom::CreateRoom(QWidget *parent)
});
connect(visibilityCombo_,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
[this](const QString &text) {
if (text == "Private") {
request_.visibility = mtx::requests::Visibility::Private;
@ -122,7 +122,7 @@ CreateRoom::CreateRoom(QWidget *parent)
});
connect(presetCombo_,
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
[this](const QString &text) {
if (text == "Private Chat") {
request_.preset = mtx::requests::Preset::PrivateChat;

@ -75,15 +75,17 @@ ReceiptItem::dateFormat(const QDateTime &then) const
auto days = then.daysTo(now);
if (days == 0)
return tr("Today %1").arg(then.time().toString(Qt::DefaultLocaleShortDate));
return tr("Today %1")
.arg(QLocale::system().toString(then.time(), QLocale::ShortFormat));
else if (days < 2)
return tr("Yesterday %1").arg(then.time().toString(Qt::DefaultLocaleShortDate));
return tr("Yesterday %1")
.arg(QLocale::system().toString(then.time(), QLocale::ShortFormat));
else if (days < 7)
return QString("%1 %2")
.arg(then.toString("dddd"))
.arg(then.time().toString(Qt::DefaultLocaleShortDate));
.arg(QLocale::system().toString(then.time(), QLocale::ShortFormat));
return then.toString(Qt::DefaultLocaleShortDate);
return QLocale::system().toString(then.time(), QLocale::ShortFormat);
}
ReadReceipts::ReadReceipts(QWidget *parent)

@ -1,4 +1,5 @@
#include <QPainter>
#include <QPainterPath>
#include <QSettings>
#include "AvatarProvider.h"

@ -4,6 +4,7 @@
#include <QDateTime>
#include <QLocale>
#include <QPainter>
#include <QPainterPath>
#include <QPen>
#include <QtGlobal>

@ -3,6 +3,7 @@
#include <QFontMetrics>
#include <QPaintDevice>
#include <QPainter>
#include <QPainterPath>
#include <QtGlobal>
class Painter : public QPainter
@ -163,5 +164,5 @@ public:
private:
Painter &_painter;
QPainter::RenderHints hints_ = 0;
QPainter::RenderHints hints_ = {};
};

Loading…
Cancel
Save