diff --git a/3rdparty/qite b/3rdparty/qite index 8abc1cdf8..1dd838a90 160000 --- a/3rdparty/qite +++ b/3rdparty/qite @@ -1 +1 @@ -Subproject commit 8abc1cdf83d7be022129fabdd12bfd758c12086f +Subproject commit 1dd838a90b7b85f6ec683093e5377a66a5174775 diff --git a/iris b/iris index 126cdb565..09dd48f24 160000 --- a/iris +++ b/iris @@ -1 +1 @@ -Subproject commit 126cdb5651fb0cad7edf61ad4af311e186cb2c3e +Subproject commit 09dd48f24094165eb317563f69e56410d0bb86f3 diff --git a/src/avcall/jinglertp.cpp b/src/avcall/jinglertp.cpp index cfee67a88..4361cc3e1 100644 --- a/src/avcall/jinglertp.cpp +++ b/src/avcall/jinglertp.cpp @@ -601,7 +601,7 @@ class JingleRtpPrivate : public QObject { iceA_status.remotePassword = audioContent->trans.pass; } - printf("audio candidates=%d\n", audioContent->trans.candidates.count()); + printf("audio candidates=%lld\n", audioContent->trans.candidates.count()); iceA_status.remoteCandidates += audioContent->trans.candidates; } if (videoContent) { @@ -610,7 +610,7 @@ class JingleRtpPrivate : public QObject { iceV_status.remotePassword = videoContent->trans.pass; } - printf("video candidates=%d\n", videoContent->trans.candidates.count()); + printf("video candidates=%lld\n", videoContent->trans.candidates.count()); iceV_status.remoteCandidates += videoContent->trans.candidates; } diff --git a/src/coloropt.cpp b/src/coloropt.cpp index e71a1c969..12f078945 100644 --- a/src/coloropt.cpp +++ b/src/coloropt.cpp @@ -94,9 +94,9 @@ ColorOpt *ColorOpt::instance() { if (!instance_) instance_.reset(new ColorOpt()); - return instance_.data(); + return instance_.get(); } void ColorOpt::reset() { instance_.reset(nullptr); } -QScopedPointer ColorOpt::instance_; +std::unique_ptr ColorOpt::instance_; diff --git a/src/coloropt.h b/src/coloropt.h index 4ce4d94e2..7150940ea 100644 --- a/src/coloropt.h +++ b/src/coloropt.h @@ -52,6 +52,6 @@ private slots: void optionChanged(const QString &opt); private: - static QScopedPointer instance_; - QHash colors; + static std::unique_ptr instance_; + QHash colors; }; diff --git a/src/filesharingdownloader.cpp b/src/filesharingdownloader.cpp index 852a503ab..7835c124a 100644 --- a/src/filesharingdownloader.cpp +++ b/src/filesharingdownloader.cpp @@ -400,7 +400,7 @@ class FileShareDownloader::Private : public QObject { Jingle::FileTransfer::File file; QList jids; QStringList uris; // sorted from low priority to high. - QScopedPointer tmpFile; + std::unique_ptr tmpFile; QString dstFileName; QString lastError; qint64 rangeStart = 0; diff --git a/src/filesharingdownloader.h b/src/filesharingdownloader.h index b32000d72..72b41f7dd 100644 --- a/src/filesharingdownloader.h +++ b/src/filesharingdownloader.h @@ -71,5 +71,5 @@ class FileShareDownloader : public QIODevice { private: class Private; - QScopedPointer d; + std::unique_ptr d; }; diff --git a/src/filesharingmanager.h b/src/filesharingmanager.h index a3523c47e..35e5c3ca5 100644 --- a/src/filesharingmanager.h +++ b/src/filesharingmanager.h @@ -98,7 +98,7 @@ public slots: private: class Private; - QScopedPointer d; + std::unique_ptr d; }; class FileSharingDeviceOpener : public ITEMediaOpener { diff --git a/src/main.cpp b/src/main.cpp index d3153c8c9..caac750e1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -204,9 +204,9 @@ void PsiMain::chooseProfile() PsiIconset::instance()->loadSystem(); while (1) { - QScopedPointer w(new ProfileOpenDlg(lastProfile, - TranslationManager::instance()->availableTranslations(), - TranslationManager::instance()->currentLanguage())); + std::unique_ptr w(new ProfileOpenDlg(lastProfile, + TranslationManager::instance()->availableTranslations(), + TranslationManager::instance()->currentLanguage())); w->ck_auto->setChecked(autoOpen); int r = w->exec(); // lang change diff --git a/src/mucconfigdlg.cpp b/src/mucconfigdlg.cpp index 3e53cb15f..fb5126e0b 100644 --- a/src/mucconfigdlg.cpp +++ b/src/mucconfigdlg.cpp @@ -224,7 +224,8 @@ void MUCConfigDlg::apply() void MUCConfigDlg::destroy() { int i = QMessageBox::warning(this, tr("Destroy room"), - tr("Are you absolutely certain you want to destroy this room?"), tr("Yes"), tr("No")); + tr("Are you absolutely certain you want to destroy this room?"), + QMessageBox::Yes | QMessageBox::No); if (i == 0) { manager_->destroy(); } diff --git a/src/multifiletransferdelegate.cpp b/src/multifiletransferdelegate.cpp index 764e31f08..57ed47598 100644 --- a/src/multifiletransferdelegate.cpp +++ b/src/multifiletransferdelegate.cpp @@ -312,7 +312,11 @@ bool MultiFileTransferDelegate::editorEvent(QEvent *event, QAbstractItemModel *m connect(menu->addAction(tr("Open Destination Folder")), &QAction::triggered, this, [model, index]() { model->setData(index, 1, MultiFileTransferModel::OpenDirRole); }); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) menu->popup(me->globalPos()); +#else + menu->popup(me->globalPosition().toPoint()); +#endif return true; } return false; diff --git a/src/multifiletransferdlg.h b/src/multifiletransferdlg.h index 4b8422cc6..a5117eeb9 100644 --- a/src/multifiletransferdlg.h +++ b/src/multifiletransferdlg.h @@ -21,7 +21,6 @@ #define MULTIFILETRANSFERDLG_H #include -#include class MultiFileTransferItem; class PsiAccount; @@ -83,7 +82,7 @@ class MultiFileTransferDlg : public QDialog { private: Ui::MultiFileTransferDlg *ui; class Private; - QScopedPointer d; + std::unique_ptr d; }; #endif // MULTIFILETRANSFERDLG_H diff --git a/src/multifiletransferitem.h b/src/multifiletransferitem.h index 40058c4f0..23c346b0b 100644 --- a/src/multifiletransferitem.h +++ b/src/multifiletransferitem.h @@ -22,8 +22,6 @@ #include "multifiletransfermodel.h" -#include - class MultiFileTransferItem : public QObject { Q_OBJECT public: @@ -71,7 +69,7 @@ public slots: private: friend class MultiFileTransferModel; struct Private; - QScopedPointer d; + std::unique_ptr d; }; #endif // MULTIFILETRANSFERITEM_H diff --git a/src/options/opt_appearance.cpp b/src/options/opt_appearance.cpp index 42a6b10c5..78b3db638 100644 --- a/src/options/opt_appearance.cpp +++ b/src/options/opt_appearance.cpp @@ -27,7 +27,14 @@ class OptAppearanceUI : public QWidget, public Ui::OptAppearance { class OptAppearanceMiscUI : public QWidget, public Ui::OptAppearanceMisc { public: - OptAppearanceMiscUI() : QWidget() { setupUi(this); } + OptAppearanceMiscUI() : QWidget() + { + // we could do that in UI. but see https://bugreports.qt.io/browse/QTBUG-123373 + QObject::connect(sl_rosterop, &QSlider::valueChanged, lb_rosterop_val, qOverload(&QLabel::setNum)); + QObject::connect(sl_chatdlgop, &QSlider::valueChanged, lb_chatdlgop_val, qOverload(&QLabel::setNum)); + + setupUi(this); + } }; //---------------------------------------------------------------------------- diff --git a/src/options/opt_appearance_misc.ui b/src/options/opt_appearance_misc.ui index 7c1e3f1e5..8cdf33054 100644 --- a/src/options/opt_appearance_misc.ui +++ b/src/options/opt_appearance_misc.ui @@ -1,10 +1,8 @@ - - - - + + OptAppearanceMisc - - + + 0 0 @@ -12,38 +10,38 @@ 189 - + OptAppearanceMiscUI - - - 9 - - + + 6 + + 9 + - - + + Headings - - + + 8 - + 6 - - - + + + Slim group headings - - - + + + Outline headings @@ -52,85 +50,85 @@ - - + + Opacity - - + + 8 - + 6 - - - + + + 10 - + 100 - + Qt::Horizontal - - - + + + 30 0 - + 100 - + Qt::AlignCenter - - - + + + 10 - + 100 - + Qt::Horizontal - - - + + + Roster opacity: - - - + + + 30 0 - + 100 - + Qt::AlignCenter - - - + + + Chat dialog opacity: @@ -140,7 +138,7 @@ - + ck_outlineHeadings ck_newHeadings @@ -148,38 +146,5 @@ sl_chatdlgop - - - sl_rosterop - valueChanged(int) - lb_rosterop_val - setNum(int) - - - 208 - 134 - - - 320 - 134 - - - - - sl_chatdlgop - valueChanged(int) - lb_chatdlgop_val - setNum(int) - - - 208 - 159 - - - 320 - 159 - - - - + diff --git a/src/profiledlg.cpp b/src/profiledlg.cpp index b59996ca4..1563a5fad 100644 --- a/src/profiledlg.cpp +++ b/src/profiledlg.cpp @@ -263,17 +263,19 @@ void ProfileManageDlg::slotProfileDelete() } // prompt first - int r = QMessageBox::warning( - this, CAP(tr("Delete Profile")), - tr("Are you sure you want to delete the \"%1\" profile? " - "This will delete all of the profile's message history as well as associated settings!") - .arg(name), - tr("No, I changed my mind"), tr("Delete it!")); - - if (r != 1) + auto msgBox + = QMessageBox(QMessageBox::Warning, CAP(tr("Delete Profile")), + tr("Are you sure you want to delete the \"%1\" profile? " + "This will delete all of the profile's message history as well as associated settings!") + .arg(name)); + auto rejectButton = msgBox.addButton(tr("No, I changed my mind"), QMessageBox::RejectRole); + auto acceptButton = msgBox.addButton(tr("Delete it!"), QMessageBox::AcceptRole); + msgBox.exec(); + + if (msgBox.clickedButton() != acceptButton) return; - r = QMessageBox::information( + auto r = QMessageBox::information( this, CAP(tr("Delete Profile")), tr("As a precaution, you are being asked one last time if this is what you really want. " "The following folders will be deleted!

\n" @@ -282,7 +284,7 @@ void ProfileManageDlg::slotProfileDelete() .arg(paths.join("\n")), QMessageBox::Yes | QMessageBox::No); - if (r == 1) { + if (r == QMessageBox::Yes) { if (!profileDelete(paths)) { QMessageBox::critical( this, CAP("Error"), diff --git a/src/sxe/sxerecord.cpp b/src/sxe/sxerecord.cpp index 6206e5e88..3ce14d015 100644 --- a/src/sxe/sxerecord.cpp +++ b/src/sxe/sxerecord.cpp @@ -229,7 +229,7 @@ void SxeRecord::processInOrderRecordEdit(const SxeRecordEdit *edit) if (n < 0) qDebug("'replacen' = '%s' is negative.", qPrintable(edit->value(SxeRecordEdit::ReplaceN))); if (from + n > data_.length()) - qDebug("from (%d) + n (%d) > data_.length() (%d).", from, n, data_.length()); + qDebug("from (%d) + n (%d) > data_.length() (%lld).", from, n, data_.length()); } } else { diff --git a/src/tools/globalshortcut/globalshortcutmanager_x11.cpp b/src/tools/globalshortcut/globalshortcutmanager_x11.cpp index cba06cc77..dd5843a65 100644 --- a/src/tools/globalshortcut/globalshortcutmanager_x11.cpp +++ b/src/tools/globalshortcut/globalshortcutmanager_x11.cpp @@ -216,7 +216,13 @@ class X11KeyTriggerManager : public QObject { public: static bool convertKeySequence(const QKeySequence &ks, unsigned int *_mod, Qt_XK_Keygroup *_kg) { - int code = ks[0]; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + auto modifiers = Qt::KeyboardModifiers(ks[0] & Qt::KeyboardModifierMask); + int code = modifiers & ~Qt::KeyboardModifierMask; +#else + auto modifiers = ks[0].keyboardModifiers(); + int code = ks[0].key(); +#endif Qt_XK_Keygroup kg; kg.num = 0; kg.sym[0] = 0; @@ -224,17 +230,15 @@ class X11KeyTriggerManager : public QObject { ensureModifiers(); unsigned int mod = 0; - if (code & Qt::META) + if (modifiers & Qt::MetaModifier) mod |= meta_mask; - if (code & Qt::SHIFT) + if (modifiers & Qt::ShiftModifier) mod |= ShiftMask; - if (code & Qt::CTRL) + if (modifiers & Qt::ControlModifier) mod |= ControlMask; - if (code & Qt::ALT) + if (modifiers & Qt::AltModifier) mod |= alt_mask; - code &= ~Qt::KeyboardModifierMask; - bool found = false; for (int n = 0; qt_xk_table[n].key != Qt::Key_unknown; ++n) { if (qt_xk_table[n].key == code) { @@ -311,7 +315,7 @@ class GlobalShortcutManager::KeyTrigger::Impl : public X11KeyTrigger { Display *appDpy = QX11Info::display(); auto rootWindow = QX11Info::appRootWindow(); #else - auto x11app = qApp->nativeInterface(); + auto x11app = qApp->nativeInterface(); if (!x11app) { return; // wayland? } @@ -369,7 +373,7 @@ class GlobalShortcutManager::KeyTrigger::Impl : public X11KeyTrigger { Display *appDpy = QX11Info::display(); auto rootWindow = QX11Info::appRootWindow(); #else - auto x11app = qApp->nativeInterface(); + auto x11app = qApp->nativeInterface(); if (!x11app) { return; // wayland? } diff --git a/src/tools/optionstree/varianttree.cpp b/src/tools/optionstree/varianttree.cpp index 830ad85aa..2f5df4367 100644 --- a/src/tools/optionstree/varianttree.cpp +++ b/src/tools/optionstree/varianttree.cpp @@ -388,6 +388,7 @@ QVariant VariantTree::elementToVariant(const QDomElement &e) QString type = e.attribute(typeAttr); { // let's start from basic most popular types +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QVariant::Type varianttype; bool known = true; @@ -406,6 +407,26 @@ QVariant VariantTree::elementToVariant(const QDomElement &e) } else { known = false; } +#else + QMetaType::Type varianttype; + bool known = true; + + if (type == boolType) { + varianttype = QMetaType::Bool; + } else if (type == stringType) { + varianttype = QMetaType::QString; + } else if (type == intType) { + varianttype = QMetaType::Int; + } else if (type == ulonglongType) { + varianttype = QMetaType::ULongLong; + } else if (type == keyseqType) { + varianttype = QMetaType::QKeySequence; + } else if (type == colorType) { + varianttype = QMetaType::QColor; + } else { + known = false; + } +#endif if (known) { for (QDomNode node = e.firstChild(); !node.isNull(); node = node.nextSibling()) { @@ -415,8 +436,11 @@ QVariant VariantTree::elementToVariant(const QDomElement &e) if (!value.isValid()) value = QString(""); - +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) value.convert(int(varianttype)); +#else + value.convert(QMetaType(varianttype)); +#endif return value; } } @@ -506,8 +530,13 @@ QVariant VariantTree::elementToVariant(const QDomElement &e) */ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) switch (var.type()) { case QVariant::List: { +#else + switch (var.typeId()) { + case QMetaType::QVariantList: { +#endif const auto &variants = var.toList(); for (const QVariant &v : variants) { QDomElement item_element = e.ownerDocument().createElement(QLatin1String("item")); @@ -516,7 +545,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) } break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Map: { +#else + case QMetaType::QVariantMap: { +#endif QVariantMap map = var.toMap(); QVariantMap::ConstIterator it = map.constBegin(); for (; it != map.constEnd(); ++it) { @@ -526,7 +559,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) } break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Hash: { +#else + case QMetaType::QVariantHash: { +#endif QVariantHash map = var.toHash(); QVariantHash::ConstIterator it = map.constBegin(); for (; it != map.constEnd(); ++it) { @@ -536,7 +573,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) } break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::StringList: { +#else + case QMetaType::QStringList: { +#endif const auto &strings = var.toStringList(); for (const QString &s : strings) { QDomElement item_element = e.ownerDocument().createElement(QLatin1String("item")); @@ -546,7 +587,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) } break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Size: { +#else + case QMetaType::QSize: { +#endif QSize size = var.toSize(); QDomElement width_element = e.ownerDocument().createElement(QLatin1String("width")); width_element.appendChild(e.ownerDocument().createTextNode(QString::number(size.width()))); @@ -556,7 +601,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) e.appendChild(height_element); break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Rect: { +#else + case QMetaType::QRect: { +#endif QRect rect = var.toRect(); QDomElement x_element = e.ownerDocument().createElement(QLatin1String("x")); x_element.appendChild(e.ownerDocument().createTextNode(QString::number(rect.x()))); @@ -572,18 +621,31 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) e.appendChild(height_element); break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::ByteArray: { +#else + case QMetaType::QByteArray: { +#endif QDomText text = e.ownerDocument().createTextNode(var.toByteArray().toBase64()); e.appendChild(text); break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::KeySequence: { +#else + case QMetaType::QKeySequence: { +#endif QKeySequence k = var.value(); QDomText text = e.ownerDocument().createTextNode(k.toString()); e.appendChild(text); break; } - case QVariant::Color: { // save invalid colors as empty string +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + case QVariant::Color: { +#else + case QMetaType::QColor: { +#endif + // save invalid colors as empty string if (var.value().isValid()) { QDomText text = e.ownerDocument().createTextNode(var.toString()); e.appendChild(text); @@ -600,4 +662,4 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) e.setAttribute(QLatin1String("type"), var.typeName()); } -const QVariant VariantTree::missingValue = QVariant(QVariant::Invalid); +const QVariant VariantTree::missingValue = QVariant(); diff --git a/src/whiteboarding/wbwidget.cpp b/src/whiteboarding/wbwidget.cpp index 8f99057bf..551b6f7bf 100644 --- a/src/whiteboarding/wbwidget.cpp +++ b/src/whiteboarding/wbwidget.cpp @@ -241,8 +241,11 @@ void WbWidget::mousePressEvent(QMouseEvent *event) delete newWbItem_; newWbItem_ = nullptr; } - +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QPointF startPoint = mapToScene(mapFromGlobal(event->globalPos())); +#else + QPointF startPoint = mapToScene(mapFromGlobal(event->globalPosition().toPoint())); +#endif if (mode_ == Mode::DrawPath) { // // Create the element with starting position // QPointF sp = mapToScene(mapFromGlobal(event->globalPos())); @@ -292,8 +295,12 @@ void WbWidget::mouseMoveEvent(QMouseEvent *event) if (mode_ == Mode::Erase) { if (event->buttons() != Qt::MouseButtons(Qt::LeftButton)) return; - // Erase all items that appear in a 2*strokeWidth_ square with center at the event position - QPointF p = mapToScene(mapFromGlobal(event->globalPos())); + // Erase all items that appear in a 2*strokeWidth_ square with center at the event position +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QPointF p = mapToScene(mapFromGlobal(event->globalPos())); +#else + QPointF p = mapToScene(mapFromGlobal(event->globalPosition().toPoint())); +#endif QGraphicsRectItem *eraseRect = scene_->addRect(QRectF(p.x() - strokeWidth_, p.y() - strokeWidth_, 2 * strokeWidth_, 2 * strokeWidth_)); const auto &gItems = eraseRect->collidingItems(); @@ -308,7 +315,11 @@ void WbWidget::mouseMoveEvent(QMouseEvent *event) event->ignore(); return; } else if (mode_ >= Mode::DrawPath && newWbItem_) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) newWbItem_->parseCursorMove(mapToScene(mapFromGlobal(event->globalPos()))); +#else + newWbItem_->parseCursorMove(mapToScene(mapFromGlobal(event->globalPosition().toPoint()))); +#endif } } diff --git a/src/widgets/iconselect.cpp b/src/widgets/iconselect.cpp index 4752c23bb..230d7d058 100644 --- a/src/widgets/iconselect.cpp +++ b/src/widgets/iconselect.cpp @@ -258,7 +258,7 @@ IconSelect::~IconSelect() { } void IconSelect::closeMenu() { // this way all parent menus (if any) would be closed too - QMouseEvent me(QEvent::MouseButtonPress, menu->pos() - QPoint(5, 5), Qt::LeftButton, Qt::LeftButton, + QMouseEvent me(QEvent::MouseButtonPress, menu->pos() - QPoint(5, 5), QCursor::pos(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); menu->mousePressEvent(&me); diff --git a/src/xmlconsole.cpp b/src/xmlconsole.cpp index d5ea01286..010fde697 100644 --- a/src/xmlconsole.cpp +++ b/src/xmlconsole.cpp @@ -215,7 +215,7 @@ void XmlPrompt::doTransmit() if (!doc.setContent(str)) { int i = QMessageBox::warning(this, tr("Malformed XML"), tr("You have entered malformed XML input. Are you sure you want to send this ?"), - tr("Yes"), tr("No")); + QMessageBox::Yes | QMessageBox::No); if (i != 0) return; }