[vlc-commits] Qt: use a processor helper for Qt5

Jean-Baptiste Kempf git at videolan.org
Tue May 20 16:20:40 CEST 2014


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue May 20 16:15:14 2014 +0200| [73ff6ac34539eaf4f2df155a6b0afdac7f6e559d] | committer: Jean-Baptiste Kempf

Qt: use a processor helper for Qt5

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=73ff6ac34539eaf4f2df155a6b0afdac7f6e559d
---

 modules/gui/qt4/components/info_panels.cpp    |    2 +-
 modules/gui/qt4/components/playlist/views.cpp |    2 +-
 modules/gui/qt4/dialogs/plugins.cpp           |    2 +-
 modules/gui/qt4/main_interface.cpp            |    4 ++--
 modules/gui/qt4/main_interface_win32.cpp      |   10 +++++-----
 modules/gui/qt4/qt4.cpp                       |    2 +-
 modules/gui/qt4/qt4.hpp                       |    1 +
 7 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt4/components/info_panels.cpp b/modules/gui/qt4/components/info_panels.cpp
index 989f138..a982b88 100644
--- a/modules/gui/qt4/components/info_panels.cpp
+++ b/modules/gui/qt4/components/info_panels.cpp
@@ -469,7 +469,7 @@ InfoPanel::InfoPanel( QWidget *parent ) : QWidget( parent )
      InfoTree = new QTreeWidget(this);
      InfoTree->setColumnCount( 1 );
      InfoTree->header()->hide();
-#if QT_VERSION >= 0x050000
+#if HAS_QT5
      InfoTree->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
 #else
      InfoTree->header()->setResizeMode(QHeaderView::ResizeToContents);
diff --git a/modules/gui/qt4/components/playlist/views.cpp b/modules/gui/qt4/components/playlist/views.cpp
index 95f0a48..4530660 100644
--- a/modules/gui/qt4/components/playlist/views.cpp
+++ b/modules/gui/qt4/components/playlist/views.cpp
@@ -433,7 +433,7 @@ PlTreeView::PlTreeView( QAbstractItemModel *, QWidget *parent ) : QTreeView( par
     viewport()->setAttribute( Qt::WA_Hover );
     header()->setSortIndicator( -1 , Qt::AscendingOrder );
     header()->setSortIndicatorShown( true );
-#if QT_VERSION >= 0x050000
+#if HAS_QT5
     header()->setSectionsClickable( true );
 #else
     header()->setClickable( true );
diff --git a/modules/gui/qt4/dialogs/plugins.cpp b/modules/gui/qt4/dialogs/plugins.cpp
index f495f99..814eb33 100644
--- a/modules/gui/qt4/dialogs/plugins.cpp
+++ b/modules/gui/qt4/dialogs/plugins.cpp
@@ -109,7 +109,7 @@ PluginTab::PluginTab( intf_thread_t *p_intf_ )
     layout->addWidget( treePlugins, 0, 0, 1, -1 );
 
     /* Users cannot move the columns around but we need to sort */
-#if QT_VERSION >= 0x050000
+#if HAS_QT5
     treePlugins->header()->setSectionsMovable( false );
 #else
     treePlugins->header()->setMovable( false );
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 1c240fb..7009e0f 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -64,7 +64,7 @@
 #include <vlc_vout_display.h>               /* vout_thread_t and VOUT_ events */
 
 
-#if defined(_WIN32) && QT_VERSION >= 0x050000
+#if defined(_WIN32) && HAS_QT5
 #include <QWindow>
 #include <qpa/qplatformnativeinterface.h>
 #endif
@@ -1111,7 +1111,7 @@ void MainInterface::toggleUpdateSystrayMenu()
          * but ignore the ones always on top
          * and the ones which can't be activated */
         HWND winId;
-#if QT_VERSION >= 0x050000
+#if HAS_QT5
         QWindow *window = windowHandle();
         winId = static_cast<HWND>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", window));
 #else
diff --git a/modules/gui/qt4/main_interface_win32.cpp b/modules/gui/qt4/main_interface_win32.cpp
index 4c0dca2..8426a90 100644
--- a/modules/gui/qt4/main_interface_win32.cpp
+++ b/modules/gui/qt4/main_interface_win32.cpp
@@ -31,9 +31,9 @@
 #include <QBitmap>
 #include <vlc_windows_interfaces.h>
 
-#if defined(_WIN32) && QT_VERSION >= 0x050000
-#include <QWindow>
-#include <qpa/qplatformnativeinterface.h>
+#if defined(_WIN32) && HAS_QT5
+# include <QWindow>
+# include <qpa/qplatformnativeinterface.h>
 #endif
 
 
@@ -80,7 +80,7 @@
 
 HWND MainInterface::WinId()
 {
-#if QT_VERSION >= 0x050000
+#if HAS_QT5
     QWindow *window = windowHandle();
     HWND id = static_cast<HWND>(QGuiApplication::platformNativeInterface()->
             nativeResourceForWindow("handle", window));
@@ -90,7 +90,7 @@ HWND MainInterface::WinId()
 #endif
 }
 
-#if defined(_WIN32) && QT_VERSION < 0x050000
+#if defined(_WIN32) && !HAS_QT5
 static const int PremultipliedAlpha = QPixmap::PremultipliedAlpha;
 static HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0)
 {
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index d960448..f13039d 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -51,7 +51,7 @@
 
 #ifdef _WIN32 /* For static builds */
  #include <QtPlugin>
- #if QT_VERSION >= 0x050000
+ #if HAS_QT5
   Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
   Q_IMPORT_PLUGIN(AccessibleFactory)
  #else
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index 2900f67..44d7db6 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -41,6 +41,7 @@
 #endif
 
 #define HAS_QT47 ( QT_VERSION >= 0x040700 )
+#define HAS_QT5  ( QT_VERSION >= 0x050000 )
 
 enum {
     DialogEventTypeOffset = 0,



More information about the vlc-commits mailing list