Fix functions and macros using to support both Qt4 and Qt5.

This commit is contained in:
Vladimir Golovnev (Glassez)
2013-09-21 11:59:58 +04:00
committed by sledgehammer999
parent 763d8a392f
commit ce3aac5f9d
51 changed files with 260 additions and 181 deletions

View File

@@ -40,8 +40,12 @@
#include "misc.h"
#include "previewselect.h"
#ifdef Q_WS_WIN
#include <QPlastiqueStyle>
#ifdef Q_OS_WIN
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#include <QPlastiqueStyle>
#else
#include <QProxyStyle>
#endif
#endif
class PreviewListDelegate: public QItemDelegate {
@@ -71,13 +75,17 @@ class PreviewListDelegate: public QItemDelegate {
newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true;
#ifndef Q_WS_WIN
#ifndef Q_OS_WIN
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
#else
#else
// XXX: To avoid having the progress text on the right of the bar
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
QPlastiqueStyle st;
#else
QProxyStyle st("fusion");
#endif
st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0);
#endif
#endif
break;
}
default: