Typedef QSearchField to old LineEdit on non Mac, and make it compatible with QSearchField

Fixes issue 3047. (for now)
This commit is contained in:
Arnaud Bienner 2012-07-10 00:44:05 +02:00
parent 0558c7bf69
commit 59517f5b4e
9 changed files with 30 additions and 0 deletions

View File

@ -3,6 +3,18 @@
#include <QWidget>
#include <QPointer>
#include <QtGlobal>
#ifndef Q_OS_MAC
// Currently the old LineEdit is better than the current qsearchfield_nonmac
// IMHO: add this (ugly) hack to force non Mac systems to use the old LineEdit.
// TODO: Fix this in a better way (improve qsearchfield_nonmac definitely?)
class LineEdit;
typedef LineEdit QSearchField;
#else // Q_OS_MAC
class QSearchFieldPrivate;
class QSearchField : public QWidget
@ -36,4 +48,6 @@ private:
Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText);
};
#endif // Q_OS_MAC
#endif // QSEARCHFIELD_H

View File

@ -32,6 +32,9 @@ THE SOFTWARE.
#include <QDir>
#include <QDebug>
#if 0
// All the code below isn't used currently (see qsearchfield.h)
class QSearchFieldPrivate : public QObject
{
public:
@ -169,3 +172,5 @@ bool QSearchField::eventFilter(QObject *o, QEvent *e)
}
return QWidget::eventFilter(o, e);
}
#endif // 0

View File

@ -22,6 +22,8 @@
#include <QWidget>
#include "widgets/lineedit.h"
class LineEditInterface;
class Ui_IcecastFilterWidget;

View File

@ -20,6 +20,8 @@
#include <QWidget>
#include "widgets/lineedit.h"
class InternetService;
class DidYouMean;
class Ui_SearchBoxWidget;

View File

@ -23,6 +23,7 @@
#include <boost/scoped_ptr.hpp>
#include "librarymodel.h"
#include "widgets/lineedit.h"
class GroupByDialog;
class SettingsDialog;

View File

@ -21,6 +21,8 @@
#include <QWidget>
#include <QSettings>
#include "widgets/lineedit.h"
class Ui_PlaylistContainer;
class DidYouMean;

View File

@ -27,6 +27,7 @@
#include "core/song.h"
#include "covers/albumcoverloaderoptions.h"
#include "covers/coversearchstatistics.h"
#include "widgets/lineedit.h"
class AlbumCoverChoiceController;
class AlbumCoverFetcher;

View File

@ -20,6 +20,7 @@
#include "covers/albumcoverfetcher.h"
#include "covers/albumcoverloaderoptions.h"
#include "widgets/lineedit.h"
#include <QDialog>
#include <QIcon>

View File

@ -104,6 +104,8 @@ public:
QString text() const { return QLineEdit::text(); }
void set_text(const QString& text) { QLineEdit::setText(text); }
void set_enabled(bool enabled) { QLineEdit::setEnabled(enabled); }
void clear() { LineEditInterface::clear(); }
void setPlaceholderText(const QString& text) { set_hint(text); }
protected:
void paintEvent(QPaintEvent*);