mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 03:27:40 +01:00
Typedef QSearchField to old LineEdit on non Mac, and make it compatible with QSearchField
Fixes issue 3047. (for now)
This commit is contained in:
parent
0558c7bf69
commit
59517f5b4e
14
3rdparty/qocoa/qsearchfield.h
vendored
14
3rdparty/qocoa/qsearchfield.h
vendored
@ -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
|
||||
|
5
3rdparty/qocoa/qsearchfield_nonmac.cpp
vendored
5
3rdparty/qocoa/qsearchfield_nonmac.cpp
vendored
@ -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
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "widgets/lineedit.h"
|
||||
|
||||
class LineEditInterface;
|
||||
class Ui_IcecastFilterWidget;
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "widgets/lineedit.h"
|
||||
|
||||
class InternetService;
|
||||
class DidYouMean;
|
||||
class Ui_SearchBoxWidget;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include "librarymodel.h"
|
||||
#include "widgets/lineedit.h"
|
||||
|
||||
class GroupByDialog;
|
||||
class SettingsDialog;
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <QWidget>
|
||||
#include <QSettings>
|
||||
|
||||
#include "widgets/lineedit.h"
|
||||
|
||||
class Ui_PlaylistContainer;
|
||||
|
||||
class DidYouMean;
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "core/song.h"
|
||||
#include "covers/albumcoverloaderoptions.h"
|
||||
#include "covers/coversearchstatistics.h"
|
||||
#include "widgets/lineedit.h"
|
||||
|
||||
class AlbumCoverChoiceController;
|
||||
class AlbumCoverFetcher;
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "covers/albumcoverfetcher.h"
|
||||
#include "covers/albumcoverloaderoptions.h"
|
||||
#include "widgets/lineedit.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QIcon>
|
||||
|
@ -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*);
|
||||
|
Loading…
x
Reference in New Issue
Block a user