Skip to content

Commit d5d4a5a

Browse files
committedDec 23, 2014
Q_WS_* macros removed from Qt5, to determine platform use Q_OS_* macroses which exists in Qt4 and Qt5
1 parent a4aaff5 commit d5d4a5a

40 files changed

+86
-86
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
195195

196196
mActionAtlasPreview->setCheckable( true );
197197

198-
#ifdef Q_WS_MAC
198+
#ifdef Q_OS_MAC
199199
mActionQuit->setText( tr( "Close" ) );
200200
mActionQuit->setShortcut( QKeySequence::Close );
201201
QMenu *appMenu = menuBar()->addMenu( tr( "QGIS" ) );
@@ -307,7 +307,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
307307
QShortcut* ctrlEquals = new QShortcut( QKeySequence( "Ctrl+=" ), this );
308308
connect( ctrlEquals, SIGNAL( activated() ), mActionZoomIn, SLOT( trigger() ) );
309309

310-
#ifndef Q_WS_MAC
310+
#ifndef Q_OS_MAC
311311
//disabled for OSX - see #10761
312312
//also see http://qt-project.org/forums/viewthread/3630 QGraphicsEffects are not well supported on OSX
313313
QMenu *previewMenu = viewMenu->addMenu( "&Preview" );
@@ -404,7 +404,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
404404
QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ) );
405405
settingsMenu->addAction( mActionOptions );
406406

407-
#ifdef Q_WS_MAC
407+
#ifdef Q_OS_MAC
408408
// this doesn't work on Mac anymore: menuBar()->addMenu( mQgis->windowMenu() );
409409
// QgsComposer::populateWithOtherMenu should work recursively with submenus and regardless of Qt version
410410
mWindowMenu = new QMenu( tr( "Window" ), this );
@@ -802,7 +802,7 @@ void QgsComposer::activate()
802802
}
803803
}
804804

805-
#ifdef Q_WS_MAC
805+
#ifdef Q_OS_MAC
806806
void QgsComposer::changeEvent( QEvent* event )
807807
{
808808
QMainWindow::changeEvent( event );
@@ -2950,7 +2950,7 @@ void QgsComposer::showEvent( QShowEvent* event )
29502950
restoreComposerMapStates();
29512951
}
29522952

2953-
#ifdef Q_WS_MAC
2953+
#ifdef Q_OS_MAC
29542954
// add to menu if (re)opening window (event not due to unminimize)
29552955
if ( !event->spontaneous() )
29562956
{

‎src/app/composer/qgscomposer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
114114

115115
virtual void showEvent( QShowEvent* event );
116116

117-
#ifdef Q_WS_MAC
117+
#ifdef Q_OS_MAC
118118
//! Change event (update window menu on ActivationChange)
119119
virtual void changeEvent( QEvent * );
120120
#endif

‎src/app/composer/qgscomposerattributetablewidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ void QgsComposerAttributeTableWidget::on_mHeaderFontPushButton_clicked()
288288
}
289289

290290
bool ok;
291-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
291+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
292292
// Native Mac dialog works only for Qt Carbon
293293
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
294294
#else
@@ -336,7 +336,7 @@ void QgsComposerAttributeTableWidget::on_mContentFontPushButton_clicked()
336336
}
337337

338338
bool ok;
339-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
339+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
340340
// Native Mac dialog works only for Qt Carbon
341341
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
342342
#else

‎src/app/composer/qgscomposerlabelwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void QgsComposerLabelWidget::on_mFontButton_clicked()
9191
if ( mComposerLabel )
9292
{
9393
bool ok;
94-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
94+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
9595
// Native Mac dialog works only for Qt Carbon
9696
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), 0, QString(), QFontDialog::DontUseNativeDialog );
9797
#else

