Skip to content
Permalink
Browse files

Q_WS_* macros removed from Qt5, to determine platform use Q_OS_* macr…

…oses which exists in Qt4 and Qt5
  • Loading branch information
naihil committed Dec 23, 2014
1 parent a4aaff5 commit d5d4a5adebedf10a8cc297971bb0c92ccd897251
Showing with 86 additions and 86 deletions.
  1. +5 −5 src/app/composer/qgscomposer.cpp
  2. +1 −1 src/app/composer/qgscomposer.h
  3. +2 −2 src/app/composer/qgscomposerattributetablewidget.cpp
  4. +1 −1 src/app/composer/qgscomposerlabelwidget.cpp
  5. +4 −4 src/app/composer/qgscomposerlegendwidget.cpp
  6. +2 −2 src/app/composer/qgscomposermanager.cpp
  7. +1 −1 src/app/composer/qgscomposermanager.h
  8. +1 −1 src/app/composer/qgscomposermapwidget.cpp
  9. +1 −1 src/app/composer/qgscomposerscalebarwidget.cpp
  10. +2 −2 src/app/composer/qgscomposertablewidget.cpp
  11. +2 −2 src/app/gps/qwtpolar-1.0/qwt_polar_global.h
  12. +6 −6 src/app/main.cpp
  13. +16 −16 src/app/qgisapp.cpp
  14. +5 −5 src/app/qgisapp.h
  15. +2 −2 src/app/qgisappstylesheet.cpp
  16. +1 −1 src/app/qgsapplayertreeviewmenuprovider.cpp
  17. +1 −1 src/app/qgsdecorationgriddialog.cpp
  18. +1 −1 src/app/qgslabeldialog.cpp
  19. +1 −1 src/core/gps/qextserialport/qextserialenumerator.cpp
  20. +1 −1 src/core/gps/qgsgpsdetector.cpp
  21. +3 −3 src/core/qgsapplication.cpp
  22. +1 −1 src/core/qgsbrowsermodel.cpp
  23. +1 −1 src/core/qgsgeometry.cpp
  24. +1 −1 src/core/qgsogcutils.cpp
  25. +2 −2 src/gui/qgscolorbutton.cpp
  26. +4 −4 src/gui/qgscolorbuttonv2.cpp
  27. +1 −1 src/gui/qgscolordialog.cpp
  28. +1 −1 src/gui/qgsmapoverviewcanvas.cpp
  29. +1 −1 src/gui/qgsrasterformatsaveoptionswidget.cpp
  30. +2 −2 src/gui/symbology-ng/qgspointdisplacementrendererwidget.cpp
  31. +1 −1 src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
  32. +1 −1 src/gui/symbology-ng/qgsstylev2managerdialog.cpp
  33. +1 −1 src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
  34. +3 −3 src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp
  35. +2 −2 src/helpviewer/main.cpp
  36. +1 −1 src/plugins/grass/qgsgrassnewmapset.cpp
  37. +1 −1 src/server/qgsserverplugins.cpp
  38. +1 −1 src/server/qgswcsserver.cpp
  39. +1 −1 src/server/qgswfsserver.cpp
  40. +1 −1 tests/bench/main.cpp
@@ -195,7 +195,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )

mActionAtlasPreview->setCheckable( true );

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

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

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

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
void QgsComposer::changeEvent( QEvent* event )
{
QMainWindow::changeEvent( event );
@@ -2950,7 +2950,7 @@ void QgsComposer::showEvent( QShowEvent* event )
restoreComposerMapStates();
}

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
// add to menu if (re)opening window (event not due to unminimize)
if ( !event->spontaneous() )
{
@@ -114,7 +114,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase

virtual void showEvent( QShowEvent* event );

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
//! Change event (update window menu on ActivationChange)
virtual void changeEvent( QEvent * );
#endif
@@ -288,7 +288,7 @@ void QgsComposerAttributeTableWidget::on_mHeaderFontPushButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -336,7 +336,7 @@ void QgsComposerAttributeTableWidget::on_mContentFontPushButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -91,7 +91,7 @@ void QgsComposerLabelWidget::on_mFontButton_clicked()
if ( mComposerLabel )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -368,7 +368,7 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -390,7 +390,7 @@ void QgsComposerLegendWidget::on_mGroupFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -412,7 +412,7 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -434,7 +434,7 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -63,7 +63,7 @@ QgsComposerManager::QgsComposerManager( QWidget * parent, Qt::WindowFlags f ): Q
mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( rename_clicked() ) );

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

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
void QgsComposerManager::showEvent( QShowEvent* event )
{
if ( !event->spontaneous() )
@@ -73,7 +73,7 @@ class QgsComposerManager: public QDialog, private Ui::QgsComposerManagerBase
QString mDefaultTemplatesDir;
QString mUserTemplatesDir;

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
void showEvent( QShowEvent *event );
void changeEvent( QEvent * );

@@ -2055,7 +2055,7 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
}

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

