Use simpler DEFINE for detecting Qt5 so moc will work too.

This commit is contained in:
sledgehammer999
2015-12-05 21:49:46 +02:00
parent 623ab03492
commit 17ac4b90be
28 changed files with 71 additions and 70 deletions

View File

@@ -27,7 +27,7 @@ LineEdit::LineEdit(QWidget *parent)
int clearButtonSizeHintWidth = 0;
int clearButtonSizeHintHeight = 0;
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#ifndef QBT_USES_QT5
QPixmap pixmap2(":/lineeditimages/clear_left.png");
clearButton = new QToolButton(this);
clearButton->setIcon(QIcon(pixmap2));
@@ -58,13 +58,13 @@ void LineEdit::resizeEvent(QResizeEvent *e)
QSize sz = searchButton->sizeHint();
searchButton->move(frameWidth, (e->size().height() - sz.height()) / 2);
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#ifndef QBT_USES_QT5
QSize cz = clearButton->sizeHint();
clearButton->move((e->size().width() - frameWidth - cz.width()), (e->size().height() - sz.height()) / 2);
#endif
}
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#ifndef QBT_USES_QT5
void LineEdit::updateCloseButton(const QString &text)
{
clearButton->setVisible(!text.isEmpty());

View File

@@ -24,14 +24,14 @@ public:
protected:
void resizeEvent(QResizeEvent *e);
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#ifndef QBT_USES_QT5
private slots:
void updateCloseButton(const QString &text);
#endif
private:
QToolButton *searchButton;
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#ifndef QBT_USES_QT5
QToolButton *clearButton;
#endif
};