Commit 73ff6ac3 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: use a processor helper for Qt5

parent ba02909b
...@@ -469,7 +469,7 @@ InfoPanel::InfoPanel( QWidget *parent ) : QWidget( parent ) ...@@ -469,7 +469,7 @@ InfoPanel::InfoPanel( QWidget *parent ) : QWidget( parent )
InfoTree = new QTreeWidget(this); InfoTree = new QTreeWidget(this);
InfoTree->setColumnCount( 1 ); InfoTree->setColumnCount( 1 );
InfoTree->header()->hide(); InfoTree->header()->hide();
#if QT_VERSION >= 0x050000 #if HAS_QT5
InfoTree->header()->setSectionResizeMode(QHeaderView::ResizeToContents); InfoTree->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
#else #else
InfoTree->header()->setResizeMode(QHeaderView::ResizeToContents); InfoTree->header()->setResizeMode(QHeaderView::ResizeToContents);
......
...@@ -433,7 +433,7 @@ PlTreeView::PlTreeView( QAbstractItemModel *, QWidget *parent ) : QTreeView( par ...@@ -433,7 +433,7 @@ PlTreeView::PlTreeView( QAbstractItemModel *, QWidget *parent ) : QTreeView( par
viewport()->setAttribute( Qt::WA_Hover ); viewport()->setAttribute( Qt::WA_Hover );
header()->setSortIndicator( -1 , Qt::AscendingOrder ); header()->setSortIndicator( -1 , Qt::AscendingOrder );
header()->setSortIndicatorShown( true ); header()->setSortIndicatorShown( true );
#if QT_VERSION >= 0x050000 #if HAS_QT5
header()->setSectionsClickable( true ); header()->setSectionsClickable( true );
#else #else
header()->setClickable( true ); header()->setClickable( true );
......
...@@ -109,7 +109,7 @@ PluginTab::PluginTab( intf_thread_t *p_intf_ ) ...@@ -109,7 +109,7 @@ PluginTab::PluginTab( intf_thread_t *p_intf_ )
layout->addWidget( treePlugins, 0, 0, 1, -1 ); layout->addWidget( treePlugins, 0, 0, 1, -1 );
/* Users cannot move the columns around but we need to sort */ /* Users cannot move the columns around but we need to sort */
#if QT_VERSION >= 0x050000 #if HAS_QT5
treePlugins->header()->setSectionsMovable( false ); treePlugins->header()->setSectionsMovable( false );
#else #else
treePlugins->header()->setMovable( false ); treePlugins->header()->setMovable( false );
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
#include <vlc_vout_display.h> /* vout_thread_t and VOUT_ events */ #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 <QWindow>
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
#endif #endif
...@@ -1111,7 +1111,7 @@ void MainInterface::toggleUpdateSystrayMenu() ...@@ -1111,7 +1111,7 @@ void MainInterface::toggleUpdateSystrayMenu()
* but ignore the ones always on top * but ignore the ones always on top
* and the ones which can't be activated */ * and the ones which can't be activated */
HWND winId; HWND winId;
#if QT_VERSION >= 0x050000 #if HAS_QT5
QWindow *window = windowHandle(); QWindow *window = windowHandle();
winId = static_cast<HWND>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", window)); winId = static_cast<HWND>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", window));
#else #else
......
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
#include <QBitmap> #include <QBitmap>
#include <vlc_windows_interfaces.h> #include <vlc_windows_interfaces.h>
#if defined(_WIN32) && QT_VERSION >= 0x050000 #if defined(_WIN32) && HAS_QT5
#include <QWindow> # include <QWindow>
#include <qpa/qplatformnativeinterface.h> # include <qpa/qplatformnativeinterface.h>
#endif #endif
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
HWND MainInterface::WinId() HWND MainInterface::WinId()
{ {
#if QT_VERSION >= 0x050000 #if HAS_QT5
QWindow *window = windowHandle(); QWindow *window = windowHandle();
HWND id = static_cast<HWND>(QGuiApplication::platformNativeInterface()-> HWND id = static_cast<HWND>(QGuiApplication::platformNativeInterface()->
nativeResourceForWindow("handle", window)); nativeResourceForWindow("handle", window));
...@@ -90,7 +90,7 @@ HWND MainInterface::WinId() ...@@ -90,7 +90,7 @@ HWND MainInterface::WinId()
#endif #endif
} }
#if defined(_WIN32) && QT_VERSION < 0x050000 #if defined(_WIN32) && !HAS_QT5
static const int PremultipliedAlpha = QPixmap::PremultipliedAlpha; static const int PremultipliedAlpha = QPixmap::PremultipliedAlpha;
static HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0) static HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0)
{ {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#ifdef _WIN32 /* For static builds */ #ifdef _WIN32 /* For static builds */
#include <QtPlugin> #include <QtPlugin>
#if QT_VERSION >= 0x050000 #if HAS_QT5
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
Q_IMPORT_PLUGIN(AccessibleFactory) Q_IMPORT_PLUGIN(AccessibleFactory)
#else #else
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#endif #endif
#define HAS_QT47 ( QT_VERSION >= 0x040700 ) #define HAS_QT47 ( QT_VERSION >= 0x040700 )
#define HAS_QT5 ( QT_VERSION >= 0x050000 )
enum { enum {
DialogEventTypeOffset = 0, DialogEventTypeOffset = 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment