refactor: fix deprecation up to Qt 5.15

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2022-05-02 19:10:45 +02:00
parent c1bcbf8c63
commit 984692dc62
54 changed files with 199 additions and 1352 deletions

View File

@ -63,7 +63,7 @@ public:
{
case Qt::FontRole:
return m_font;
case Qt::TextColorRole:
case Qt::ForegroundRole:
{
MessageLevel::Enum level = (MessageLevel::Enum) QIdentityProxyModel::data(index, LogModel::LevelRole).toInt();
return m_colors->getFront(level);

View File

@ -270,7 +270,7 @@ ScreenshotsPage::ScreenshotsPage(QString path, QWidget *parent)
ui->listView->setViewMode(QListView::IconMode);
ui->listView->setResizeMode(QListView::Adjust);
ui->listView->installEventFilter(this);
ui->listView->setEditTriggers(0);
ui->listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
ui->listView->setItemDelegate(new CenteredEditingDelegate(this));
ui->listView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->listView, &QListView::customContextMenuRequested, this, &ScreenshotsPage::ShowContextMenu);

View File

@ -288,7 +288,11 @@ public:
return false;
}
beginMoveRows(QModelIndex(), row, row, QModelIndex(), row - 1);
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
m_servers.swapItemsAt(row-1, row);
#else
m_servers.swap(row-1, row);
#endif
endMoveRows();
scheduleSave();
return true;
@ -306,7 +310,11 @@ public:
return false;
}
beginMoveRows(QModelIndex(), row, row, QModelIndex(), row + 2);
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
m_servers.swapItemsAt(row+1, row);
#else
m_servers.swap(row+1, row);
#endif
endMoveRows();
scheduleSave();
return true;