Use QLineEdit for Qt>=5.2

This commit is contained in:
Craig Drummond
2016-10-16 23:05:49 +01:00
committed by Craig Drummond
parent 6c695bcf29
commit a0d167323f
3 changed files with 13 additions and 3 deletions

View File

@@ -69,9 +69,9 @@ if (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB)
dialog.h shortcutsmodel.h shortcutssettingswidget.h keysequencewidget.h spinner.h acceleratormanager_private.h)
set(SUPPORT_UIS shortcutssettingswidget.ui)
if (ENABLE_QT5)
# if (Qt5Gui_VERSION_MAJOR LESS 5 OR Qt5Gui_VERSION_MINOR LESS 2)
if (Qt5Gui_VERSION_MAJOR LESS 5 OR Qt5Gui_VERSION_MINOR LESS 2)
set(SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} lineedit.h)
# endif (Qt5Gui_VERSION_MAJOR LESS 5 OR Qt5Gui_VERSION_MINOR LESS 2)
endif (Qt5Gui_VERSION_MAJOR LESS 5 OR Qt5Gui_VERSION_MINOR LESS 2)
qt5_wrap_ui(SUPPORT_UI_HDRS ${SUPPORT_UIS})
else (ENABLE_QT5)
set(SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} lineedit.h)

View File

@@ -41,7 +41,7 @@ void LineEdit::setReadOnly(bool e)
}
}
#if !defined ENABLE_KDE_SUPPORT // && QT_VERSION < 0x050200
#if !defined ENABLE_KDE_SUPPORT && QT_VERSION < 0x050200
/****************************************************************************
**

View File

@@ -35,6 +35,15 @@
#include <QLineEdit>
#if QT_VERSION >= 0x050200
class LineEdit : public QLineEdit
{
public:
LineEdit(QWidget *parent = 0) : QLineEdit(parent) { setClearButtonEnabled(true); }
void setReadOnly(bool e);
};
#else
#ifdef ENABLE_KDE_SUPPORT
#include <KDE/KLineEdit>
class LineEdit : public KLineEdit
@@ -77,6 +86,7 @@ private:
QToolButton *clearButton;
};
#endif
#endif
#endif // LIENEDIT_H