diff --git a/src/frontends/qt4/FancyLineEdit.cpp b/src/frontends/qt4/FancyLineEdit.cpp index f3080104c6..da4dc7e1a6 100644 --- a/src/frontends/qt4/FancyLineEdit.cpp +++ b/src/frontends/qt4/FancyLineEdit.cpp @@ -26,6 +26,8 @@ #include #include +#if QT_VERSION >= 0x040600 + enum { margin = 6 }; #define ICONBUTTON_HEIGHT 18 @@ -302,4 +304,6 @@ void IconButton::animateShow(bool visible) } +#endif // QT_VERSION >= 0x040600 + #include "moc_FancyLineEdit.cpp" diff --git a/src/frontends/qt4/FancyLineEdit.h b/src/frontends/qt4/FancyLineEdit.h index a3569a8cd0..ec472eed8c 100644 --- a/src/frontends/qt4/FancyLineEdit.h +++ b/src/frontends/qt4/FancyLineEdit.h @@ -62,6 +62,13 @@ class FancyLineEdit : public QLineEdit public: enum Side {Left = 0, Right = 1}; +Q_SIGNALS: + void buttonClicked(Side side); + void leftButtonClicked(); + void rightButtonClicked(); + +#if QT_VERSION >= 0x040600 +public: explicit FancyLineEdit(QWidget *parent = 0); ~FancyLineEdit(); @@ -85,11 +92,6 @@ public: void setAutoHideButton(Side side, bool h); bool hasAutoHideButton(Side side) const; -Q_SIGNALS: - void buttonClicked(Side side); - void leftButtonClicked(); - void rightButtonClicked(); - private Q_SLOTS: void checkButtons(const QString &); void iconClicked(); @@ -103,6 +105,12 @@ private: FancyLineEditPrivate *m_d; QString m_oldText; +#else +public: + explicit FancyLineEdit(QWidget *parent = 0) + : QLineEdit(parent) + {} +#endif // QT_VERSION >= 0x040600*/ }; } diff --git a/src/frontends/qt4/PanelStack.cpp b/src/frontends/qt4/PanelStack.cpp index 1863040bd1..5537ee1562 100644 --- a/src/frontends/qt4/PanelStack.cpp +++ b/src/frontends/qt4/PanelStack.cpp @@ -75,10 +75,12 @@ PanelStack::PanelStack(QWidget * parent) search_->setPlaceholderText(qt_("Search")); #endif +#if QT_VERSION >= 0x040600 search_->setButtonPixmap(FancyLineEdit::Right, getPixmap("images/", "editclear", "png")); search_->setButtonVisible(FancyLineEdit::Right, true); search_->setButtonToolTip(FancyLineEdit::Right, qt_("Clear text")); search_->setAutoHideButton(FancyLineEdit::Right, true); +#endif connect(search_, SIGNAL(rightButtonClicked()), this, SLOT(resetSearch())); connect(search_, SIGNAL(textEdited(QString)), this, SLOT(filterChanged(QString)));