From 75599739692e1409addc639a83e7c42923f40919 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 5 Jun 2011 23:24:56 +0000 Subject: [PATCH] Compile fix for qt versions below 4.6. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38961 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/FancyLineEdit.cpp | 4 ++++ src/frontends/qt4/FancyLineEdit.h | 18 +++++++++++++----- src/frontends/qt4/PanelStack.cpp | 2 ++ 3 files changed, 19 insertions(+), 5 deletions(-) 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)));