mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Fix all compilation issues after enabling QT_DISABLE_DEPRECATED_UP_TO
This commit is contained in:
@ -9,6 +9,8 @@
|
||||
#include <QLabel>
|
||||
#include <QScreen>
|
||||
|
||||
#include <utility>
|
||||
|
||||
BookmarksDialog::BookmarksDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
@ -28,7 +30,7 @@ BookmarksDialog::BookmarksDialog(QWidget *parent)
|
||||
|
||||
QString labelsStyle = "QLabel {color:white;}";
|
||||
|
||||
foreach (QLabel *label, pages) {
|
||||
for (QLabel *const label : std::as_const(pages)) {
|
||||
label->setStyleSheet(labelsStyle);
|
||||
}
|
||||
|
||||
|
||||
@ -92,12 +92,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
qInstallMessageHandler(messageHandler);
|
||||
|
||||
static const char ENV_VAR_QT_DEVICE_PIXEL_RATIO[] = "QT_DEVICE_PIXEL_RATIO";
|
||||
if (!qEnvironmentVariableIsSet(ENV_VAR_QT_DEVICE_PIXEL_RATIO) && !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") && !qEnvironmentVariableIsSet("QT_SCALE_FACTOR") && !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) {
|
||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
}
|
||||
|
||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||
|
||||
QImageReader::setAllocationLimit(0);
|
||||
|
||||
@ -984,7 +984,7 @@ void MainWindowViewer::openFolderFromPath(QString pathDir, QString atFileName)
|
||||
|
||||
std::sort(list.begin(), list.end(), naturalSortLessThanCI);
|
||||
int i = 0;
|
||||
foreach (QString path, list) {
|
||||
for (const QString &path : std::as_const(list)) {
|
||||
if (path.endsWith(atFileName))
|
||||
break;
|
||||
i++;
|
||||
@ -1554,7 +1554,7 @@ void MainWindowViewer::getSiblingComics(QString path, QString currentComic)
|
||||
txtS << path << '\n';
|
||||
txtS << currentComic << '\n';
|
||||
txtS << "Comic list count : " + list.count() << '\n';
|
||||
foreach(QString s, list){
|
||||
for (const QString &s : std::as_const(list)) {
|
||||
txtS << s << '\n';
|
||||
}
|
||||
f.close();
|
||||
|
||||
Reference in New Issue
Block a user