Major port Qt4 to Qt6
- Updated header inclusions from QtGui to QtWidgets for consistency and compatibility with Qt 5 and later. - Replaced deprecated QApplication::desktop() with QApplication::primaryScreen() for obtaining screen DPI. - Modified MyOutputHandler to use QMessageLogContext and QString for improved logging. - Changed QMatrix to QTransform for image rotation in ImageCutout class. - Updated various debug statements to use toLocal8Bit() instead of toAscii() for better string handling. - Refactored several classes to use QElapsedTimer instead of QTime for performance measurement. - Ensured all operator overloads in Section and Tag classes are marked as const for better const-correctness.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
#include <QPrinter>
|
||||
#include <QImage>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QScreen>
|
||||
|
||||
#include "constants.h"
|
||||
|
||||
@@ -87,7 +87,7 @@ QImage DrawerScene::screenShot()
|
||||
m_pageItem->hideMargins();
|
||||
m_pageItem->unselectItems();
|
||||
|
||||
int dpi = QApplication::desktop()->logicalDpiX();
|
||||
int dpi = QApplication::primaryScreen()->logicalDotsPerInchX();
|
||||
int w = static_cast<int> (dpi * A4_WIDTH);
|
||||
int h = static_cast<int> (dpi * A4_HEIGHT);
|
||||
//int w = 827;
|
||||
@@ -101,7 +101,7 @@ QImage DrawerScene::screenShot()
|
||||
setBackgroundBrush(Qt::white);
|
||||
painter.setBackgroundMode(Qt::TransparentMode);
|
||||
painter.setBackground(Qt::white);
|
||||
painter.setRenderHint(QPainter::HighQualityAntialiasing);
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
//QRect rec = m_pageItem->boundingRect().toRect();
|
||||
//rec.setX(rec.x() - 20);
|
||||
|
||||
Reference in New Issue
Block a user