bool dialogAccepted;
QFont oldFont = mComposerScaleBar->font();
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -215,7 +215,7 @@ void QgsComposerTableWidget::on_mHeaderFontPushButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -250,7 +250,7 @@ void QgsComposerTableWidget::on_mContentFontPushButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_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
@@ -16,7 +16,7 @@
#define QWT_POLAR_VERSION 0x010000
#define QWT_POLAR_VERSION_STR "1.0.0"

#if defined(Q_WS_WIN) || defined(Q_WS_S60)
#if defined(Q_OS_WIN) || defined(Q_WS_S60)

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

#endif // QWT_POLAR_MAKEDLL

#endif // Q_WS_WIN
#endif // Q_OS_WIN

#ifndef QWT_POLAR_EXPORT
#define QWT_POLAR_EXPORT
@@ -631,7 +631,7 @@ int main( int argc, char *argv[] )
QgsApplication myApp( argc, argv, myUseGuiFlag, configpath );

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

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

if ( systemEnvVars.contains( envVarName ) && envVarApply == "unset" )
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
putenv( envVarName.toUtf8().constData() );
#else
unsetenv( envVarName.toUtf8().constData() );
#endif
}
else
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if ( envVarApply != "undefined" || !getenv( envVarName.toUtf8().constData() ) )
putenv( QString( "%1=%2" ).arg( envVarName ).arg( envVarValue ).toUtf8().constData() );
#else
@@ -755,7 +755,7 @@ int main( int argc, char *argv[] )
QString style = mySettings.value( "/qgis/style" ).toString();
if ( !style.isNull() )
QApplication::setStyle( style );
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#if QT_VERSION < 0x050000
else
QApplication::setStyle( new QPlastiqueStyle );
@@ -828,7 +828,7 @@ int main( int argc, char *argv[] )
// we need to be sure we can find the qt image
// plugins. In mac be sure to look in the
// application bundle...
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
QCoreApplication::addLibraryPath( QApplication::applicationDirPath()
+ QDir::separator() + "qtplugins" );
#endif
@@ -967,7 +967,7 @@ int main( int argc, char *argv[] )

if ( !pythonfile.isEmpty() )
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
//replace backslashes with forward slashes
pythonfile.replace( "\\", "/" );
#endif
@@ -664,7 +664,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
connect( mInternalClipboard, SIGNAL( changed() ), this, SLOT( clipboardChanged() ) );
mQgisInterface = new QgisAppInterface( this ); // create the interfce

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

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
// Window Menu Items

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

// Help Menu Items

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
mActionHelpContents->setShortcut( QString( "Ctrl+?" ) );
mActionQgisHomePage->setShortcut( QString() );
#endif
@@ -1297,7 +1297,7 @@ void QgisApp::showPythonDialog()
mPythonUtils->getError( className, text );
messageBar()->pushMessage( tr( "Error" ), tr( "Failed to open Python console:" ) + "\n" + className + ": " + text, QgsMessageBar::WARNING );
}
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
else
{
addWindow( mActionShowPythonDialog );
@@ -1449,14 +1449,14 @@ void QgisApp::createMenus()
}


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


#ifdef Q_WS_MAC
#ifdef Q_OS_MAC

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

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

void QgisApp::addWindow( QAction *action )
{
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
mWindowActions->addAction( action );
mWindowMenu->addAction( action );
action->setCheckable( true );
@@ -4482,7 +4482,7 @@ void QgisApp::addWindow( QAction *action )

void QgisApp::removeWindow( QAction *action )
{
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
mWindowActions->removeAction( action );
mWindowMenu->removeAction( action );
#else
@@ -7368,7 +7368,7 @@ class QgsPythonRunnerImpl : public QgsPythonRunner
void QgisApp::loadPythonSupport()
{
QString pythonlibName( "qgispython" );
#if defined(Q_WS_MAC) || defined(Q_OS_LINUX)
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
pythonlibName.prepend( QgsApplication::libraryPath() );
#endif
#ifdef __MINGW32__
@@ -8072,7 +8072,7 @@ void QgisApp::closeProject()
void QgisApp::changeEvent( QEvent* event )
{
QMainWindow::changeEvent( event );
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
switch ( event->type() )
{
case QEvent::ActivationChange:
@@ -8120,7 +8120,7 @@ QMenu* QgisApp::getPluginMenu( QString menuName )
* of the menu.
*/

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

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

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

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

QMenu* QgisApp::getWebMenu( QString menuName )
{
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
// Mac doesn't have '&' keyboard shortcuts.
menuName.remove( QChar( '&' ) );
#endif

0 comments on commit d5d4a5a

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