set minimum Qt version to 4.7 and remove #ifdef code depending on prior versions

This commit is contained in:
Juergen E. Fischer 2013-11-30 10:52:15 +01:00
parent 9cc3c5cc76
commit 3e5ff1f9eb
30 changed files with 30 additions and 175 deletions

View File

@ -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

View File

@ -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

View File

@ -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 @@ label{ background-color: #FFFFCC;
<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 @@ Required build deps:
</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 @@ The following people have contributed to this document:
</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>

View File

@ -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

View File

@ -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 );

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 ) ) );
}
}

View File

@ -74,10 +74,7 @@
#include <QNetworkReply>
#include <QNetworkProxy>
#include <QAuthenticator>
#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
#endif
//
// Mac OS X Includes

View File

@ -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

View File

@ -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

View File

@ -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 )

View File

@ -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 )

View File

@ -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
{

View File

@ -55,7 +55,6 @@ class CORE_EXPORT QgsNetworkAccessManager : public QNetworkAccessManager
//! destructor
~QgsNetworkAccessManager();
#if QT_VERSION >= 0x40500
//! insert a factory into the proxy factories list
void insertProxyFactory( QNetworkProxyFactory *factory );
@ -64,7 +63,6 @@ class CORE_EXPORT QgsNetworkAccessManager : public QNetworkAccessManager
//! retrieve proxy factory list
const QList<QNetworkProxyFactory *> proxyFactories() const;
#endif
//! retrieve fall back proxy (for urls that no factory returned proxies for)
const QNetworkProxy &fallbackProxy() const;
@ -95,9 +93,7 @@ class CORE_EXPORT QgsNetworkAccessManager : public QNetworkAccessManager
private:
QgsNetworkAccessManager( QObject *parent = 0 );
#if QT_VERSION >= 0x40500
QList<QNetworkProxyFactory*> mProxyFactories;
#endif
QNetworkProxy mFallbackProxy;
QStringList mExcludedURLs;

View File

@ -38,9 +38,7 @@ void QgsPaintEngineHack::fixFlags()
// | QPaintEngine::PerspectiveTransform
| QPaintEngine::BlendModes
// | QPaintEngine::ObjectBoundingModeGradients
#if QT_VERSION >= 0x040500
| QPaintEngine::RasterOpModes
#endif
| QPaintEngine::PaintOutsidePaintEvent
);
}

View File

@ -273,11 +273,7 @@ void QgsGraduatedSymbolRendererV2::stopRender( QgsRenderContext& context )
it->symbol()->stopRender( context );
// cleanup mTempSymbols
#if QT_VERSION < 0x40600
QMap<QgsSymbolV2*, QgsSymbolV2*>::iterator it2 = mTempSymbols.begin();
#else
QHash<QgsSymbolV2*, QgsSymbolV2*>::iterator it2 = mTempSymbols.begin();
#endif
for ( ; it2 != mTempSymbols.end(); ++it2 )
{
it2.value()->stopRender( context );

View File

@ -184,11 +184,7 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2
int mRotationFieldIdx, mSizeScaleFieldIdx;
//! temporary symbols, used for data-defined rotation and scaling
#if QT_VERSION < 0x40600
QMap<QgsSymbolV2*, QgsSymbolV2*> mTempSymbols;
#else
QHash<QgsSymbolV2*, QgsSymbolV2*> mTempSymbols;
#endif
QgsSymbolV2* symbolForValue( double value );
};

View File

@ -70,7 +70,6 @@ void QgsColorButton::onButtonClicked()
{
//QgsDebugMsg( "entered" );
QColor newColor;
#if QT_VERSION >= 0x040500
QSettings settings;
if ( mAcceptLiveUpdates && settings.value( "/qgis/live_color_dialogs", false ).toBool() )
{
@ -82,9 +81,6 @@ void QgsColorButton::onButtonClicked()
{
newColor = QColorDialog::getColor( color(), this->parentWidget(), mColorDialogTitle, mColorDialogOptions );
}
#else
newColor = QColorDialog::getColor( color(), this->parentWidget() );
#endif
setValidColor( newColor );
// reactivate button's window

View File

@ -104,9 +104,7 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )
registerItem( specials[i]->group(), name, " " + name + " " );
}
#if QT_VERSION >= 0x040700
txtSearchEdit->setPlaceholderText( tr( "Search" ) );
#endif
}

View File

@ -6,11 +6,7 @@ QgsRelationAddDlg::QgsRelationAddDlg( QWidget *parent ) :
{
setupUi( this );
#if QT_VERSION >= 0x40700
mTxtRelationId->setPlaceholderText( tr( "[Generated automatically]" ) );
#else
mTxtRelationId->setToolTip( tr( "[Generated automatically]" ) );
#endif
}
void QgsRelationAddDlg::addLayers( QList< QgsVectorLayer* > layers )

View File

@ -207,7 +207,7 @@ void QgsPointDisplacementRendererWidget::on_mLabelFontButton_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, mRenderer->labelFont(), 0, tr( "Label Font" ), QFontDialog::DontUseNativeDialog );
#else

View File

@ -54,14 +54,8 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa
mSplitter->setSizes( QList<int>() << 170 << 540 );
mSplitter->restoreState( settings.value( "/Windows/StyleV2Manager/splitter" ).toByteArray() );
#if QT_VERSION >= 0x40500
tabItemType->setDocumentMode( true );
#endif
#if QT_VERSION >= 0x40700
searchBox->setPlaceholderText( tr( "Type here to filter symbols..." ) );
#else
searchBox->setToolTip( tr( "Type here to filter symbols..." ) );
#endif
// setup icons
btnAddItem->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.png" ) ) );

View File

@ -288,19 +288,9 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite
double key = item->data( 0, StopOffsetRole ).toDouble();
// allow for floating-point values
double val = key * 100;
#if QT_VERSION >= 0x40500
val = QInputDialog::getDouble( this, tr( "Offset of the stop" ),
tr( "Please enter offset in percents (%) of the new stop" ),
val, 0, 100, 2, &ok );
#else
QString res = QInputDialog::getText( this, tr( "Offset of the stop" ),
tr( "Please enter offset in percents (%) of the new stop" ),
QLineEdit::Normal, QString::number( val ), &ok );
if ( ok )
val = res.toDouble( &ok );
if ( ok )
ok = val >= 0 && val <= 100;
#endif
if ( !ok )
return;
@ -330,19 +320,9 @@ void QgsVectorGradientColorRampV2Dialog::addStop()
bool ok;
double val = 50.0;
#if QT_VERSION >= 0x40500
val = QInputDialog::getDouble( this, tr( "Offset of the stop" ),
tr( "Please enter offset in percents (%) of the new stop" ),
val, 0, 100, 2, &ok );
#else
QString res = QInputDialog::getText( this, tr( "Offset of the stop" ),
tr( "Please enter offset in percents (%) of the new stop" ),
QLineEdit::Normal, QString::number( val ), &ok );
if ( ok )
val = res.toDouble( &ok );
if ( ok )
ok = val >= 0 && val <= 100;
#endif
if ( !ok )
return;
activateWindow();

View File

@ -38,10 +38,7 @@
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkProxy>
#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
#endif
#include <QUrl>
#include <QIcon>

View File

@ -40,10 +40,7 @@
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkProxy>
#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
#endif
#include <QUrl>
#include <QRegExp>
@ -1516,12 +1513,10 @@ QString QgsWcsProvider::metadata()
metadata += "</a>";
#if 0
#if QT_VERSION >= 0x40500
// TODO
metadata += "<a href=\"#cachestats\">";
metadata += tr( "Cache Stats" );
metadata += "</a> ";
#endif
#endif
metadata += "</td></tr>";

View File

@ -47,15 +47,10 @@
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkProxy>
#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
#endif
#if QT_VERSION >= 0x40600
#include <QtXmlPatterns/QXmlSchema>
#include <QtXmlPatterns/QXmlSchemaValidator>
#endif
#include <QUrl>
#include <QIcon>
@ -1160,14 +1155,14 @@ void QgsWmsProvider::tileReplyFinished()
{
QNetworkReply *reply = qobject_cast<QNetworkReply*>( sender() );
#if defined(QGISDEBUG) && (QT_VERSION >= 0x40500)
#if defined(QGISDEBUG)
bool fromCache = reply->attribute( QNetworkRequest::SourceIsFromCacheAttribute ).toBool();
if ( fromCache )
mCacheHits++;
else
mCacheMisses++;
#endif
#if defined(QGISDEBUG) && (QT_VERSION >= 0x40700)
#if defined(QGISDEBUG)
QgsDebugMsgLevel( "raw headers:", 3 );
foreach ( const QNetworkReply::RawHeaderPair &pair, reply->rawHeaderPairs() )
{
@ -1206,7 +1201,6 @@ void QgsWmsProvider::tileReplyFinished()
#ifdef QGISDEBUG
int retry = reply->request().attribute( static_cast<QNetworkRequest::Attribute>( TileRetry ) ).toInt();
#if QT_VERSION >= 0x40500
QgsDebugMsg( QString( "tile reply %1 (%2) tile:%3(retry %4) rect:%5,%6 %7,%8) fromcache:%9 error:%10 url:%11" )
.arg( tileReqNo ).arg( mTileReqNo ).arg( tileNo ).arg( retry )
.arg( r.left(), 0, 'f' ).arg( r.bottom(), 0, 'f' ).arg( r.right(), 0, 'f' ).arg( r.top(), 0, 'f' )
@ -1214,14 +1208,6 @@ void QgsWmsProvider::tileReplyFinished()
.arg( reply->errorString() )
.arg( reply->url().toString() )
);
#else
QgsDebugMsg( QString( "tile reply %1 (%2) tile:%3(retry %4) rect:%5,%6 %7,%8) error:%9 url:%10" )
.arg( tileReqNo ).arg( mTileReqNo ).arg( tileNo ).arg( retry )
.arg( r.left(), 0, 'f' ).arg( r.bottom(), 0, 'f' ).arg( r.right(), 0, 'f' ).arg( r.top(), 0, 'f' )
.arg( reply->errorString() )
.arg( reply->url().toString() )
);
#endif
#endif
if ( reply->error() == QNetworkReply::NoError )
@ -3729,11 +3715,9 @@ QString QgsWmsProvider::metadata()
metadata += tr( "Tile Layer Properties" );
metadata += "</a> ";
#if QT_VERSION >= 0x40500
metadata += "<a href=\"#cachestats\">";
metadata += tr( "Cache Stats" );
metadata += "</a> ";
#endif
}
metadata += "</td></tr>";
@ -4044,7 +4028,6 @@ QString QgsWmsProvider::metadata()
metadata += "</table></td></tr>";
#if QT_VERSION >= 0x40500
if ( mTiled )
{
metadata += "<tr><th class=\"glossy\"><a name=\"cachestats\"></a>";
@ -4082,7 +4065,6 @@ QString QgsWmsProvider::metadata()
metadata += "</table></td></tr>";
}
#endif
}
metadata += "</table>";
@ -4400,7 +4382,6 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs
if ( xsdPart >= 0 ) // XSD available
{
#if QT_VERSION >= 0x40600
#if 0
// Validate GML by schema
// Loading schema takes ages! It needs to load all XSD referenced in the schema,
@ -4430,7 +4411,6 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs
results.insert( count, tr( "GML is not valid" ) );
continue;
}
#endif
#endif
QgsDebugMsg( "GML XSD (first 4000 bytes):\n" + QString::fromUtf8( mIdentifyResultBodies.value( xsdPart ).left( 4000 ) ) );
gmlSchema.parseXSD( mIdentifyResultBodies.value( xsdPart ) );