Skip to content
Permalink
Browse files

set minimum Qt version to 4.7 and remove #ifdef code depending on pri…

…or versions
  • Loading branch information
jef-n committed Nov 30, 2013
1 parent 9cc3c5c commit 3e5ff1f9eb06572c48d6a4bfaa3dfc8059e6379d
@@ -219,7 +219,7 @@ SET (HAVE_MSSQL TRUE)

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

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

IF (WITH_TOUCH)
# following variable is used in qgsconfig.h
@@ -1,10 +1,10 @@
QGIS
Building QGIS from source - step by step
Thursday November 21, 2013
Saturday November 30, 2013


Last Updated: Thursday November 21, 2013
Last Change : Thursday November 21, 2013
Last Updated: Saturday November 30, 2013
Last Change : Saturday November 30, 2013


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

Required build deps:

- Qt >= 4.5.0
- Qt >= 4.7.0
- Proj >= 4.4.x
- GEOS >= 3.0
- Sqlite3 >= 3.0.0
@@ -5,7 +5,7 @@
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>QGIS</TITLE>

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

<DIV CLASS="body" ID="body">
<P>
Last Updated: Thursday November 21, 2013
Last Change : Thursday November 21, 2013
Last Updated: Saturday November 30, 2013
Last Change : Saturday November 30, 2013
</P>
<DIV CLASS="toc">

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

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

</DIV>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -o/home/fischer/src/qgis/debian/build/doc/INSTALL.html -t html /home/fischer/src/qgis/doc/INSTALL.t2t -->
<!-- cmdline: txt2tags -o/home/fischer/src/qgis/qgis/debian/build/doc/INSTALL.html -t html /home/fischer/src/qgis/qgis/doc/INSTALL.t2t -->
</BODY></HTML>
@@ -15,7 +15,7 @@ Required build tools:

Required build deps:

- Qt >= 4.5.0
- Qt >= 4.7.0
- Proj >= 4.4.x
- GEOS >= 3.0
- Sqlite3 >= 3.0.0
@@ -1509,9 +1509,7 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
for ( int i = 0; i < mComposition->numPages(); ++i )
{
QSvgGenerator generator;
#if QT_VERSION >= 0x040500
generator.setTitle( QgsProject::instance()->title() );
#endif
if ( i == 0 )
{
generator.setFileName( outputFileName );
@@ -1527,9 +1525,7 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
//height in pixel
int height = ( int )( mComposition->paperHeight() * mComposition->printResolution() / 25.4 );
generator.setSize( QSize( width, height ) );
#if QT_VERSION >= 0x040500
generator.setViewBox( QRect( 0, 0, width, height ) );
#endif
generator.setResolution( mComposition->printResolution() ); //because the rendering is done in mm, convert the dpi

QPainter p( &generator );
@@ -86,7 +86,7 @@ void QgsComposerLabelWidget::on_mFontButton_clicked()
if ( mComposerLabel )
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
@@ -373,7 +373,7 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Title ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
@@ -395,7 +395,7 @@ void QgsComposerLegendWidget::on_mGroupFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Group ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
@@ -417,7 +417,7 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Subgroup ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
@@ -439,7 +439,7 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::SymbolLabel ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
@@ -751,7 +751,7 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerMap->gridAnnotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
@@ -282,7 +282,7 @@ void QgsComposerScaleBarWidget::on_mFontButton_clicked()

bool dialogAccepted;
QFont oldFont = mComposerScaleBar->font();
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &dialogAccepted, oldFont, 0, QString(), QFontDialog::DontUseNativeDialog );
#else
@@ -217,7 +217,7 @@ void QgsComposerTableWidget::on_mHeaderFontPushButton_clicked()
}

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

bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
#else
@@ -215,9 +215,7 @@ void QgsLegendLayer::rasterLayerSymbology( QgsRasterLayer* layer )
SymbologyList itemList;
QList< QPair< QString, QColor > > rasterItemList = layer->legendSymbologyItems();
QList< QPair< QString, QColor > >::const_iterator itemIt = rasterItemList.constBegin();
#if QT_VERSION >= 0x40700
itemList.reserve( rasterItemList.size() );
#endif

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

#if QT_VERSION >= 0x40700
if ( rasterItemList.size() == 0 ) itemList.reserve( 1 );
#endif
if ( rasterItemList.size() == 0 )
itemList.reserve( 1 );
itemList.append( qMakePair( QString( "" ), QPixmap::fromImage( legendGraphic ) ) );
}
}
@@ -74,10 +74,7 @@
#include <QNetworkReply>
#include <QNetworkProxy>
#include <QAuthenticator>

