r18454 by craig - Remove old QT_VERSION detection code for certain Qt version dependent issues

scribus-commit scribus-commit at lists.scribus.net
Tue Sep 3 21:37:54 UTC 2013


Author: craig
Date: Tue Sep  3 21:37:54 2013
New Revision: 18454

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18454
Log:
Remove old QT_VERSION detection code for certain Qt version dependent issues

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem_pathtext.cpp
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
    trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
    trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
    trunk/Scribus/scribus/pslib.cpp
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scxmlstreamreader.h
    trunk/Scribus/scribus/ui/customfdialog.cpp
    trunk/Scribus/scribus/ui/hruler.cpp
    trunk/Scribus/scribus/ui/newfile.h
    trunk/Scribus/scribus/ui/scdockpalette.cpp
    trunk/Scribus/scribus/ui/scrpalettebase.cpp
    trunk/Scribus/scribus/ui/sctablewidget.cpp
    trunk/Scribus/scribus/ui/sctablewidget.h
    trunk/Scribus/scribus/ui/vruler.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Tue Sep  3 21:37:54 2013
@@ -2168,12 +2168,10 @@
 	{
 		double currPerc = path.percentAtLength(xpos);
 		double currAngle = path.angleAtPercent(currPerc);
-#if QT_VERSION  >= 0x040400
 		if (currAngle <= 180.0)
 			currAngle *= -1.0;
 		else
 			currAngle = 360.0 - currAngle;
-#endif
 		QPointF currPoint = path.pointAtPercent(currPerc);
 		p->save();
 		p->translate(currPoint.x(), currPoint.y());

Modified: trunk/Scribus/scribus/pageitem_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/pageitem_pathtext.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_pathtext.cpp (original)
+++ trunk/Scribus/scribus/pageitem_pathtext.cpp Tue Sep  3 21:37:54 2013
@@ -288,12 +288,10 @@
 			currPerc = currPath.percentAtLength(CurX);
 		}
 		double currAngle = currPath.angleAtPercent(currPerc);
-#if QT_VERSION  >= 0x040400
 		if (currAngle <= 180.0)
 			currAngle *= -1.0;
 		else
 			currAngle = 360.0 - currAngle;
-#endif
 		QPointF currPoint = currPath.pointAtPercent(currPerc);
 		tangent = FPoint(cos(currAngle * M_PI / 180.0), sin(currAngle * M_PI / 180.0));
 		point = FPoint(currPoint.x(), currPoint.y());

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Tue Sep  3 21:37:54 2013
@@ -4521,12 +4521,10 @@
 	{
 		double currPerc = path.percentAtLength(xpos);
 		double currAngle = path.angleAtPercent(currPerc);
-#if QT_VERSION  >= 0x040400
 		if (currAngle <= 180.0)
 			currAngle *= -1.0;
 		else
 			currAngle = 360.0 - currAngle;
-#endif
 		QPointF currPoint = path.pointAtPercent(currPerc);
 		tmp += "q\n";
 		QTransform base;

Modified: trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp Tue Sep  3 21:37:54 2013
@@ -3178,18 +3178,14 @@
 	{
 		if (realM == 9)		// 32bit
 		{
-#if QT_VERSION >= 0x040600
 			ts.setFloatingPointPrecision(QDataStream::SinglePrecision);
-#endif
 			float data;
 			ts >> data;
 			val = data;
 		}
 		else
 		{
-#if QT_VERSION >= 0x040600
 			ts.setFloatingPointPrecision(QDataStream::DoublePrecision);
-#endif
 			double data;
 			ts >> data;
 			val = data;

Modified: trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp Tue Sep  3 21:37:54 2013
@@ -662,12 +662,10 @@
 	{
 		double currPerc = path.percentAtLength(xpos);
 		double currAngle = path.angleAtPercent(currPerc);
-#if QT_VERSION  >= 0x040400
 		if (currAngle <= 180.0)
 			currAngle *= -1.0;
 		else
 			currAngle = 360.0 - currAngle;
-#endif
 		QPointF currPoint = path.pointAtPercent(currPerc);
 		QTransform trans;
 		trans.translate(currPoint.x(), currPoint.y());

Modified: trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp Tue Sep  3 21:37:54 2013
@@ -60,9 +60,7 @@
 	radialGrad.setColorAt(0.0, QColor(255, 0, 0, 127));
 	radialGrad.setColorAt(0.1, QColor(255, 0, 0, 127));
 	radialGrad.setColorAt(1.0, QColor(255, 255, 255, 0));
-#if QT_VERSION  >= 0x040301
 	radialGrad.setCoordinateMode(QGradient::ObjectBoundingMode);
-#endif
 	painter->setBrush(radialGrad);
 	painter->drawEllipse(rect().toRect());
 	if (option->state & QStyle::State_Selected)

Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Tue Sep  3 21:37:54 2013
@@ -3724,12 +3724,10 @@
 	{
 		double currPerc = path.percentAtLength(xpos);
 		double currAngle = path.angleAtPercent(currPerc);
-#if QT_VERSION  >= 0x040400
 		if (currAngle <= 180.0)
 			currAngle *= -1.0;
 		else
 			currAngle = 360.0 - currAngle;
-#endif
 		QPointF currPoint = path.pointAtPercent(currPerc);
 		PS_save();
 		PS_translate(currPoint.x(), -currPoint.y());

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Tue Sep  3 21:37:54 2013
@@ -65,13 +65,7 @@
 #include <QUrl>
 #include <QDir>
 #include <QSizeGrip>
-#if QT_VERSION  > 0x030102
-	#define SPLITVC Qt::SplitHCursor
-	#define SPLITHC Qt::SplitVCursor
-#else
-	#define SPLITVC Qt::SplitVCursor
-	#define SPLITHC Qt::SplitHCursor
-#endif
+
 #include "scribus.h"
 
 #include "canvas.h"
@@ -3080,7 +3074,7 @@
 	if ((pg == -1) || (!QRect(0, 0, visibleWidth(), visibleHeight()).contains(py)))
 		qApp->changeOverrideCursor(QCursor(loadIcon("DelPoint.png")));
 	else
-		qApp->changeOverrideCursor(QCursor(SPLITHC));
+		qApp->changeOverrideCursor(QCursor(Qt::SplitVCursor));
 }
 
 void ScribusView::FromVRuler(QMouseEvent *m)
@@ -3102,7 +3096,7 @@
 	if ((pg == -1) || (!QRect(0, 0, visibleWidth(), visibleHeight()).contains(py)))
 		qApp->changeOverrideCursor(QCursor(loadIcon("DelPoint.png")));
 	else
-		qApp->changeOverrideCursor(QCursor(SPLITVC));
+		qApp->changeOverrideCursor(QCursor(Qt::SplitHCursor));
 }
 #endif
 

Modified: trunk/Scribus/scribus/scxmlstreamreader.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/scxmlstreamreader.h
==============================================================================
--- trunk/Scribus/scribus/scxmlstreamreader.h (original)
+++ trunk/Scribus/scribus/scxmlstreamreader.h Tue Sep  3 21:37:54 2013
@@ -31,22 +31,6 @@
 	double  valueAsDouble (const QString& attrName, double def = 0.0) const;
 	QString valueAsString (const char*    attrName, const QString def = QString()) const;
 	QString valueAsString (const QString& attrName, const QString def = QString()) const;
-
-// Taken directly from Qt code for Qt 4.4 which do not have hasAttribute()
-#if QT_VERSION < 0x040500 
-	inline bool hasAttribute(const QString &qualifiedName) const
-    {
-        return !value(qualifiedName).isNull();
-    }
-    inline bool hasAttribute(const QLatin1String &qualifiedName) const
-    {
-        return !value(qualifiedName).isNull();
-    }
-    inline bool hasAttribute(const QString &namespaceUri, const QString &name) const
-    {
-        return !value(namespaceUri, name).isNull();
-    }
-#endif
 };
 
 class SCRIBUS_API ScXmlStreamReader : public QXmlStreamReader

Modified: trunk/Scribus/scribus/ui/customfdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/ui/customfdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/customfdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/customfdialog.cpp Tue Sep  3 21:37:54 2013
@@ -461,11 +461,7 @@
 		if (flags & fdCompressFile)
 			connect(SaveZip, SIGNAL(clicked()), this, SLOT(handleCompress()));
 	}
-#if QT_VERSION >= 0x040600
 	fileDialog->setNameFilterDetailsVisible(false);
-#else
-	fileDialog->setOption(QFileDialog::HideNameFilterDetails);
-#endif
 	extZip = "gz";
 	connect(OKButton, SIGNAL(clicked()), this, SLOT(accept()));
 	connect(CancelB, SIGNAL(clicked()), this, SLOT(reject()));

Modified: trunk/Scribus/scribus/ui/hruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/ui/hruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.cpp (original)
+++ trunk/Scribus/scribus/ui/hruler.cpp Tue Sep  3 21:37:54 2013
@@ -42,13 +42,6 @@
 #include "scribusview.h"
 #include "selection.h"
 #include "units.h"
-
-
-#if QT_VERSION  > 0x030102
-	#define SPLITHC Qt::SplitVCursor
-#else
-	#define SPLITHC Qt::SplitHCursor
-#endif
 
 #include "util_icon.h"
 
@@ -234,7 +227,7 @@
 	{
 		if (m_doc->guidesPrefs().guidesShown)
 		{
-			qApp->setOverrideCursor(QCursor(SPLITHC));
+			qApp->setOverrideCursor(QCursor(Qt::SplitVCursor));
 			m_view->startGesture(rulerGesture);
 			m_view->registerMousePress(m->globalPos());
 		}

Modified: trunk/Scribus/scribus/ui/newfile.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/ui/newfile.h
==============================================================================
--- trunk/Scribus/scribus/ui/newfile.h (original)
+++ trunk/Scribus/scribus/ui/newfile.h Tue Sep  3 21:37:54 2013
@@ -30,11 +30,7 @@
 class MarginWidget;
 class ScrSpinBox;
 class ScComboBox;
-#if QT_VERSION  >= 0x040300
-	class QFileDialog;
-#else
-	class CustomFDialog;
-#endif
+class QFileDialog;
 
 class SCRIBUS_API PageLayoutsWidget : public QListWidget
 {
@@ -101,11 +97,7 @@
 	ScrSpinBox* widthSpinBox;
 	ScrSpinBox* heightSpinBox;
 	QFrame* openDocFrame;
-#if QT_VERSION  >= 0x040300
 	QFileDialog *fileDialog;
-#else
-	CustomFDialog *fileDialog;
-#endif
 	QFrame* newFromTempFrame;
 	nftwidget *nftGui;
 	QFrame* recentDocFrame;

Modified: trunk/Scribus/scribus/ui/scdockpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/ui/scdockpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scdockpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/scdockpalette.cpp Tue Sep  3 21:37:54 2013
@@ -219,15 +219,6 @@
 		QPoint geo = pos();
 		palettePrefs->set("left", geo.x());
 		palettePrefs->set("top", geo.y());
-/*
-#if QT_VERSION  >= 0x040300 && !defined(_WIN32)
-		QRect geo = geometry();
-#else
-		QRect geo = frameGeometry();
-#endif
-		palettePrefs->set("left", geo.left());
-		palettePrefs->set("top", geo.top());
-*/
 	}
 }
 

Modified: trunk/Scribus/scribus/ui/scrpalettebase.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/ui/scrpalettebase.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrpalettebase.cpp (original)
+++ trunk/Scribus/scribus/ui/scrpalettebase.cpp Tue Sep  3 21:37:54 2013
@@ -231,15 +231,6 @@
 		QPoint geo = pos();
 		palettePrefs->set("left", geo.x());
 		palettePrefs->set("top", geo.y());
-/*
-#if QT_VERSION  >= 0x040300 && !defined(_WIN32)
-		QRect geo = geometry();
-#else
-		QRect geo = frameGeometry();
-#endif
-		palettePrefs->set("left", geo.left());
-		palettePrefs->set("top", geo.top());
-*/
 	}
 }
 

