r24840 by craig - Qt6: Updates for QScreen usage

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 29 22:51:41 UTC 2022


Author: craig
Date: Sat Jan 29 22:51:41 2022
New Revision: 24840

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24840
Log:
Qt6: Updates for QScreen usage

Modified:
    trunk/Scribus/scribus/canvasmode_eyedropper.cpp
    trunk/Scribus/scribus/ui/customfdialog.cpp
    trunk/Scribus/scribus/ui/scdockpalette.cpp
    trunk/Scribus/scribus/ui/scrpalettebase.cpp
    trunk/Scribus/scribus/ui/storyeditor.cpp

Modified: trunk/Scribus/scribus/canvasmode_eyedropper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24840&path=/trunk/Scribus/scribus/canvasmode_eyedropper.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_eyedropper.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_eyedropper.cpp	Sat Jan 29 22:51:41 2022
@@ -18,14 +18,14 @@
 
 #include <QApplication>
 #include <QCursor>
-#include <QDesktopWidget>
+#include <QDebug>
 #include <QEvent>
 #include <QInputDialog>
 #include <QMouseEvent>
 #include <QPoint>
 #include <QRect>
 #include <QScreen>
-#include <QDebug>
+#include <QScreen>
 
 #include "appmodes.h"
 #include "canvas.h"

Modified: trunk/Scribus/scribus/ui/customfdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24840&path=/trunk/Scribus/scribus/ui/customfdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/customfdialog.cpp	(original)
+++ trunk/Scribus/scribus/ui/customfdialog.cpp	Sat Jan 29 22:51:41 2022
@@ -25,7 +25,6 @@
 #include <QApplication>
 #include <QCheckBox>
 #include <QComboBox>
-#include <QDesktopWidget>
 #include <QDir>
 #include <QFileInfo>
 #include <QFrame>
@@ -36,6 +35,7 @@
 #include <QPainter>
 #include <QPixmap>
 #include <QPushButton>
+#include <QScreen>
 #include <QScreen>
 #include <QTextCodec>
 #include <QVBoxLayout>

Modified: trunk/Scribus/scribus/ui/scdockpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24840&path=/trunk/Scribus/scribus/ui/scdockpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scdockpalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/scdockpalette.cpp	Sat Jan 29 22:51:41 2022
@@ -35,6 +35,7 @@
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"
+#include "scribuscore.h"
 #include "scdockpalette.h"
 #include "util.h"
 
@@ -154,18 +155,19 @@
 	if (m_palettePrefs && !showEvent->spontaneous() && isFloating())
 	{
 		QScreen *s = ScCore->primaryMainWindow()->screen();
+		QSize scrSize(s->size());
 		if (m_palettePrefs->contains("left"))
 		{
-			QRect scr = s->availableGeometry(this);
+			QRect scr = s->availableGeometry();
 			// all palettes should have enough room for 3x3 min widgets
-			int vwidth  = qMin(qMax(0, m_palettePrefs->getInt("width")), s->width());
-			int vheight = qMin(qMax(0, m_palettePrefs->getInt("height")), s->height());
+			int vwidth  = qMin(qMax(0, m_palettePrefs->getInt("width")), scrSize.width());
+			int vheight = qMin(qMax(0, m_palettePrefs->getInt("height")), scrSize.height());
 			// palettes should not use too much screen space
-			if (vwidth > s->width() / 3 && vheight > s->height()/3)
-				vwidth = s->width() / 3;
+			if (vwidth > scrSize.width() / 3 && vheight > scrSize.height()/3)
+				vwidth = scrSize.width() / 3;
 			// and should be partly visible
 			int vleft   = qMin(qMax(scr.left() - vwidth, m_palettePrefs->getInt("left")), scr.right());
-			int vtop = qMin(m_palettePrefs->getInt("top"), s->height());
+			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);

Modified: trunk/Scribus/scribus/ui/scrpalettebase.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24840&path=/trunk/Scribus/scribus/ui/scrpalettebase.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrpalettebase.cpp	(original)
+++ trunk/Scribus/scribus/ui/scrpalettebase.cpp	Sat Jan 29 22:51:41 2022
@@ -161,16 +161,17 @@
 		QScreen *s = ScCore->primaryMainWindow()->screen();
 		if (m_palettePrefs->contains("left"))
 		{
-			QRect scr = s->availableGeometry(this);
+			QRect scr = s->availableGeometry();
+			QSize scrSize(s->size());
 			// all palettes should have enough room for 3x3 min widgets
-			int vwidth  = qMin(qMax(0, m_palettePrefs->getInt("width")), s->width());
-			int vheight = qMin(qMax(0, m_palettePrefs->getInt("height")), s->height());
+			int vwidth  = qMin(qMax(0, m_palettePrefs->getInt("width")), scrSize.width());
+			int vheight = qMin(qMax(0, m_palettePrefs->getInt("height")), scrSize.height());
 			// palettes should not use too much screen space
-			if (vwidth > s->width()/3 && vheight > s->height()/3)
-				vwidth = s->width()/3;
+			if (vwidth > scrSize.width()/3 && vheight > scrSize.height()/3)
+				vwidth = scrSize.width()/3;
 			// and should be partly visible
 			int vleft   = qMin(qMax(scr.left() - vwidth, m_palettePrefs->getInt("left")), scr.right());
-			int vtop = qMin(m_palettePrefs->getInt("top"), s->height());
+			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);

Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24840&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp	Sat Jan 29 22:51:41 2022
@@ -26,7 +26,6 @@
 #include <QColorDialog>
 #include <QComboBox>
 #include <QCursor>
-#include <QDesktopWidget>
 #include <QEvent>
 #include <QFocusEvent>
 #include <QFontDialog>
@@ -46,6 +45,7 @@
 #include <QRegExp>
 #include <QScopedPointer>
 #include <QScopedValueRollback>
+#include <QScreen>
 #include <QScreen>
 #include <QScrollBar>
 #include <QShowEvent>




More information about the scribus-commit mailing list