#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
#endif

//
// Mac OS X Includes
@@ -275,7 +275,7 @@ void QgsDecorationGridDialog::on_mPbtnUpdateFromLayer_clicked()
void QgsDecorationGridDialog::on_mAnnotationFontButton_clicked()
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mDeco.gridAnnotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
@@ -280,7 +280,7 @@ void QgsLabelDialog::changeFont( void )

qreal fontSize = mFont.pointSizeF();
bool resultFlag;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
mFont = QFontDialog::getFont( &resultFlag, mFont, 0, QString(), QFontDialog::DontUseNativeDialog );
#else
@@ -48,10 +48,7 @@
#include <QSize>
#include <QStyleFactory>
#include <QMessageBox>

#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
#endif

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

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

//wms search server
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()

void QgsOptions::on_mClearCache_clicked()
{
#if QT_VERSION >= 0x40500
QgsNetworkAccessManager::instance()->cache()->clear();
#endif
}

void QgsOptions::on_mOptionsStackedWidget_currentChanged( int theIndx )
@@ -1974,7 +1974,6 @@ void QgsComposerMap::drawCanvasItems( QPainter* painter, const QStyleOptionGraph
}
QGraphicsItem* currentItem = 0;

#if QT_VERSION >= 0x40600 //Qt 4.6 provides the items in visibility order
for ( int i = itemList.size() - 1; i >= 0; --i )
{
currentItem = itemList.at( i );
@@ -1985,42 +1984,6 @@ void QgsComposerMap::drawCanvasItems( QPainter* painter, const QStyleOptionGraph
}
drawCanvasItem( currentItem, painter, itemStyle );
}
#else //Qt <4.6 provides the items in random order
QMultiMap<int, QGraphicsItem*> topLevelItems;
QMultiMap<QGraphicsItem*, QGraphicsItem*> childItems; //QMultiMap<parentItem, childItem>

for ( int i = 0; i < itemList.size(); ++i )
{
currentItem = itemList.at( i );
//don't draw mapcanvasmap (has z value -10)
if ( !currentItem || currentItem->data( 0 ) != "AnnotationItem" )
{
continue;
}
if ( currentItem->parentItem() )
{
childItems.insert( currentItem->parentItem(), currentItem );
}
else
{
topLevelItems.insert( currentItem->zValue(), currentItem );
}
}

QMultiMap<int, QGraphicsItem*>::iterator topLevelIt = topLevelItems.begin();
for ( ; topLevelIt != topLevelItems.end(); ++topLevelIt )
{
drawCanvasItem( topLevelIt.value(), painter, itemStyle );
//Draw children. They probably should be sorted according to z-order, but we don't do it because this code is only
//there for backward compatibility. And currently, having several embedded children is not used in QGIS
QMap<QGraphicsItem*, QGraphicsItem*>::iterator childIt = childItems.find( topLevelIt.value() );
while ( childIt != childItems.end() && childIt.key() == topLevelIt.value() )
{
drawCanvasItem( childIt.value(), painter, itemStyle );
++childIt;
}
}
#endif
}

void QgsComposerMap::drawCanvasItem( QGraphicsItem* item, QPainter* painter, const QStyleOptionGraphicsItem* itemStyle )
@@ -28,7 +28,6 @@
#include <QTimer>
#include <QNetworkReply>

#if QT_VERSION >= 0x40500
class QgsNetworkProxyFactory : public QNetworkProxyFactory
{
public:
@@ -70,7 +69,6 @@ class QgsNetworkProxyFactory : public QNetworkProxyFactory
return QList<QNetworkProxy>() << nam->fallbackProxy();
}
};
#endif

QgsNetworkAccessManager *QgsNetworkAccessManager::instance()
{
@@ -82,16 +80,13 @@ QgsNetworkAccessManager *QgsNetworkAccessManager::instance()
QgsNetworkAccessManager::QgsNetworkAccessManager( QObject *parent )
: QNetworkAccessManager( parent )
{
#if QT_VERSION >= 0x40500
setProxyFactory( new QgsNetworkProxyFactory() );
#endif
}

QgsNetworkAccessManager::~QgsNetworkAccessManager()
{
}

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

const QStringList &QgsNetworkAccessManager::excludeList() const
{

0 comments on commit 3e5ff1f

Please sign in to comment.
You can’t perform that action at this time.