Commit 6eab98c2 authored by Nicolas Vuaille's avatar Nicolas Vuaille

Remove statements for unsupported Qt

parent 42c32a19
......@@ -164,11 +164,7 @@ void pqIntegrationModelSurfaceHelperWidget::resetSurfaceWidget(bool force)
QStandardItemModel* model = new QStandardItemModel(nLeafs, nComponents);
table->setModel(model);
table->horizontalHeader()->setHighlightSections(false);
#if QT_VERSION >= 0x050000
table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
#else
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
#endif
table->horizontalHeader()->setStretchLastSection(true);
table->horizontalHeader()->hide();
QObject::connect(
......
......@@ -85,14 +85,9 @@ pqCollaborationPanel::pqCollaborationPanel(QWidget* p)
{
this->Internal = new pqInternal();
this->Internal->setupUi(this);
#if QT_VERSION >= 0x050000
this->Internal->members->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
this->Internal->members->horizontalHeader()->setSectionResizeMode(
1, QHeaderView::ResizeToContents);
#else
this->Internal->members->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
this->Internal->members->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
#endif
this->Internal->CameraToFollowOfUserId = -1;
this->Internal->NeedToConnectToCollaborationManager = true;
this->Internal->connectId->setMaximum(VTK_INT_MAX);
......
......@@ -210,13 +210,8 @@ pqComparativeVisPanel::pqComparativeVisPanel(QWidget* p)
this->Internal = new pqInternal();
this->Internal->setupUi(this);
#if QT_VERSION >= 0x050000
this->Internal->activeParameters->horizontalHeader()->setSectionResizeMode(
QHeaderView::ResizeToContents);
#else
this->Internal->activeParameters->horizontalHeader()->setResizeMode(
QHeaderView::ResizeToContents);
#endif
QObject::connect(
&pqActiveObjects::instance(), SIGNAL(viewChanged(pqView*)), this, SLOT(setView(pqView*)));
......
......@@ -108,11 +108,7 @@ pqDataInformationWidget::pqDataInformationWidget(QWidget* _parent /*=0*/)
this->View->verticalHeader()->hide();
this->View->installEventFilter(this);
#if QT_VERSION >= 0x050000
this->View->horizontalHeader()->setSectionsMovable(true);
#else
this->View->horizontalHeader()->setMovable(true);
#endif
this->View->horizontalHeader()->setHighlightSections(false);
this->View->horizontalHeader()->setStretchLastSection(true);
// this->View->horizontalHeader()->setSortIndicatorShown(true);
......
......@@ -59,10 +59,6 @@ using Ui::pqMemoryInspectorPanelForm;
#include <QTreeWidgetItem>
#include <QTreeWidgetItemIterator>
#if QT_VERSION < 0x050000
#include <QPlastiqueStyle>
#endif
#include <map>
using std::map;
using std::pair;
......@@ -127,7 +123,6 @@ enum
namespace
{
#if QT_VERSION >= 0x050000
// ****************************************************************************
QStyle* getMemoryUseWidgetStyle()
{
......@@ -139,19 +134,6 @@ QStyle* getMemoryUseWidgetStyle()
static QStyle* style = QStyleFactory::create("fusion");
return style;
}
#else
// ****************************************************************************
QPlastiqueStyle* getMemoryUseWidgetStyle()
{
// this sets the style for the progress bar used to
// display % memory usage. If we didn't do this the
// display will look different on each OS. The ownership
// of the style does not change hands when it's set to
// the widget thus a single static instance is convenient.
static QPlastiqueStyle style;
return &style;
}
#endif
// ****************************************************************************
float getSystemWarningThreshold()
{
......
......@@ -254,13 +254,8 @@ void pqPluginDialog::refreshRemote()
void pqPluginDialog::setupTreeWidget(QTreeWidget* pluginTree)
{
pluginTree->setColumnCount(2);
#if QT_VERSION >= 0x050000
pluginTree->header()->setSectionResizeMode(NameCol, QHeaderView::ResizeToContents);
pluginTree->header()->setSectionResizeMode(ValueCol, QHeaderView::Custom);
#else
pluginTree->header()->setResizeMode(NameCol, QHeaderView::ResizeToContents);
pluginTree->header()->setResizeMode(ValueCol, QHeaderView::Custom);
#endif
pluginTree->setHeaderLabels(QStringList() << tr("Name") << tr("Property"));
......
......@@ -349,11 +349,7 @@ public:
{
this->Ui.setupUi(self);
this->Ui.Table->setModel(&this->Model);
#if QT_VERSION >= 0x050000
this->Ui.Table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
#else
this->Ui.Table->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
#endif
this->Ui.Table->horizontalHeader()->setStretchLastSection(true);
this->Ui.Table->horizontalHeader()->hide();
......
......@@ -196,11 +196,7 @@ void pqSignalAdaptorTreeWidget::updateSortingLinks()
{
QObject::connect(
this->TreeWidget->header(), SIGNAL(sectionClicked(int)), this, SLOT(sort(int)));
#if QT_VERSION >= 0x050000
this->TreeWidget->header()->setSectionsClickable(true);
#else
this->TreeWidget->header()->setClickable(true);
#endif
}
else
{
......
......@@ -360,14 +360,6 @@ void pqInteractiveViewLink::drawViewLink(int setFront)
return;
}
#if QT_VERSION < 0x050000
// Switch to offscreen buffer if rendering
if (render)
{
this->Internal->LinkedWindow->SetUseOffScreenBuffers(true);
}
#endif
// Compute adapted position and size of the pixel needed on the
// linked window
int linkedPos[2];
......@@ -422,14 +414,6 @@ void pqInteractiveViewLink::drawViewLink(int setFront)
this->Internal->DisplayWindow->SetRGBACharPixelData(displayPos[0], displayPos[1],
displayPos[0] + displayPos2[0] - 1, displayPos[1] + displayPos2[1] - 1,
this->Internal->DisplayPixels.Get(), setFront, 1);
#if QT_VERSION < 0x050000
// Set offscreen buffers back
if (render)
{
this->Internal->LinkedWindow->SetUseOffScreenBuffers(false);
}
#endif
}
//-----------------------------------------------------------------------------
......
......@@ -13,11 +13,7 @@ int QTestApp::Error = 0;
QTestApp::QTestApp(int _argc, char** _argv)
{
#if QT_VERSION >= 0x050000
qInstallMessageHandler(QTestApp::messageHandler);
#else
qInstallMsgHandler(QTestApp::messageHandler);
#endif
// CMake generated driver removes argv[0],
// so let's put a dummy back in
......@@ -37,11 +33,7 @@ QTestApp::QTestApp(int _argc, char** _argv)
QTestApp::~QTestApp()
{
delete App;
#if QT_VERSION >= 0x050000
qInstallMessageHandler(0);
#else
qInstallMsgHandler(0);
#endif
}
int QTestApp::exec()
......@@ -53,8 +45,6 @@ int QTestApp::exec()
return Error + QApplication::exec();
}
#if QT_VERSION >= 0x050000
void QTestApp::messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg)
{
QByteArray localMsg = msg.toLocal8Bit();
......@@ -85,31 +75,6 @@ void QTestApp::messageHandler(QtMsgType type, const QMessageLogContext& context,
}
}
#else
void QTestApp::messageHandler(QtMsgType type, const char* msg)
{
switch (type)
{
case QtDebugMsg:
fprintf(stderr, "Debug: %s\n", msg);
break;
case QtWarningMsg:
fprintf(stderr, "Warning: %s\n", msg);
Error++;
break;
case QtCriticalMsg:
fprintf(stderr, "Critical: %s\n", msg);
Error++;
break;
case QtFatalMsg:
fprintf(stderr, "Fatal: %s\n", msg);
abort();
}
}
#endif
void QTestApp::delay(int ms)
{
if (ms > 0)
......
......@@ -14,11 +14,7 @@ public:
static int exec();
#if QT_VERSION >= 0x050000
static void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg);
#else
static void messageHandler(QtMsgType type, const char* msg);
#endif
static void delay(int ms);
......
......@@ -102,16 +102,12 @@ void pqTextEditTester::testTypeText()
QFETCH(bool, focus);
this->TextEdit->show();
#if QT_VERSION >= 0x050000
bool active = QTest::qWaitForWindowActive(this->TextEdit);
if (!active)
{
qCritical() << "Window did not become active. Skipping testTypeText.";
return;
}
#else
QTest::qWaitForWindowShown(this->TextEdit);
#endif
this->TextEdit->setFocus();
QTest::keyClicks(this->TextEdit, text);
......@@ -205,16 +201,12 @@ void pqTextEditTester::testFocus()
QFETCH(bool, focus);
this->TextEdit->show();
#if QT_VERSION >= 0x050000
bool active = QTest::qWaitForWindowActive(this->TextEdit);
if (!active)
{
qCritical() << "Window did not become active. Skipping testFocus.";
return;
}
#else
QTest::qWaitForWindowShown(this->TextEdit);
#endif
this->TextEdit->setFocus();
QTest::keyClick(this->TextEdit, static_cast<Qt::Key>(focusOutKey),
......@@ -298,16 +290,12 @@ void pqTextEditTester::testReTypeText()
this->spy(spyType)->clear(); // Reset spy
this->TextEdit->show();
#if QT_VERSION >= 0x050000
bool active = QTest::qWaitForWindowActive(this->TextEdit);
if (!active)
{
qCritical() << "Window did not become active. Skipping testReTypeText.";
return;
}
#else
QTest::qWaitForWindowShown(this->TextEdit);
#endif
this->TextEdit->setFocus();
for (int i = 0; i < text.length(); ++i) // Remove previous text
......
......@@ -64,9 +64,7 @@ class PQWIDGETS_EXPORT pqAnimationKeyFrame : public QObject, public QGraphicsIte
* an icon to help describe the keyframe
*/
Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
#if QT_VERSION >= 0x40600
Q_INTERFACES(QGraphicsItem)
#endif
public:
pqAnimationKeyFrame(pqAnimationTrack* p);
~pqAnimationKeyFrame() override;
......
......@@ -45,12 +45,7 @@ class pqAnimationKeyFrame;
class PQWIDGETS_EXPORT pqAnimationTrack : public QObject, public QGraphicsItem
{
Q_OBJECT
/**
* Declare the interfaces implemented - fails with Qt 4.5, warns on 4.6
*/
#if QT_VERSION >= 0x40600
Q_INTERFACES(QGraphicsItem)
#endif
/**
* the property animated in this track
*/
......
......@@ -60,26 +60,16 @@ pqAnimationWidget::pqAnimationWidget(QWidget* p)
this->CreateDeleteHeader->viewport()->setBackgroundRole(QPalette::Window);
this->CreateDeleteHeader->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
#if QT_VERSION >= 0x050000
this->CreateDeleteHeader->setSectionResizeMode(QHeaderView::Fixed);
this->CreateDeleteHeader->setSectionsClickable(true);
#else
this->CreateDeleteHeader->setResizeMode(QHeaderView::Fixed);
this->CreateDeleteHeader->setClickable(true);
#endif
this->CreateDeleteHeader->setModel(&this->CreateDeleteModel);
this->EnabledHeader = new QHeaderView(Qt::Vertical, this);
this->EnabledHeader->setObjectName("EnabledHeader");
this->EnabledHeader->viewport()->setBackgroundRole(QPalette::Window);
this->EnabledHeader->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
#if QT_VERSION >= 0x050000
this->EnabledHeader->setSectionResizeMode(QHeaderView::Fixed);
this->EnabledHeader->setSectionsClickable(true);
#else
this->EnabledHeader->setResizeMode(QHeaderView::Fixed);
this->EnabledHeader->setClickable(true);
#endif
this->EnabledHeader->setModel(this->Model->enabledHeader());
this->Header = new QHeaderView(Qt::Vertical, this);
......@@ -87,11 +77,7 @@ pqAnimationWidget::pqAnimationWidget(QWidget* p)
this->Header->setObjectName("TrackHeader");
this->Header->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
this->View->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
#if QT_VERSION >= 0x050000
this->Header->setSectionResizeMode(QHeaderView::Fixed);
#else
this->Header->setResizeMode(QHeaderView::Fixed);
#endif
this->Header->setMinimumSectionSize(0);
this->Header->setModel(this->Model->header());
this->Model->setRowHeight(this->Header->defaultSectionSize());
......
......@@ -209,11 +209,7 @@ pqCheckableHeaderView::pqCheckableHeaderView(Qt::Orientation orientation, QWidge
{
this->Internal = new pqCheckableHeaderViewInternal();
this->Internal->Style = this->style();
#if QT_VERSION >= 0x050000
setSectionsClickable(true);
#else
setClickable(true);
#endif
QObject::connect(this, SIGNAL(checkStateChanged(int)), this, SLOT(updateSection(int)));
}
......
......@@ -100,11 +100,7 @@ void pqCollapsedGroup::paintEvent(QPaintEvent*)
// Draw frame
if (option.subControls & QStyle::SC_GroupBoxFrame)
{
#if QT_VERSION >= 0x050000
QStyleOptionFrame frame;
#else
QStyleOptionFrameV2 frame;
#endif
frame.QStyleOption::operator=(option);
frame.features = option.features;
frame.lineWidth = option.lineWidth;
......
......@@ -495,13 +495,8 @@ void pqFlatTreeView::setHeader(QHeaderView* headerView)
// Set up the default header view.
this->HeaderView = new QHeaderView(Qt::Horizontal, this->viewport());
this->HeaderView->setSortIndicatorShown(false);
#if QT_VERSION >= 0x050000
this->HeaderView->setSectionsClickable(false);
this->HeaderView->setSectionResizeMode(QHeaderView::Interactive);
#else
this->HeaderView->setClickable(false);
this->HeaderView->setResizeMode(QHeaderView::Interactive);
#endif
this->HeaderOwned = true;
}
......
......@@ -106,11 +106,7 @@ pqTreeWidget::pqTreeWidget(QWidget* p)
QObject::connect(
this->header(), SIGNAL(sectionClicked(int)), this, SLOT(doToggle(int)), Qt::QueuedConnection);
#if QT_VERSION >= 0x050000
this->header()->setSectionsClickable(true);
#else
this->header()->setClickable(true);
#endif
QObject::connect(
this->model(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(updateCheckState()));
......
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