customwidgets.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _CUSTOMWIDGETS_H_
00028 #define _CUSTOMWIDGETS_H_
00029
00030 #include <QLineEdit>
00031 #include <QPushButton>
00032 #include <QLabel>
00033 #include <QStackedWidget>
00034
00035
00036
00037
00038
00039
00040
00041
00042 class ClickLineEdit : public QLineEdit
00043 {
00044 Q_OBJECT
00045 Q_PROPERTY( QString clickMessage READ clickMessage WRITE setClickMessage )
00046 public:
00047 ClickLineEdit( const QString &msg, QWidget *parent );
00048 virtual ~ClickLineEdit() {};
00049 void setClickMessage( const QString &msg );
00050 QString clickMessage() const { return mClickMessage; }
00051 virtual void setText( const QString& txt );
00052 protected:
00053 virtual void paintEvent( QPaintEvent *e );
00054 virtual void dropEvent( QDropEvent *ev );
00055 virtual void focusInEvent( QFocusEvent *ev );
00056 virtual void focusOutEvent( QFocusEvent *ev );
00057 private:
00058 QString mClickMessage;
00059 bool mDrawClickMsg;
00060 };
00061
00062 class QVLCFramelessButton : public QPushButton
00063 {
00064 Q_OBJECT
00065 public:
00066 QVLCFramelessButton( QWidget *parent = NULL );
00067 QSize sizeHint() const;
00068 protected:
00069 virtual void paintEvent( QPaintEvent * event );
00070 };
00071
00072 class SearchLineEdit : public QLineEdit
00073 {
00074 Q_OBJECT
00075 public:
00076 SearchLineEdit( QWidget *parent = NULL );
00077
00078 private:
00079 void resizeEvent ( QResizeEvent * event );
00080 void focusInEvent( QFocusEvent *event );
00081 void focusOutEvent( QFocusEvent *event );
00082 void paintEvent( QPaintEvent *event );
00083 void setMessageVisible( bool on );
00084 QVLCFramelessButton *clearButton;
00085 bool message;
00086 QLabel *msg;
00087
00088 public slots:
00089 void clear();
00090
00091 private slots:
00092 void updateText( const QString& );
00093 };
00094
00095 class QVLCElidingLabel : public QLabel
00096 {
00097 public:
00098 QVLCElidingLabel( const QString &s = QString(),
00099 Qt::TextElideMode mode = Qt::ElideRight,
00100 QWidget * parent = NULL );
00101 void setElideMode( Qt::TextElideMode );
00102 private:
00103 void paintEvent( QPaintEvent * event );
00104 Qt::TextElideMode elideMode;
00105 };
00106
00107 class QVLCStackedWidget : public QStackedWidget
00108 {
00109 public:
00110 QVLCStackedWidget( QWidget *parent ) : QStackedWidget( parent ) { }
00111 QSize minimumSizeHint () const
00112 {
00113 return currentWidget() ? currentWidget()->minimumSizeHint() : QSize();
00114 }
00115 };
00116
00117
00118
00119 class QKeyEvent;
00120 class QWheelEvent;
00121 class QInputEvent;
00122
00123 int qtKeyModifiersToVLC( QInputEvent* e );
00124 int qtEventToVLCKey( QKeyEvent *e );
00125 int qtWheelEventToVLCKey( QWheelEvent *e );
00126 QString VLCKeyToString( int val );
00127
00128 #endif
00129