migrate to Qt6

This commit is contained in:
codestation
2025-05-31 15:09:15 -05:00
parent 65f0eab8ca
commit 364dd34ced
24 changed files with 69 additions and 220 deletions

View File

@@ -62,7 +62,7 @@ void BackupItem::removeEntry()
emit deleteEntry(this);
}
const QPixmap *BackupItem::getIconPixmap()
const QPixmap BackupItem::getIconPixmap()
{
return ui->itemPicture->pixmap();
}

View File

@@ -37,7 +37,7 @@ public:
void setItemInfo(const QString &name, const QString &size, const QString &extra);
void setItemIcon(const QString &m_path, int width = 48, bool try_dds = false);
void setDirectory(const QString &m_path);
const QPixmap *getIconPixmap();
const QPixmap getIconPixmap();
int getIconWidth();
QString getPath();
QString getSize();

View File

@@ -19,7 +19,6 @@
#include "backupmanagerform.h"
#include "ui_backupmanagerform.h"
#include "cmaobject.h"
#include "sforeader.h"
#include "confirmdialog.h"
#include "cmautils.h"
@@ -90,7 +89,7 @@ void BackupManagerForm::removeEntry(BackupItem *item)
ConfirmDialog msgBox;
msgBox.setMessageText(tr("Are you sure to remove the backup of the following entry?"), item->title);
msgBox.setMessagePixmap(*item->getIconPixmap(), item->getIconWidth());
msgBox.setMessagePixmap(item->getIconPixmap(), item->getIconWidth());
if(msgBox.exec() == 0) {
return;
@@ -190,11 +189,7 @@ void BackupManagerForm::loadBackupListing(int index)
// adjust the table item width to fill all the widget
QHeaderView *vert_header = ui->tableWidget->verticalHeader();
QHeaderView *horiz_header = ui->tableWidget->horizontalHeader();
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
horiz_header->setSectionResizeMode(QHeaderView::Stretch);
#else
horiz_header->setResizeMode(QHeaderView::Stretch);
#endif
qint64 backup_size = m_db->getObjectSize(ohfi);
setBackupUsage(backup_size);
QString path = m_db->getAbsolutePath(ohfi);
@@ -254,7 +249,7 @@ void BackupManagerForm::loadBackupListing(int index)
m_db->freeMetadata(first);
qSort(item_list.begin(), item_list.end(), BackupItem::lessThan);
std::sort(item_list.begin(), item_list.end(), BackupItem::lessThan);
int row;
QList<BackupItem *>::iterator it;

View File

@@ -26,14 +26,7 @@ extern "C" {
#include <QFileDialog>
#include <QSettings>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QStandardPaths>
#else
#include <QDesktopServices>
#define QStandardPaths QDesktopServices
#define writableLocation storageLocation
#endif
ConfigWidget::ConfigWidget(QWidget *obj_parent) :
QDialog(obj_parent),

View File

@@ -21,7 +21,7 @@
#include "ui_pinform.h"
#include <QDebug>
#include <QDesktopWidget>
#include <QScreen>
const QString PinForm::pinFormat =
"<html><head/><body>"
@@ -33,7 +33,10 @@ PinForm::PinForm(QWidget *obj_parent) :
ui(new Ui::PinForm)
{
ui->setupUi(this);
move(QApplication::desktop()->screen()->rect().center() - rect().center());
if (QScreen *screen = QGuiApplication::primaryScreen()) {
QRect screenGeometry = screen->geometry();
move(screenGeometry.center() - rect().center());
}
setFixedSize(size());
setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);
connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(hide()));

View File

@@ -20,15 +20,18 @@
#include "progressform.h"
#include "ui_progressform.h"
#include <QDesktopWidget>
#include <QMessageBox>
#include <QScreen>
ProgressForm::ProgressForm(QWidget *obj_parent) :
QWidget(obj_parent),
ui(new Ui::ProgressForm)
{
ui->setupUi(this);
move(QApplication::desktop()->screen()->rect().center() - rect().center());
if (QScreen *screen = QGuiApplication::primaryScreen()) {
QRect screenGeometry = screen->geometry();
move(screenGeometry.center() - rect().center());
}
setFixedSize(size());
setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);
connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelConfirm()));