‎src/app/composer/qgscomposerlegendwidget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
368368
if ( mLegend )
369369
{
370370
bool ok;
371-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
371+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
372372
// Native Mac dialog works only for Qt Carbon
373373
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Title ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
374374
#else
@@ -390,7 +390,7 @@ void QgsComposerLegendWidget::on_mGroupFontButton_clicked()
390390
if ( mLegend )
391391
{
392392
bool ok;
393-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
393+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
394394
// Native Mac dialog works only for Qt Carbon
395395
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Group ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
396396
#else
@@ -412,7 +412,7 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
412412
if ( mLegend )
413413
{
414414
bool ok;
415-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
415+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
416416
// Native Mac dialog works only for Qt Carbon
417417
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Subgroup ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
418418
#else
@@ -434,7 +434,7 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
434434
if ( mLegend )
435435
{
436436
bool ok;
437-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
437+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
438438
// Native Mac dialog works only for Qt Carbon
439439
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::SymbolLabel ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
440440
#else

‎src/app/composer/qgscomposermanager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ QgsComposerManager::QgsComposerManager( QWidget * parent, Qt::WindowFlags f ): Q
6363
mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
6464
connect( pb, SIGNAL( clicked() ), this, SLOT( rename_clicked() ) );
6565

66-
#ifdef Q_WS_MAC
66+
#ifdef Q_OS_MAC
6767
// Create action to select this window
6868
mWindowAction = new QAction( windowTitle(), this );
6969
connect( mWindowAction, SIGNAL( triggered() ), this, SLOT( activate() ) );
@@ -285,7 +285,7 @@ void QgsComposerManager::openLocalDirectory( const QString& localDirPath )
285285
QDesktopServices::openUrl( QUrl::fromLocalFile( localDirPath ) );
286286
}
287287

288-
#ifdef Q_WS_MAC
288+
#ifdef Q_OS_MAC
289289
void QgsComposerManager::showEvent( QShowEvent* event )
290290
{
291291
if ( !event->spontaneous() )

‎src/app/composer/qgscomposermanager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class QgsComposerManager: public QDialog, private Ui::QgsComposerManagerBase
7373
QString mDefaultTemplatesDir;
7474
QString mUserTemplatesDir;
7575

76-
#ifdef Q_WS_MAC
76+
#ifdef Q_OS_MAC
7777
void showEvent( QShowEvent *event );
7878
void changeEvent( QEvent * );
7979

‎src/app/composer/qgscomposermapwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
20552055
}
20562056

20572057
bool ok;
2058-
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
2058+
#if defined(Q_OS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
20592059
// Native Mac dialog works only for Qt Carbon
20602060
QFont newFont = QFontDialog::getFont( &ok, grid->annotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
20612061
#else

‎src/app/composer/qgscomposerscalebarwidget.cpp

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

312312
bool dialogAccepted;
313313
QFont oldFont = mComposerScaleBar->font();
314-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
314+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
315315
// Native Mac dialog works only for Qt Carbon
316316
QFont newFont = QFontDialog::getFont( &dialogAccepted, oldFont, 0, QString(), QFontDialog::DontUseNativeDialog );
317317
#else

‎src/app/composer/qgscomposertablewidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ void QgsComposerTableWidget::on_mHeaderFontPushButton_clicked()
215215
}
216216

217217
bool ok;
218-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
218+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
219219
// Native Mac dialog works only for Qt Carbon
220220
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
221221
#else
@@ -250,7 +250,7 @@ void QgsComposerTableWidget::on_mContentFontPushButton_clicked()
250250
}
251251

252252
bool ok;
253-
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
253+
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
254254
// Native Mac dialog works only for Qt Carbon
255255
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
256256
#else

‎src/app/gps/qwtpolar-1.0/qwt_polar_global.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define QWT_POLAR_VERSION 0x010000
1717
#define QWT_POLAR_VERSION_STR "1.0.0"
1818

19-
#if defined(Q_WS_WIN) || defined(Q_WS_S60)
19+
#if defined(Q_OS_WIN) || defined(Q_WS_S60)
2020

2121
#if defined(_MSC_VER) /* MSVC Compiler */
2222
/* template-class specialization 'identifier' is already instantiated */
@@ -34,7 +34,7 @@
3434

3535
#endif // QWT_POLAR_MAKEDLL
3636

37-
#endif // Q_WS_WIN
37+
#endif // Q_OS_WIN
3838

3939
#ifndef QWT_POLAR_EXPORT
4040
#define QWT_POLAR_EXPORT

‎src/app/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ int main( int argc, char *argv[] )
631631
QgsApplication myApp( argc, argv, myUseGuiFlag, configpath );
632632

633633
// (if Windows/Mac, use icon from resource)
634-
#if !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
634+
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
635635
myApp.setWindowIcon( QIcon( QgsApplication::iconsPath() + "qgis-icon-60x60.png" ) );
636636
#endif
637637

@@ -727,15 +727,15 @@ int main( int argc, char *argv[] )
727727

728728
if ( systemEnvVars.contains( envVarName ) && envVarApply == "unset" )
729729
{
730-
#ifdef Q_WS_WIN
730+
#ifdef Q_OS_WIN
731731
putenv( envVarName.toUtf8().constData() );
732732
#else
733733
unsetenv( envVarName.toUtf8().constData() );
734734
#endif
735735
}
736736
else
737737
{
738-
#ifdef Q_WS_WIN
738+
#ifdef Q_OS_WIN
739739
if ( envVarApply != "undefined" || !getenv( envVarName.toUtf8().constData() ) )
740740
putenv( QString( "%1=%2" ).arg( envVarName ).arg( envVarValue ).toUtf8().constData() );
741741
#else
@@ -755,7 +755,7 @@ int main( int argc, char *argv[] )
755755
QString style = mySettings.value( "/qgis/style" ).toString();
756756
if ( !style.isNull() )
757757
QApplication::setStyle( style );
758-
#ifdef Q_WS_WIN
758+
#ifdef Q_OS_WIN
759759
#if QT_VERSION < 0x050000
760760
else
761761
QApplication::setStyle( new QPlastiqueStyle );
@@ -828,7 +828,7 @@ int main( int argc, char *argv[] )
828828
// we need to be sure we can find the qt image
829829
// plugins. In mac be sure to look in the
830830
// application bundle...
831-
#ifdef Q_WS_WIN
831+
#ifdef Q_OS_WIN
832832
QCoreApplication::addLibraryPath( QApplication::applicationDirPath()
833833
+ QDir::separator() + "qtplugins" );
834834
#endif
@@ -967,7 +967,7 @@ int main( int argc, char *argv[] )
967967

968968
if ( !pythonfile.isEmpty() )
969969
{
970-
#ifdef Q_WS_WIN
970+
#ifdef Q_OS_WIN
971971
//replace backslashes with forward slashes
972972
pythonfile.replace( "\\", "/" );
973973
#endif

‎src/app/qgisapp.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
664664
connect( mInternalClipboard, SIGNAL( changed() ), this, SLOT( clipboardChanged() ) );
665665
mQgisInterface = new QgisAppInterface( this ); // create the interfce
666666

667-
#ifdef Q_WS_MAC
667+
#ifdef Q_OS_MAC
668668
// action for Window menu (create before generating WindowTitleChange event))
669669
mWindowAction = new QAction( this );
670670
connect( mWindowAction, SIGNAL( triggered() ), this, SLOT( activate() ) );
@@ -1172,7 +1172,7 @@ void QgisApp::createActions()
11721172
connect( mActionStyleManagerV2, SIGNAL( triggered() ), this, SLOT( showStyleManagerV2() ) );
11731173
connect( mActionCustomization, SIGNAL( triggered() ), this, SLOT( customize() ) );
11741174

1175-
#ifdef Q_WS_MAC
1175+
#ifdef Q_OS_MAC
11761176
// Window Menu Items
11771177

11781178
mActionWindowMinimize = new QAction( tr( "Minimize" ), this );
@@ -1220,7 +1220,7 @@ void QgisApp::createActions()
12201220

12211221
// Help Menu Items
12221222

1223-
#ifdef Q_WS_MAC
1223+
#ifdef Q_OS_MAC
12241224
mActionHelpContents->setShortcut( QString( "Ctrl+?" ) );
12251225
mActionQgisHomePage->setShortcut( QString() );
12261226
#endif
@@ -1297,7 +1297,7 @@ void QgisApp::showPythonDialog()
12971297
mPythonUtils->getError( className, text );
12981298
messageBar()->pushMessage( tr( "Error" ), tr( "Failed to open Python console:" ) + "\n" + className + ": " + text, QgsMessageBar::WARNING );
12991299
}
1300-
#ifdef Q_WS_MAC
1300+
#ifdef Q_OS_MAC
13011301
else
13021302
{
13031303
addWindow( mActionShowPythonDialog );
@@ -1449,14 +1449,14 @@ void QgisApp::createMenus()
14491449
}
14501450

14511451

1452-
#ifdef Q_WS_MAC
1452+
#ifdef Q_OS_MAC
14531453
//disabled for OSX - see #10761
14541454
//also see http://qt-project.org/forums/viewthread/3630 QGraphicsEffects are not well supported on OSX
14551455
mMenuPreviewMode->menuAction()->setVisible( false );
14561456
#endif
14571457

14581458

1459-
#ifdef Q_WS_MAC
1459+
#ifdef Q_OS_MAC
14601460

14611461
// keep plugins from hijacking About and Preferences application menus
14621462
// these duplicate actions will be moved to application menus by Qt
@@ -4460,7 +4460,7 @@ void QgisApp::activate()
44604460

44614461
void QgisApp::bringAllToFront()
44624462
{
4463-
#ifdef Q_WS_MAC
4463+
#ifdef Q_OS_MAC
44644464
// Bring forward all open windows while maintaining layering order
44654465
ProcessSerialNumber psn;
44664466
GetCurrentProcess( &psn );
@@ -4470,7 +4470,7 @@ void QgisApp::bringAllToFront()
44704470

44714471
void QgisApp::addWindow( QAction *action )
44724472
{
4473-
#ifdef Q_WS_MAC
4473+
#ifdef Q_OS_MAC
44744474
mWindowActions->addAction( action );
44754475
mWindowMenu->addAction( action );
44764476
action->setCheckable( true );
@@ -4482,7 +4482,7 @@ void QgisApp::addWindow( QAction *action )
44824482

44834483
void QgisApp::removeWindow( QAction *action )
44844484
{
4485-
#ifdef Q_WS_MAC
4485+
#ifdef Q_OS_MAC
44864486
mWindowActions->removeAction( action );
44874487
mWindowMenu->removeAction( action );
44884488
#else
@@ -7368,7 +7368,7 @@ class QgsPythonRunnerImpl : public QgsPythonRunner
73687368
void QgisApp::loadPythonSupport()
73697369
{
73707370
QString pythonlibName( "qgispython" );
7371-
#if defined(Q_WS_MAC) || defined(Q_OS_LINUX)
7371+
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
73727372
pythonlibName.prepend( QgsApplication::libraryPath() );
73737373
#endif
73747374
#ifdef __MINGW32__
@@ -8072,7 +8072,7 @@ void QgisApp::closeProject()
80728072
void QgisApp::changeEvent( QEvent* event )
80738073
{
80748074
QMainWindow::changeEvent( event );
8075-
#ifdef Q_WS_MAC
8075+
#ifdef Q_OS_MAC
80768076
switch ( event->type() )
80778077
{
80788078
case QEvent::ActivationChange:
@@ -8120,7 +8120,7 @@ QMenu* QgisApp::getPluginMenu( QString menuName )
81208120
* of the menu.
81218121
*/
81228122

8123-
#ifdef Q_WS_MAC
8123+
#ifdef Q_OS_MAC
81248124
// Mac doesn't have '&' keyboard shortcuts.
81258125
menuName.remove( QChar( '&' ) );
81268126
#endif
@@ -8192,7 +8192,7 @@ void QgisApp::removePluginMenu( QString name, QAction* action )
81928192

81938193
QMenu* QgisApp::getDatabaseMenu( QString menuName )
81948194
{
8195-
#ifdef Q_WS_MAC
8195+
#ifdef Q_OS_MAC
81968196
// Mac doesn't have '&' keyboard shortcuts.
81978197
menuName.remove( QChar( '&' ) );
81988198
#endif
@@ -8232,7 +8232,7 @@ QMenu* QgisApp::getDatabaseMenu( QString menuName )
82328232

82338233
QMenu* QgisApp::getRasterMenu( QString menuName )
82348234
{
8235-
#ifdef Q_WS_MAC
8235+
#ifdef Q_OS_MAC
82368236
// Mac doesn't have '&' keyboard shortcuts.
82378237
menuName.remove( QChar( '&' ) );
82388238
#endif
@@ -8282,7 +8282,7 @@ QMenu* QgisApp::getRasterMenu( QString menuName )
82828282

82838283
QMenu* QgisApp::getVectorMenu( QString menuName )
82848284
{
8285-
#ifdef Q_WS_MAC
8285+
#ifdef Q_OS_MAC
82868286
// Mac doesn't have '&' keyboard shortcuts.
82878287
menuName.remove( QChar( '&' ) );
82888288
#endif
@@ -8322,7 +8322,7 @@ QMenu* QgisApp::getVectorMenu( QString menuName )
83228322

83238323
QMenu* QgisApp::getWebMenu( QString menuName )
83248324
{
8325-
#ifdef Q_WS_MAC
8325+
#ifdef Q_OS_MAC
83268326
// Mac doesn't have '&' keyboard shortcuts.
83278327
menuName.remove( QChar( '&' ) );
83288328
#endif

0 commit comments

Comments
 (0)