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 )
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);
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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
......
......@@ -41,6 +41,7 @@
#endif
#define HAS_QT47 ( QT_VERSION >= 0x040700 )
#define HAS_QT5 ( QT_VERSION >= 0x050000 )
enum {
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