Skip to content

Commit 157bd20

Browse files
author
g_j_m
committedMay 27, 2006
Move to Qt4 #include sytle
Rationalise #includes Remove Q3 classes git-svn-id: http://svn.osgeo.org/qgis/trunk@5492 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e88ae0a commit 157bd20

File tree

3 files changed

+30
-62
lines changed

3 files changed

+30
-62
lines changed
 

‎src/raster/qgsrasterbandstats.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define QGSRASTERBANDSTATS
2626

2727
#include <QString>
28-
#include <Q3ValueVector>
28+
#include <QVector>
2929

3030
#include "qgscolortable.h"
3131
/** \brief The RasterBandStats struct is a container for statistics about a single
@@ -61,7 +61,7 @@ class QgsRasterBandStats
6161
* TODO: check if NO_DATA are excluded!*/
6262
int elementCountInt;
6363
/** \brief Store the histogram for a given layer */
64-
typedef Q3ValueVector<int> HistogramVector;
64+
typedef QVector<int> HistogramVector;
6565
HistogramVector * histogramVector;
6666
/** \brief whteher histogram values are estimated or completely calculated */
6767
bool histogramEstimatedFlag;

‎src/raster/qgsrasterlayer.cpp

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -64,37 +64,30 @@ wish to see edbug messages printed to stdout.
6464
#include <qgslogger.h>
6565
#include "qgsrasterlayer.h"
6666
#include "qgsmaptopixel.h"
67-
//Added by qt3to4:
68-
#include <Q3Frame>
69-
#include <QPixmap>
67+
7068

7169
#include <cstdio>
7270
#include <cmath>
7371
#include <limits>
7472
#include <iostream>
7573

76-
#include <qapplication.h>
77-
#include <qcursor.h>
78-
#include <qpainter.h>
79-
#include <qimage.h>
80-
#include <qfont.h>
81-
#include <qfile.h>
82-
#include <qfileinfo.h>
83-
#include <qfontmetrics.h>
84-
#include <qmatrix.h>
85-
#include <q3popupmenu.h>
86-
#include <qmessagebox.h>
87-
#include <qregexp.h>
88-
#include <qslider.h>
89-
#include <qlabel.h>
90-
#include <qdom.h>
91-
#include <q3listview.h>
92-
#include <qwidget.h>
93-
#include <qwidget.h>
94-
#include <qsettings.h>
95-
#include <qglobal.h>
96-
#include <QIcon>
97-
74+
#include <QApplication>
75+
#include <QCursor>
76+
#include <QPainter>
77+
#include <QImage>
78+
#include <QFont>
79+
#include <QFile>
80+
#include <QFileInfo>
81+
#include <QFontMetrics>
82+
#include <QMatrix>
83+
#include <QMessageBox>
84+
#include <QRegExp>
85+
#include <QSlider>
86+
#include <QLabel>
87+
#include <QDomNode>
88+
#include <QDomElement>
89+
#include <QFrame>
90+
#include <QPixmap>
9891

9992
/*
10093
*
@@ -103,7 +96,7 @@ wish to see edbug messages printed to stdout.
10396
*
10497
*/
10598

106-
#include <qlibrary.h>
99+
#include <QLibrary>
107100

108101
/*
109102
* END
@@ -775,17 +768,11 @@ QDateTime QgsRasterLayer::lastModified ( QString const & name )
775768
if ( f.open ( QIODevice::ReadOnly ) )
776769
{
777770
QString dir = fi.dirPath() + "/../../../";
778-
#if QT_VERSION < 0x040000
779-
QString ln;
780-
while ( f.readLine(ln,100) != -1 )
781-
{
782-
#else
783-
// In Qt4, QFile::readLine now expects a bare char*
771+
784772
char buf[101];
785773
while ( f.readLine(buf,100) != -1 )
786774
{
787775
QString ln = QString(buf);
788-
#endif
789776
QStringList sl = QStringList::split ( ' ', ln.stripWhiteSpace() );
790777
QString map = sl.first();
791778
sl.pop_front();
@@ -3667,7 +3654,7 @@ void QgsRasterLayer::initContextMenu_(QgisApp * theApp)
36673654

36683655
QLabel * myTransparencyLabel = new QLabel( popMenu );
36693656

3670-
myTransparencyLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Raised );
3657+
myTransparencyLabel->setFrameStyle( QFrame::Panel | QFrame::Raised );
36713658
myTransparencyLabel->setText( tr("<center><b>Transparency</b></center>") );
36723659

36733660
// TODO: Qt4 will have to use a QAction instead

‎src/raster/qgsrasterlayer.h

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -166,27 +166,10 @@ The [type] part of the variable should be the type class of the variable written
166166
// Includes
167167
//
168168

169-
#include <q3valuevector.h>
170-
#include <q3valuelist.h>
171-
#include <q3valuevector.h>
172-
#include <qslider.h>
173-
#include <qdatetime.h>
169+
#include <QDateTime>
170+
#include <QVector>
171+
#include <QList>
174172

175-
176-
/*
177-
*
178-
* New includes that will convert this class to a data provider interface
179-
* (B Morley)
180-
*
181-
*/
182-
183-
#include <qlibrary.h>
184-
185-
/*
186-
* END
187-
*/
188-
189-
190173
#include "qgspoint.h"
191174
#include "qgsmaplayer.h"
192175
#include "qgscolortable.h"
@@ -202,9 +185,6 @@ The [type] part of the variable should be the type class of the variable written
202185
*/
203186

204187
#include "qgsrasterdataprovider.h"
205-
//Added by qt3to4:
206-
#include <QPixmap>
207-
#include <Q3PopupMenu>
208188

209189
/*
210190
* END
@@ -220,7 +200,8 @@ class QgsRasterLayerProperties;
220200
class GDALDataset;
221201
class GDALRasterBand;
222202
class QImage;
223-
203+
class QSlider;
204+
class QLibrary;
224205
//
225206
// Structs
226207
//
@@ -275,7 +256,7 @@ class QgsRasterLayer : public QgsMapLayer
275256
/** \brief A vector containing one RasterBandStats struct per raster band in this raster layer.
276257
* Note that while very RasterBandStats element will have the name and number of its associated
277258
* band populated, any additional stats are calculated on a need to know basis.*/
278-
typedef Q3ValueVector<QgsRasterBandStats> RasterStatsVector;
259+
typedef QVector<QgsRasterBandStats> RasterStatsVector;
279260

280261

281262
/** \brief A list containing one RasterPyramid struct per
@@ -286,7 +267,7 @@ class QgsRasterLayer : public QgsMapLayer
286267
* we will check to see if a pyramid matching these dimensions already exists
287268
* in the raster layer, and if so mark the exists flag as true. */
288269

289-
typedef Q3ValueList<QgsRasterPyramid> RasterPyramidList;
270+
typedef QList<QgsRasterPyramid> RasterPyramidList;
290271

291272
/** \brief This typedef is used when the showProgress function is passed to gdal as a function
292273
pointer. */

0 commit comments

Comments
 (0)
Please sign in to comment.