Modified: trunk/Scribus/scribus/ui/sctablewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/ui/sctablewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/sctablewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/sctablewidget.cpp Tue Sep  3 21:37:54 2013
@@ -75,7 +75,6 @@
 	widgetPositions.insert(widget, QPair<int, int>(row, column));
 }
 
-#if QT_VERSION  >= 0x040300
 void ScTableWidget::removeCellWidget ( int row, int column )
 {
 	QTableWidget::removeCellWidget(row, column);
@@ -93,4 +92,3 @@
 	if (t!=NULL)
 		widgetPositions.remove(t);
 }
-#endif

Modified: trunk/Scribus/scribus/ui/sctablewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/ui/sctablewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/sctablewidget.h (original)
+++ trunk/Scribus/scribus/ui/sctablewidget.h Tue Sep  3 21:37:54 2013
@@ -22,9 +22,7 @@
 		ScTableWidget ( int rows, int columns, QWidget * parent = 0 );
 		~ScTableWidget ();
 		void setCellWidget ( int row, int column, QWidget * widget );
-#if QT_VERSION  >= 0x040300
 		void removeCellWidget ( int row, int column );
-#endif
 	protected:
 		bool eventFilter(QObject *obj, QEvent *event);
 

Modified: trunk/Scribus/scribus/ui/vruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18454&path=/trunk/Scribus/scribus/ui/vruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.cpp (original)
+++ trunk/Scribus/scribus/ui/vruler.cpp Tue Sep  3 21:37:54 2013
@@ -40,14 +40,6 @@
 #include "scribusdoc.h"
 #include "units.h"
 #include "vruler.h"
-
-#if QT_VERSION  > 0x030102
-	#define SPLITVC Qt::SplitHCursor
-#else
-	#define SPLITVC Qt::SplitVCursor
-#endif
-
-
 
 Vruler::Vruler(ScribusView *pa, ScribusDoc *doc) : QWidget(pa)
 {
@@ -73,7 +65,7 @@
 	Mpressed = true;
 	if (m_doc->guidesPrefs().guidesShown)
 	{
-		qApp->setOverrideCursor(QCursor(SPLITVC));
+		qApp->setOverrideCursor(QCursor(Qt::SplitHCursor));
 		m_view->startGesture(rulerGesture);
 		m_view->registerMousePress(m->globalPos());
 	}




More information about the scribus-commit mailing list