r24862 by craig - Remove some older Qt compatibility code

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 30 15:51:51 UTC 2022


Author: craig
Date: Sun Jan 30 15:51:51 2022
New Revision: 24862

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24862
Log:
Remove some older Qt compatibility code

Modified:
    trunk/Scribus/scribus/main_win32.cpp
    trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
    trunk/Scribus/scribus/plugins/import/ps/importps.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/scdockpalette.cpp

Modified: trunk/Scribus/scribus/main_win32.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24862&path=/trunk/Scribus/scribus/main_win32.cpp
==============================================================================
--- trunk/Scribus/scribus/main_win32.cpp	(original)
+++ trunk/Scribus/scribus/main_win32.cpp	Sun Jan 30 15:51:51 2022
@@ -99,9 +99,7 @@
 #endif
 
 	ScribusQApp::setAttribute(Qt::AA_EnableHighDpiScaling);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
 	ScribusQApp::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
-#endif
 
 	ScribusQApp app(argc, argv);
 	setPythonEnvironment(ScribusQApp::applicationDirPath());

Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24862&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	(original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	Sun Jan 30 15:51:51 2022
@@ -674,17 +674,12 @@
 
 void BarcodeGenerator::paintColorSample(QLabel *l, const ScColor & c)
 {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
 	QPixmap currentPixmap = l->pixmap(Qt::ReturnByValue);
-#else
-	QPixmap currentPixmap = l->pixmap() ? *(l->pixmap()) : QPixmap();
-#endif
-	
-	double pixelRatio = l->devicePixelRatioF();
 	QSize pixmapSize(currentPixmap.width(), currentPixmap.height());
 	if (currentPixmap.isNull())
 	{
 		QRect rect = l->frameRect();
+		double pixelRatio = l->devicePixelRatioF();
 		pixmapSize = QSize(rect.width() * pixelRatio, rect.height() * pixelRatio);
 	}
 	QPixmap pm(pixmapSize.width(), pixmapSize.height());

Modified: trunk/Scribus/scribus/plugins/import/ps/importps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24862&path=/trunk/Scribus/scribus/plugins/import/ps/importps.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ps/importps.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/ps/importps.cpp	Sun Jan 30 15:51:51 2022
@@ -65,9 +65,7 @@
 bool EPSPlug::import(QString fName, const TransactionSettings &trSettings, int flags, bool showProgress)
 {
 #ifdef Q_OS_MACOS
-	#if QT_VERSION >= 0x050300
-		showProgress = false;
-	#endif
+	showProgress = false;
 #endif
 
 	bool success = false;

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24862&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Sun Jan 30 15:51:51 2022
@@ -507,15 +507,8 @@
 {
 	QList<QScreen*> screens = QGuiApplication::screens();
 	int screenNumber = -1;
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
-	QWindow* w = ScCore->primaryMainWindow()->windowHandle();
-	if (w != nullptr)
-		screenNumber = screens.indexOf(w->screen());
-#else
 	QScreen* s = ScCore->primaryMainWindow()->screen();
 	screenNumber = screens.indexOf(s);
-#endif
 	if (screenNumber < 0)
 		screenNumber = screens.indexOf(QGuiApplication::primaryScreen());
 	if (screenNumber < 0)

Modified: trunk/Scribus/scribus/ui/scdockpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24862&path=/trunk/Scribus/scribus/ui/scdockpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scdockpalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/scdockpalette.cpp	Sun Jan 30 15:51:51 2022
@@ -88,26 +88,7 @@
 void ScDockPalette::startup()
 {
 	setFontSize();
-	if (m_visibleOnStartup)
-	{
-#if QT_VERSION < 0x050600
-		QMainWindow* mainWindow = dynamic_cast<QMainWindow*>(parent());
-		if (palettePrefs && mainWindow)
-		{
-			Qt::DockWidgetArea area = Qt::NoDockWidgetArea;
-			area = (Qt::DockWidgetArea) palettePrefs->getInt("area", (int) Qt::NoDockWidgetArea);
-			Qt::DockWidgetAreas areas = this->allowedAreas();
-			if (areas.testFlag(area))
-			{
-				mainWindow->addDockWidget(area, this);
-				setFloating (palettePrefs->getBool("floating"));
-			}
-		}
-#endif
-		show();
-	}
-	else
-		hide();
+	setVisible(m_visibleOnStartup);
 	emit paletteShown(m_visibleOnStartup);
 }
 
@@ -170,9 +151,9 @@
 			int vtop = qMin(m_palettePrefs->getInt("top"), scrSize.height());
 #if defined(Q_OS_MAC) || defined(_WIN32)
 			// on Mac and Windows you're dead if the titlebar is not on screen
-			vtop    = qMax(64, vtop);
+			vtop = qMax(64, vtop);
 #else
-			vtop    = qMax(-vheight, vtop);
+			vtop = qMax(-vheight, vtop);
 #endif
 			// Check values against current screen size
 			if (vleft <= scr.left())




More information about the scribus-commit mailing list