From: Kai Koehne Date: Mon, 30 Jan 2012 08:52:51 +0000 (+0100) Subject: Mac: Fix compilation with -qtnamespace set X-Git-Tag: qt-v5.0.0-alpha1~1437 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef63b7befd5b0d6726b709aa79f6503322af1462;p=profile%2Fivi%2Fqtbase.git Mac: Fix compilation with -qtnamespace set Change-Id: Id3b9f4e3edf2caeac32c8a44278cdf05a1fc70fb Reviewed-by: hjk Reviewed-by: Morten Johan Sørvig --- diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index f3bb59d..80be157 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -44,6 +44,8 @@ #include #import +QT_BEGIN_NAMESPACE + // this could become a list of all languages used for each writing // system, instead of using the single most common language. static const char *languageForWritingSystem[] = { @@ -320,6 +322,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString family, cons return fallbackLists[styleHint]; } +OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref); QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName) { ATSFontContainerRef fontContainer; @@ -330,7 +333,6 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData kATSFontContextLocal, kATSFontFormatUnspecified, NULL, kATSOptionFlagsDefault, &fontContainer); } else { - OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref); FSRef ref; if (qt_mac_create_fsref(fileName, &ref) != noErr) return QStringList(); @@ -371,3 +373,5 @@ QFont QCoreTextFontDatabase::defaultFont() const return QFont(defaultFontName); } +QT_END_NAMESPACE + diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h index 08ab0b2..adcfeeb 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h @@ -44,6 +44,8 @@ #include +QT_BEGIN_NAMESPACE + class QCoreTextFontDatabase : public QPlatformFontDatabase { public: @@ -61,4 +63,6 @@ private: QHash fallbackLists; }; +QT_END_NAMESPACE + #endif // QCORETEXTFONTDATABASE_H diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index 6467dbc..c61ff2b 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -47,7 +47,10 @@ #include #include +QT_BEGIN_NAMESPACE class QCocoaWindow; +QT_END_NAMESPACE + @interface QNSView : NSView { CGImageRef m_cgImage; QWindow *m_window; diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 6f5891e..09cb9cc 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -2105,7 +2105,7 @@ void QMacStyle::unpolish(QWidget* w) } } - if (QRubberBand *rubber = ::qobject_cast(w)) { + if (QRubberBand *rubber = qobject_cast(w)) { rubber->setWindowOpacity(1.0); rubber->setAttribute(Qt::WA_PaintOnScreen, true); rubber->setAttribute(Qt::WA_NoSystemBackground, true); @@ -3538,7 +3538,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter QCommonStyle::drawControl(ce, opt, p, w); break; case CE_PushButtonBevel: - if (const QStyleOptionButton *btn = ::qstyleoption_cast(opt)) { + if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { if (!(btn->state & (State_Raised | State_Sunken | State_On))) break; diff --git a/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp b/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp index bdbd64b..f4fb6a9 100644 --- a/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp +++ b/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp @@ -1018,10 +1018,15 @@ void tst_QToolBar::widgetAction() delete a; } +#ifdef Q_OS_MAC +QT_BEGIN_NAMESPACE +extern void qt_set_sequence_auto_mnemonic(bool b); +QT_END_NAMESPACE +#endif + void tst_QToolBar::accel() { #ifdef Q_OS_MAC - extern void qt_set_sequence_auto_mnemonic(bool b); qt_set_sequence_auto_mnemonic(true); #endif QMainWindow mw;