Skip to content

Commit 3e5ff1f

Browse files
committedNov 30, 2013
set minimum Qt version to 4.7 and remove #ifdef code depending on prior versions
1 parent 9cc3c5c commit 3e5ff1f

30 files changed

+30
-175
lines changed
 

‎CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ SET (HAVE_MSSQL TRUE)
219219

220220
#############################################################
221221
# search for Qt4
222-
SET(QT_MIN_VERSION 4.5.0)
222+
SET(QT_MIN_VERSION 4.7.0)
223223
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
224224
MESSAGE(STATUS "Found Qt version: ${QTVERSION}")
225225
SET(QT_USE_QTXML 1)
@@ -242,12 +242,8 @@ ELSE (ANDROID)
242242
SET (DEFAULT_WITH_TOUCH FALSE)
243243
ENDIF (ANDROID)
244244

245-
#Add a touch mode if Qt has Qt Gestures (starting from 4.6)
246-
IF ( (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR GREATER 5) OR QT_VERSION_MAJOR GREATER 4 )
247-
SET (WITH_TOUCH ${DEFAULT_WITH_TOUCH} CACHE BOOL "Determines if touch interface related code should be build")
248-
ELSE ( (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR GREATER 5) OR QT_VERSION_MAJOR GREATER 4 )
249-
SET (WITH_TOUCH FALSE)
250-
ENDIF ( (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR GREATER 5) OR QT_VERSION_MAJOR GREATER 4 )
245+
#Add a touch mode if Qt has Qt Gestures
246+
SET (WITH_TOUCH ${DEFAULT_WITH_TOUCH} CACHE BOOL "Determines if touch interface related code should be build")
251247

252248
IF (WITH_TOUCH)
253249
# following variable is used in qgsconfig.h

‎INSTALL

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
QGIS
22
Building QGIS from source - step by step
3-
Thursday November 21, 2013
3+
Saturday November 30, 2013
44

55

6-
Last Updated: Thursday November 21, 2013
7-
Last Change : Thursday November 21, 2013
6+
Last Updated: Saturday November 30, 2013
7+
Last Change : Saturday November 30, 2013
88

99

1010
1. Introduction
@@ -98,7 +98,7 @@ Required build tools:
9898

9999
Required build deps:
100100

101-
- Qt >= 4.5.0
101+
- Qt >= 4.7.0
102102
- Proj >= 4.4.x
103103
- GEOS >= 3.0
104104
- Sqlite3 >= 3.0.0

‎doc/INSTALL.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
66
<TITLE>QGIS</TITLE>
77

