Commit 0734535d authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: misc simplifications and corrections

parent 9123d53b
......@@ -38,7 +38,7 @@
#include <vlc_keys.h>
QVLCFramelessButton::QVLCFramelessButton( QWidget *parent )
: QPushButton( parent )
: QPushButton( parent )
{
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
}
......@@ -51,13 +51,8 @@ void QVLCFramelessButton::paintEvent( QPaintEvent * )
painter.drawPixmap( QRect( pos.x(), pos.y(), pix.width(), pix.height() ), pix );
}
QSize QVLCFramelessButton::sizeHint() const
{
return iconSize();
}
QVLCElidingLabel::QVLCElidingLabel( const QString &s, Qt::TextElideMode mode, QWidget * parent )
: elideMode( mode ), QLabel( s, parent )
: elideMode( mode ), QLabel( s, parent )
{ }
void QVLCElidingLabel::setElideMode( Qt::TextElideMode mode )
......@@ -90,14 +85,6 @@ QString DebugLevelSpinBox::textFromValue( int v ) const
return QString( "%1 (%2)" ).arg( v ).arg( texts[v] );
}
int DebugLevelSpinBox::mapTextToValue ( bool *ok )
{
int parsedvalue = cleanText().toInt();
/* fix range */
*ok = ( parsedvalue < 0 || parsedvalue > 2 )? FALSE : TRUE;
return parsedvalue;
}
/***************************************************************************
* Hotkeys converters
***************************************************************************/
......
......@@ -38,7 +38,7 @@ class QVLCFramelessButton : public QPushButton
Q_OBJECT
public:
QVLCFramelessButton( QWidget *parent = NULL );
QSize sizeHint() const;
virtual QSize sizeHint() const { return iconSize(); }
protected:
virtual void paintEvent( QPaintEvent * event );
};
......@@ -51,11 +51,13 @@ public:
Qt::TextElideMode mode = Qt::ElideRight,
QWidget * parent = NULL );
void setElideMode( Qt::TextElideMode );
protected:
virtual void paintEvent( QPaintEvent * event );
private:
void paintEvent( QPaintEvent * event );
Qt::TextElideMode elideMode;
};
class QVLCStackedWidget : public QStackedWidget
{
public:
......@@ -72,8 +74,9 @@ class DebugLevelSpinBox : public QSpinBox
public:
DebugLevelSpinBox( QWidget *parent ) : QSpinBox( parent ) { };
protected:
QString textFromValue( int ) const;
int mapTextToValue ( bool * );
virtual QString textFromValue( int ) const;
/* DebugLevelSpinBox is read-only */
virtual int valueFromText( const QString& ) const { return -1; }
};
/* VLC Key/Wheel hotkeys interactions */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment