Skip to content

Commit 26e23b6

Browse files
author
jef
committed
remove #ifdefs related to no longer supported Qt versions
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13042 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e6002ec commit 26e23b6

15 files changed

+5
-132
lines changed

src/app/composer/qgscomposer.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@
5959
#include <QSettings>
6060
#include <QIcon>
6161
#include <QPixmap>
62-
#if QT_VERSION < 0x040300
63-
#include <Q3Picture>
64-
#else
6562
#include <QSvgGenerator>
66-
#endif
6763
#include <QToolBar>
6864
#include <QToolButton>
6965
#include <QImageWriter>
@@ -554,16 +550,10 @@ void QgsComposer::print( QPrinter &printer )
554550
}
555551
else
556552
{
557-
#if QT_VERSION < 0x040400
558-
QRectF paperRect( 0, 0, mComposition->paperWidth(), mComposition->paperHeight() );
559-
QRect pageRect = printer.pageRect();
560-
mComposition->render( &p, pageRect, paperRect );
561-
#else
562553
//better in case of custom page size, but only possible with Qt>=4.4.0
563554
QRectF paperRectMM = printer.pageRect( QPrinter::Millimeter );
564555
QRectF paperRectPixel = printer.pageRect( QPrinter::DevicePixel );
565556
mComposition->render( &p, paperRectPixel, paperRectMM );
566-
#endif
567557
}
568558
mComposition->setPlotStyle( savedPlotStyle );
569559
QApplication::restoreOverrideCursor();

src/app/main.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -555,15 +555,8 @@ int main( int argc, char *argv[] )
555555
}
556556
else
557557
{
558-
#if defined(Q_OS_MACX) && QT_VERSION < 0x040300
559-
//on mac automasking as done below does not work (as of qt 4.2.1)
560-
//so we do it the old way see bug #387
561-
QPixmap myMaskPixmap( mySplashPath + QString( "splash_mask.png" ), 0, Qt::ThresholdDither | Qt::ThresholdAlphaDither | Qt::AvoidDither );
562-
mypSplash->setMask( myMaskPixmap.createHeuristicMask() );
563-
#else
564558
//for win and linux we can just automask and png transparency areas will be used
565559
mypSplash->setMask( myPixmap.mask() );
566-
#endif
567560
mypSplash->show();
568561
}
569562

src/app/qgsattributeactiondialog.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ QgsAttributeActionDialog::QgsAttributeActionDialog( QgsAttributeAction* actions,
4040
header->setStretchLastSection( true );
4141
attributeActionTable->setColumnWidth( 0, 100 );
4242
attributeActionTable->setColumnWidth( 1, 230 );
43-
#if QT_VERSION >= 0x040300
4443
attributeActionTable->setCornerButtonEnabled( false );
45-
#endif
4644

4745
connect( attributeActionTable, SIGNAL( itemSelectionChanged() ),
4846
this, SLOT( itemSelectionChanged() ) );
@@ -271,16 +269,6 @@ void QgsAttributeActionDialog::itemSelectionChanged()
271269
QList<QTableWidgetItem *> selection = attributeActionTable->selectedItems();
272270
if ( !selection.isEmpty() )
273271
{
274-
#if QT_VERSION < 0x040400
275-
// Supress multiple selection and select row where mouse release occurs.
276-
// Workaround for Qt 4.3 bug which allows multiple rows to be selected if
277-
// the user presses the mouse in one row header and releases in another.
278-
if ( attributeActionTable->row( selection.first() ) != attributeActionTable->row( selection.last() ) )
279-
{
280-
attributeActionTable->selectRow( attributeActionTable->currentRow() );
281-
selection = attributeActionTable->selectedItems();
282-
}
283-
#endif
284272
rowSelected( attributeActionTable->row( selection.first() ) );
285273
}
286274
}

src/app/qgsquerybuilder.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
#include "qgsvectorlayer.h"
2424
#include "qgsvectordataprovider.h"
2525

26-
#if QT_VERSION < 0x040300
27-
#define toPlainText() text()
28-
#endif
29-
30-
3126
// constructor used when the query builder must make its own
3227
// connection to the database
3328
QgsQueryBuilder::QgsQueryBuilder( QgsVectorLayer *layer,

src/app/qgssearchquerybuilder.cpp

+3-23
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@
2626
#include "qgsvectorlayer.h"
2727
#include "qgslogger.h"
2828

29-
#if QT_VERSION < 0x040300
30-
#define toPlainText() text()
31-
#endif
32-
33-
3429
QgsSearchQueryBuilder::QgsSearchQueryBuilder( QgsVectorLayer* layer,
3530
QWidget *parent, Qt::WFlags fl )
3631
: QDialog( parent, fl ), mLayer( layer )
@@ -49,9 +44,9 @@ QgsSearchQueryBuilder::QgsSearchQueryBuilder( QgsVectorLayer* layer,
4944
connect( pbn, SIGNAL( clicked() ), this, SLOT( on_btnClear_clicked() ) );
5045

5146
// disable unsupported operators
52-
btnIn->setEnabled( false );
53-
btnNotIn->setEnabled( false );
54-
btnPct->setEnabled( false );
47+
btnIn->setHidden( true );
48+
btnNotIn->setHidden( true );
49+
btnPct->setHidden( true );
5550

5651
// change to ~
5752
btnILike->setText( "~" );
@@ -264,21 +259,6 @@ void QgsSearchQueryBuilder::on_btnGreaterThan_clicked()
264259
txtSQL->insertPlainText( " > " );
265260
}
266261

267-
void QgsSearchQueryBuilder::on_btnPct_clicked()
268-
{
269-
txtSQL->insertPlainText( " % " );
270-
}
271-
272-
void QgsSearchQueryBuilder::on_btnIn_clicked()
273-
{
274-
txtSQL->insertPlainText( " IN " );
275-
}
276-
277-
void QgsSearchQueryBuilder::on_btnNotIn_clicked()
278-
{
279-
txtSQL->insertPlainText( " NOT IN " );
280-
}
281-
282262
void QgsSearchQueryBuilder::on_btnLike_clicked()
283263
{
284264
txtSQL->insertPlainText( " LIKE " );

src/app/qgssearchquerybuilder.h

-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ class QgsSearchQueryBuilder : public QDialog, private Ui::QgsQueryBuilderBase
5555
void on_btnOk_clicked();
5656
void on_btnLessThan_clicked();
5757
void on_btnGreaterThan_clicked();
58-
void on_btnPct_clicked();
59-
void on_btnIn_clicked();
60-
void on_btnNotIn_clicked();
6158
void on_btnLike_clicked();
6259
void on_btnILike_clicked();
6360

src/app/qgsvectorlayerproperties.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@
5959
#include "qgsstylev2.h"
6060
#include "qgssymbologyv2conversion.h"
6161

62-
#if QT_VERSION < 0x040300
63-
#define toPlainText() text()
64-
#endif
65-
6662

6763
QgsVectorLayerProperties::QgsVectorLayerProperties(
6864
QgsVectorLayer *lyr,

src/core/qgshttptransaction.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,6 @@ bool QgsHttpTransaction::applyProxySettings( QHttp& http, const QString& url )
532532
{
533533
proxyType = QNetworkProxy::HttpProxy;
534534
}
535-
#if QT_VERSION >= 0x040400
536535
else if ( proxyTypeString == "HttpCachingProxy" )
537536
{
538537
proxyType = QNetworkProxy::HttpCachingProxy;
@@ -541,7 +540,6 @@ bool QgsHttpTransaction::applyProxySettings( QHttp& http, const QString& url )
541540
{
542541
proxyType = QNetworkProxy::FtpCachingProxy;
543542
}
544-
#endif
545543
http.setProxy( QNetworkProxy( proxyType, proxyHost, proxyPort, proxyUser, proxyPassword ) );
546544
return true;
547545
}

src/gui/qgisgui.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ namespace QgisGui
4444
* Qt::WindowMaximizeButtonHint is included but will be ignored if
4545
* the dialog is a fixed size and does not have a size grip.
4646
*/
47-
static const Qt::WFlags ModalDialogFlags =
48-
#if QT_VERSION < 0x040200
49-
Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMaximizeButtonHint;
50-
#else
51-
0;
52-
#endif
47+
static const Qt::WFlags ModalDialogFlags = 0;
5348

5449
/**
5550
Open files, preferring to have the default file selector be the

src/gui/qgsattributeeditor.cpp

-32
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@
3232
#include <QSpinBox>
3333
#include <QCompleter>
3434
#include <QHBoxLayout>
35-
36-
#if QT_VERSION >= 0x040400
3735
#include <QPlainTextEdit>
38-
#endif
3936

4037
void QgsAttributeEditor::selectFileName( void )
4138
{
@@ -274,26 +271,17 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
274271
{
275272
QLineEdit *le = NULL;
276273
QTextEdit *te = NULL;
277-
#if QT_VERSION >= 0x040400
278274
QPlainTextEdit *pte = NULL;
279-
#endif
280275

281276
if ( editor )
282277
{
283278
le = qobject_cast<QLineEdit *>( editor );
284279
te = qobject_cast<QTextEdit *>( editor );
285-
#if QT_VERSION >= 0x040400
286280
pte = qobject_cast<QPlainTextEdit *>( editor );
287-
#endif
288281
}
289282
else if ( editType == QgsVectorLayer::TextEdit )
290283
{
291-
#if QT_VERSION >= 0x040400
292284
pte = new QPlainTextEdit( parent );
293-
#else
294-
te = new QTextEdit( parent );
295-
te->setAcceptRichText( false );
296-
#endif
297285
}
298286
else
299287
{
@@ -331,18 +319,14 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
331319

332320
if ( te )
333321
{
334-
#if QT_VERSION >= 0x040400
335322
te->setAcceptRichText( true );
336-
#endif
337323
myWidget = te;
338324
}
339325

340-
#if QT_VERSION >= 0x040400
341326
if ( pte )
342327
{
343328
myWidget = pte;
344329
}
345-
#endif
346330
}
347331
break;
348332

@@ -424,19 +408,14 @@ bool QgsAttributeEditor::retrieveValue( QWidget *widget, QgsVectorLayer *vl, int
424408
QTextEdit *te = qobject_cast<QTextEdit *>( widget );
425409
if ( te )
426410
{
427-
#if QT_VERSION >= 0x040400
428411
text = te->toHtml();
429-
#else
430-
text = te->toPlainText();
431-
#endif
432412
modified = te->document()->isModified();
433413
if ( text == "NULL" )
434414
{
435415
text = QString::null;
436416
}
437417
}
438418

439-
#if QT_VERSION >= 0x040400
440419
QPlainTextEdit *pte = qobject_cast<QPlainTextEdit *>( widget );
441420
if ( pte )
442421
{
@@ -447,7 +426,6 @@ bool QgsAttributeEditor::retrieveValue( QWidget *widget, QgsVectorLayer *vl, int
447426
text = QString::null;
448427
}
449428
}
450-
#endif
451429

452430
QComboBox *cb = qobject_cast<QComboBox *>( widget );
453431
if ( cb )
@@ -614,14 +592,9 @@ bool QgsAttributeEditor::setValue( QWidget *editor, QgsVectorLayer *vl, int idx,
614592
{
615593
QLineEdit *le = qobject_cast<QLineEdit *>( editor );
616594
QTextEdit *te = qobject_cast<QTextEdit *>( editor );
617-
#if QT_VERSION >= 0x040400
618595
QPlainTextEdit *pte = qobject_cast<QPlainTextEdit *>( editor );
619596
if ( !le && !te && !pte )
620597
return false;
621-
#else
622-
if ( !le && !te )
623-
return false;
624-
#endif
625598

626599
QString text;
627600
if ( value.isNull() )
@@ -634,15 +607,10 @@ bool QgsAttributeEditor::setValue( QWidget *editor, QgsVectorLayer *vl, int idx,
634607

635608
if ( le )
636609
le->setText( text );
637-
#if QT_VERSION >= 0x040400
638610
if ( te )
639611
te->setHtml( text );
640612
if ( pte )
641613
pte->setPlainText( text );
642-
#else
643-
if ( te )
644-
te->setPlainText( text );
645-
#endif
646614
}
647615
break;
648616

src/gui/qgscolorbutton.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ QgsColorButtonV2::QgsColorButtonV2( QWidget* parent )
7676
}
7777

7878
QgsColorButtonV2::QgsColorButtonV2( QString text, QWidget* parent )
79-
: QPushButton( text, parent )
79+
: QPushButton( text, parent )
8080
{
8181
}
8282

@@ -95,11 +95,7 @@ void QgsColorButtonV2::setColor( const QColor &color )
9595
p.setPen( Qt::NoPen );
9696
p.setRenderHint( QPainter::Antialiasing );
9797
p.setBrush( color );
98-
#if QT_VERSION >= 0x040400
9998
p.drawRoundedRect( rect, 4, 4 );
100-
#else
101-
p.drawRect( rect );
102-
#endif
10399
p.end();
104100

105101
// set this pixmap as icon

src/plugins/copyright_label/plugingui.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ void QgsCopyrightLabelPluginGui::on_buttonBox_accepted()
3636
hide();
3737
//close the dialog
3838
emit changeFont( txtCopyrightText->currentFont() );
39-
#if QT_VERSION < 0x040300
40-
emit changeLabel( txtCopyrightText->text() );
41-
#else
4239
emit changeLabel( txtCopyrightText->toPlainText() );
43-
#endif
4440
emit changeColor( pbnColorChooser->color() );
4541
emit changePlacement( cboPlacement->currentIndex() );
4642
emit enableCopyrightLabel( cboxEnabled->isChecked() );

src/plugins/grass/qgsgrassnewmapset.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,6 @@ QgsGrassNewMapset::QgsGrassNewMapset( QgisInterface *iface,
6060
QgsDebugMsg( "QgsGrassNewMapset()" );
6161

6262
setupUi( this );
63-
#if QT_VERSION < 0x040400
64-
// this is not done by Qt4.3 uic
65-
addPage( WizardPage1 );
66-
addPage( WizardPage2 );
67-
addPage( WizardPage3 );
68-
addPage( WizardPage4 );
69-
addPage( WizardPage5 );
70-
addPage( WizardPage6 );
71-
#endif
7263
#ifdef Q_WS_MAC
7364
setWizardStyle( QWizard::ClassicStyle );
7465
#endif

src/plugins/grass/qtermwidget/KeyboardTranslator.h

-5
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ class CleanUpGlobalStatic
5353

5454
# define K_GLOBAL_STATIC_STRUCT_NAME(NAME)
5555

56-
#if QT_VERSION < 0x040400
57-
# define Q_BASIC_ATOMIC_INITIALIZER Q_ATOMIC_INIT
58-
# define testAndSetOrdered testAndSet
59-
#endif
60-
6156
#define K_GLOBAL_STATIC(TYPE, NAME) K_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ())
6257

6358
#define K_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \

src/plugins/quick_print/quickprintgui.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
#include <QSettings>
2222
#include <QPrinter>
2323

24-
#if QT_VERSION < 0x040300
25-
#define toPlainText() text()
26-
#endif
27-
28-
2924
//standard includes
3025

3126
QuickPrintGui::QuickPrintGui( QgsMapCanvas * thepMapCanvas,

0 commit comments

Comments
 (0)