mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 22:22:33 -06:00
Use simpler DEFINE for detecting Qt5 so moc will work too.
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user