8-
<!-- Included /home/fischer/src/qgis/doc/style.css -->
8+
<!-- Included /home/fischer/src/qgis/qgis/doc/style.css -->
99
<STYLE TYPE="text/css">
1010
body{ background: white;
1111
color: black;
@@ -77,13 +77,13 @@
7777
<DIV CLASS="header" ID="header">
7878
<H1>QGIS</H1>
7979
<H2>Building QGIS from source - step by step</H2>
80-
<H3>Thursday November 21, 2013</H3>
80+
<H3>Saturday November 30, 2013</H3>
8181
</DIV>
8282

8383
<DIV CLASS="body" ID="body">
8484
<P>
85-
Last Updated: Thursday November 21, 2013
86-
Last Change : Thursday November 21, 2013
85+
Last Updated: Saturday November 30, 2013
86+
Last Change : Saturday November 30, 2013
8787
</P>
8888
<DIV CLASS="toc">
8989

@@ -205,7 +205,7 @@ <H1>2. Overview</H1>
205205
</P>
206206

207207
<UL>
208-
<LI>Qt &gt;= 4.5.0
208+
<LI>Qt &gt;= 4.7.0
209209
<LI>Proj &gt;= 4.4.x
210210
<LI>GEOS &gt;= 3.0
211211
<LI>Sqlite3 &gt;= 3.0.0
@@ -3227,5 +3227,5 @@ <H1>9. Authors and Acknowledgments</H1>
32273227

32283228
</DIV>
32293229
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
3230-
<!-- cmdline: txt2tags -o/home/fischer/src/qgis/debian/build/doc/INSTALL.html -t html /home/fischer/src/qgis/doc/INSTALL.t2t -->
3230+
<!-- cmdline: txt2tags -o/home/fischer/src/qgis/qgis/debian/build/doc/INSTALL.html -t html /home/fischer/src/qgis/qgis/doc/INSTALL.t2t -->
32313231
</BODY></HTML>

‎doc/overview.t2t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Required build tools:
1515

1616
Required build deps:
1717

18-
- Qt >= 4.5.0
18+
- Qt >= 4.7.0
1919
- Proj >= 4.4.x
2020
- GEOS >= 3.0
2121
- Sqlite3 >= 3.0.0

‎src/app/composer/qgscomposer.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,9 +1509,7 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
15091509
for ( int i = 0; i < mComposition->numPages(); ++i )
15101510
{
15111511
QSvgGenerator generator;
1512-
#if QT_VERSION >= 0x040500
15131512
generator.setTitle( QgsProject::instance()->title() );
1514-
#endif
15151513
if ( i == 0 )
15161514
{
15171515
generator.setFileName( outputFileName );
@@ -1527,9 +1525,7 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
15271525
//height in pixel
15281526
int height = ( int )( mComposition->paperHeight() * mComposition->printResolution() / 25.4 );
15291527
generator.setSize( QSize( width, height ) );
1530-
#if QT_VERSION >= 0x040500
15311528
generator.setViewBox( QRect( 0, 0, width, height ) );
1532-
#endif
15331529
generator.setResolution( mComposition->printResolution() ); //because the rendering is done in mm, convert the dpi
15341530

15351531
QPainter p( &generator );

‎src/app/composer/qgscomposerlabelwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void QgsComposerLabelWidget::on_mFontButton_clicked()
8686
if ( mComposerLabel )
8787
{
8888
bool ok;
89-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
89+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
9090
// Native Mac dialog works only for Qt Carbon
9191
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), 0, QString(), QFontDialog::DontUseNativeDialog );
9292
#else

‎src/app/composer/qgscomposerlegendwidget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
373373
if ( mLegend )
374374
{
375375
bool ok;
376-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
376+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
377377
// Native Mac dialog works only for Qt Carbon
378378
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Title ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
379379
#else
@@ -395,7 +395,7 @@ void QgsComposerLegendWidget::on_mGroupFontButton_clicked()
395395
if ( mLegend )
396396
{
397397
bool ok;
398-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
398+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
399399
// Native Mac dialog works only for Qt Carbon
400400
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Group ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
401401
#else
@@ -417,7 +417,7 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
417417
if ( mLegend )
418418
{
419419
bool ok;
420-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
420+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
421421
// Native Mac dialog works only for Qt Carbon
422422
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Subgroup ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
423423
#else
@@ -439,7 +439,7 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
439439
if ( mLegend )
440440
{
441441
bool ok;
442-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
442+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
443443
// Native Mac dialog works only for Qt Carbon
444444
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::SymbolLabel ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
445445
#else

‎src/app/composer/qgscomposermapwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
751751
}
752752

753753
bool ok;
754-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
754+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
755755
// Native Mac dialog works only for Qt Carbon
756756
QFont newFont = QFontDialog::getFont( &ok, mComposerMap->gridAnnotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
757757
#else

‎src/app/composer/qgscomposerscalebarwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ void QgsComposerScaleBarWidget::on_mFontButton_clicked()
282282

283283
bool dialogAccepted;
284284
QFont oldFont = mComposerScaleBar->font();
285-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
285+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
286286
// Native Mac dialog works only for Qt Carbon
287287
QFont newFont = QFontDialog::getFont( &dialogAccepted, oldFont, 0, QString(), QFontDialog::DontUseNativeDialog );
288288
#else

‎src/app/composer/qgscomposertablewidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void QgsComposerTableWidget::on_mHeaderFontPushButton_clicked()
217217
}
218218

219219
bool ok;
220-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
220+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
221221
// Native Mac dialog works only for Qt Carbon
222222
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
223223
#else
@@ -239,7 +239,7 @@ void QgsComposerTableWidget::on_mContentFontPushButton_clicked()
239239
}
240240

241241
bool ok;
242-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
242+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
243243
// Native Mac dialog works only for Qt Carbon
244244
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
245245
#else

‎src/app/legend/qgslegendlayer.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ void QgsLegendLayer::rasterLayerSymbology( QgsRasterLayer* layer )
215215
SymbologyList itemList;
216216
QList< QPair< QString, QColor > > rasterItemList = layer->legendSymbologyItems();
217217
QList< QPair< QString, QColor > >::const_iterator itemIt = rasterItemList.constBegin();
218-
#if QT_VERSION >= 0x40700
219218
itemList.reserve( rasterItemList.size() );
220-
#endif
221219

222220
// GetLegendGraphics in case of WMS service... pixmap can return null if GetLegendGraphics
223221
// is not supported by the server
@@ -231,9 +229,8 @@ void QgsLegendLayer::rasterLayerSymbology( QgsRasterLayer* layer )
231229
{
232230
QgsDebugMsg( QString( "downloaded legend with dimension width:" ) + QString::number( legendGraphic.width() ) + QString( " and Height:" ) + QString::number( legendGraphic.height() ) );
233231

234-
#if QT_VERSION >= 0x40700
235-
if ( rasterItemList.size() == 0 ) itemList.reserve( 1 );
236-
#endif
232+
if ( rasterItemList.size() == 0 )
233+
itemList.reserve( 1 );
237234
itemList.append( qMakePair( QString( "" ), QPixmap::fromImage( legendGraphic ) ) );
238235
}
239236
}

‎src/app/qgisapp.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@
7474
#include <QNetworkReply>
7575
#include <QNetworkProxy>
7676
#include <QAuthenticator>
77-
78-
#if QT_VERSION >= 0x40500
7977
#include <QNetworkDiskCache>
80-
#endif
8178

8279
//
8380
// Mac OS X Includes

‎src/app/qgsdecorationgriddialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ void QgsDecorationGridDialog::on_mPbtnUpdateFromLayer_clicked()
275275
void QgsDecorationGridDialog::on_mAnnotationFontButton_clicked()
276276
{
277277
bool ok;
278-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
278+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
279279
// Native Mac dialog works only for Qt Carbon
280280
QFont newFont = QFontDialog::getFont( &ok, mDeco.gridAnnotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
281281
#else

‎src/app/qgslabeldialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void QgsLabelDialog::changeFont( void )
280280

281281
qreal fontSize = mFont.pointSizeF();
282282
bool resultFlag;
283-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
283+
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
284284
// Native Mac dialog works only for Qt Carbon
285285
mFont = QFontDialog::getFont( &resultFlag, mFont, 0, QString(), QFontDialog::DontUseNativeDialog );
286286
#else

‎src/app/qgsoptions.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@
4848
#include <QSize>
4949
#include <QStyleFactory>
5050
#include <QMessageBox>
51-
52-
#if QT_VERSION >= 0x40500
5351
#include <QNetworkDiskCache>
54-
#endif
5552

5653
#include <limits>
5754
#include <sqlite3.h>
@@ -286,7 +283,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
286283
}
287284
}
288285

289-
#if QT_VERSION >= 0x40500
290286
// cache settings
291287
QNetworkDiskCache *cache = qobject_cast<QNetworkDiskCache*>( QgsNetworkAccessManager::instance()->cache() );
292288
if ( cache )
@@ -298,10 +294,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
298294
QgsDebugMsg( QString( "set cacheSize: %1" ).arg( cache->maximumCacheSize() ) );
299295
mCacheSize->setValue( cache->maximumCacheSize() / 1024 );
300296
}
301-
#else
302-
grpUrlExclude->setHidden( true );
303-
grpCache->setHidden( true );
304-
#endif
305297

306298
//wms search server
307299
leWmsSearch->setText( settings.value( "/qgis/WMSSearchUrl", "http://geopole.org/wms/search?search=%1&type=rss" ).toString() );
@@ -1700,9 +1692,7 @@ void QgsOptions::on_mBrowseCacheDirectory_clicked()
17001692

17011693
void QgsOptions::on_mClearCache_clicked()
17021694
{
1703-
#if QT_VERSION >= 0x40500
17041695
QgsNetworkAccessManager::instance()->cache()->clear();
1705-
#endif
17061696
}
17071697

17081698
void QgsOptions::on_mOptionsStackedWidget_currentChanged( int theIndx )

‎src/core/composer/qgscomposermap.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,6 @@ void QgsComposerMap::drawCanvasItems( QPainter* painter, const QStyleOptionGraph
19741974
}
19751975
QGraphicsItem* currentItem = 0;
19761976

1977-
#if QT_VERSION >= 0x40600 //Qt 4.6 provides the items in visibility order
19781977
for ( int i = itemList.size() - 1; i >= 0; --i )
19791978
{
19801979
currentItem = itemList.at( i );
@@ -1985,42 +1984,6 @@ void QgsComposerMap::drawCanvasItems( QPainter* painter, const QStyleOptionGraph
19851984
}
19861985
drawCanvasItem( currentItem, painter, itemStyle );
19871986
}
1988-
#else //Qt <4.6 provides the items in random order
1989-
QMultiMap<int, QGraphicsItem*> topLevelItems;
1990-
QMultiMap<QGraphicsItem*, QGraphicsItem*> childItems; //QMultiMap<parentItem, childItem>
1991-
1992-
for ( int i = 0; i < itemList.size(); ++i )
1993-
{
1994-
currentItem = itemList.at( i );
1995-
//don't draw mapcanvasmap (has z value -10)
1996-
if ( !currentItem || currentItem->data( 0 ) != "AnnotationItem" )
1997-
{
1998-
continue;
1999-
}
2000-
if ( currentItem->parentItem() )
2001-
{
2002-
childItems.insert( currentItem->parentItem(), currentItem );
2003-
}
2004-
else
2005-
{
2006-
topLevelItems.insert( currentItem->zValue(), currentItem );
2007-
}
2008-
}
2009-
2010-
QMultiMap<int, QGraphicsItem*>::iterator topLevelIt = topLevelItems.begin();
2011-
for ( ; topLevelIt != topLevelItems.end(); ++topLevelIt )
2012-
{
2013-
drawCanvasItem( topLevelIt.value(), painter, itemStyle );
2014-
//Draw children. They probably should be sorted according to z-order, but we don't do it because this code is only
2015-
//there for backward compatibility. And currently, having several embedded children is not used in QGIS
2016-
QMap<QGraphicsItem*, QGraphicsItem*>::iterator childIt = childItems.find( topLevelIt.value() );
2017-
while ( childIt != childItems.end() && childIt.key() == topLevelIt.value() )
2018-
{
2019-
drawCanvasItem( childIt.value(), painter, itemStyle );
2020-
++childIt;
2021-
}
2022-
}
2023-
#endif
20241987
}
20251988

20261989
void QgsComposerMap::drawCanvasItem( QGraphicsItem* item, QPainter* painter, const QStyleOptionGraphicsItem* itemStyle )

‎src/core/qgsnetworkaccessmanager.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <QTimer>
2929
#include <QNetworkReply>
3030

31-
#if QT_VERSION >= 0x40500
3231
class QgsNetworkProxyFactory : public QNetworkProxyFactory
3332
{
3433
public:
@@ -70,7 +69,6 @@ class QgsNetworkProxyFactory : public QNetworkProxyFactory
7069
return QList<QNetworkProxy>() << nam->fallbackProxy();
7170
}
7271
};
73-
#endif
7472

7573
QgsNetworkAccessManager *QgsNetworkAccessManager::instance()
7674
{
@@ -82,16 +80,13 @@ QgsNetworkAccessManager *QgsNetworkAccessManager::instance()
8280
QgsNetworkAccessManager::QgsNetworkAccessManager( QObject *parent )
8381
: QNetworkAccessManager( parent )
8482
{
85-
#if QT_VERSION >= 0x40500
8683
setProxyFactory( new QgsNetworkProxyFactory() );
87-
#endif
8884
}
8985

9086
QgsNetworkAccessManager::~QgsNetworkAccessManager()
9187
{
9288
}
9389

94-
#if QT_VERSION >= 0x40500
9590
void QgsNetworkAccessManager::insertProxyFactory( QNetworkProxyFactory *factory )
9691
{
9792
mProxyFactories.insert( 0, factory );
@@ -106,7 +101,6 @@ const QList<QNetworkProxyFactory *> QgsNetworkAccessManager::proxyFactories() co
106101
{
107102
return mProxyFactories;
108103
}
109-
#endif
110104

111105
const QStringList &QgsNetworkAccessManager::excludeList() const
112106
{

0 commit comments

Comments
 (0)
Please sign in to comment.