Skip to content

Commit

Permalink
Qt5 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed May 5, 2024
1 parent afc2fae commit 3bbfb71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/groupchattopicdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GroupchatTopicDlg::GroupchatTopicDlg(GCMainDlg *parent) :
QKeySequence sendKey = ShortcutManager::instance()->shortcut("chat.send");
if (sendKey == QKeySequence(Qt::Key_Enter) || sendKey == QKeySequence(Qt::Key_Return)) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
sendKey = QKeySequence(Qt::CTRL | Qt::Key_Return);
sendKey = QKeySequence(quint32(Qt::CTRL) | quint32(Qt::Key_Return));
#else
sendKey = QKeySequence(QKeyCombination(Qt::CTRL, Qt::Key_Return));
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/options/opt_chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ void OptionsTabChat::applyOptions()
vl << QVariant::fromValue(QKeySequence(Qt::Key_Enter)) << QVariant::fromValue(QKeySequence(Qt::Key_Return));
} else {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
vl << QVariant::fromValue(QKeySequence(Qt::Key_Enter | Qt::CTRL))
<< QVariant::fromValue(QKeySequence(Qt::CTRL | Qt::Key_Return));
vl << QVariant::fromValue(QKeySequence(quint32(Qt::Key_Enter) | quint32(Qt::CTRL)))
<< QVariant::fromValue(QKeySequence(quint32(Qt::CTRL) | quint32(Qt::Key_Return)));
#else
vl << QVariant::fromValue(QKeySequence(QKeyCombination(Qt::CTRL, Qt::Key_Enter)))
<< QVariant::fromValue(QKeySequence(QKeyCombination(Qt::CTRL, Qt::Key_Return)));
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/iconselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ void IconSelect::updateGrid()
std::transform(sorted.begin(), sorted.end(), std::back_inserter(toRender),
[](auto icon) { return Item { icon }; });
} else {
QSizeF totalSize;
QSizeF totalSize;
auto const &er = EmojiRegistry::instance();
for (auto it = er.begin(); it != er.end(); ++it) {
#ifdef Q_OS_WIN
Expand All @@ -396,7 +396,7 @@ void IconSelect::updateGrid()
if (titleFilter.isEmpty() || emoji.name.contains(titleFilter)) {
auto rect = QFontMetrics(font).boundingRect(emoji.code);
if (!rect.isEmpty() && rect.width() < rect.height() * 1.4 && rect.height() < rect.width() * 1.4) {
totalSize += rect.size().toSizeF();
totalSize += rect.size();
toRender.emplace_back(nullptr, &emoji);
if (!titleFilter.isEmpty() && toRender.size() == 40) {
break;
Expand Down

0 comments on commit 3bbfb71

Please sign in to comment.