Commit f043388c authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: rename utility classes

Depending whether they are VLC specific or not
parent 377ea495
......@@ -54,7 +54,7 @@ void SelectorActionButton::paintEvent( QPaintEvent *event )
int frame = style()->pixelMetric( QStyle::PM_DefaultFrameWidth, 0, this );
p.drawLine( rect().topLeft() + QPoint( 0, frame ),
rect().bottomLeft() - QPoint( 0, frame ) );
QVLCFramelessButton::paintEvent( event );
QFramelessButton::paintEvent( event );
}
PLSelItem::PLSelItem ( QTreeWidgetItem *i, const QString& text )
......@@ -64,7 +64,7 @@ PLSelItem::PLSelItem ( QTreeWidgetItem *i, const QString& text )
layout->setContentsMargins(0,0,0,0);
layout->addSpacing( 3 );
lbl = new QVLCElidingLabel( text );
lbl = new QElidingLabel( text );
layout->addWidget(lbl, 1);
int height = qMax( 22, fontMetrics().height() + 8 );
......
......@@ -30,7 +30,7 @@
#endif
#include "qt4.hpp"
#include "util/customwidgets.hpp" /* QVLCFramelessButton */
#include "util/customwidgets.hpp" /* QFramelessButton */
#include <QTreeWidget>
......@@ -68,7 +68,7 @@ enum ItemAction {
};
class SelectorActionButton : public QVLCFramelessButton
class SelectorActionButton : public QFramelessButton
{
protected:
virtual void paintEvent( QPaintEvent * );
......@@ -101,7 +101,7 @@ private:
inline void leaveEvent( QEvent* ){ hideAction(); }
QTreeWidgetItem* qitem;
QVLCFramelessButton* lblAction;
QFramelessButton* lblAction;
QLabel* lbl;
QHBoxLayout* layout;
};
......
......@@ -49,7 +49,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="DebugLevelSpinBox" name="verbosityBox">
<widget class="QVLCDebugLevelSpinBox" name="verbosityBox">
<property name="wrapping">
<bool>true</bool>
</property>
......@@ -119,7 +119,7 @@
</widget>
<customwidgets>
<customwidget>
<class>DebugLevelSpinBox</class>
<class>QVLCDebugLevelSpinBox</class>
<extends>QSpinBox</extends>
<header>util/customwidgets.hpp</header>
</customwidget>
......
......@@ -38,13 +38,13 @@
#include <QPixmap>
#include <vlc_keys.h>
QVLCFramelessButton::QVLCFramelessButton( QWidget *parent )
QFramelessButton::QFramelessButton( QWidget *parent )
: QPushButton( parent )
{
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
}
void QVLCFramelessButton::paintEvent( QPaintEvent * )
void QFramelessButton::paintEvent( QPaintEvent * )
{
QPainter painter( this );
QPixmap pix = icon().pixmap( size() );
......@@ -52,17 +52,17 @@ void QVLCFramelessButton::paintEvent( QPaintEvent * )
painter.drawPixmap( QRect( pos.x(), pos.y(), pix.width(), pix.height() ), pix );
}
QVLCElidingLabel::QVLCElidingLabel( const QString &s, Qt::TextElideMode mode, QWidget * parent )
QElidingLabel::QElidingLabel( const QString &s, Qt::TextElideMode mode, QWidget * parent )
: elideMode( mode ), QLabel( s, parent )
{ }
void QVLCElidingLabel::setElideMode( Qt::TextElideMode mode )
void QElidingLabel::setElideMode( Qt::TextElideMode mode )
{
elideMode = mode;
repaint();
}
void QVLCElidingLabel::paintEvent( QPaintEvent * event )
void QElidingLabel::paintEvent( QPaintEvent * event )
{
QPainter p( this );
int space = frameWidth() + margin();
......@@ -70,7 +70,7 @@ void QVLCElidingLabel::paintEvent( QPaintEvent * event )
p.drawText( r, fontMetrics().elidedText( text(), elideMode, r.width() ), alignment() );
}
QString DebugLevelSpinBox::textFromValue( int v ) const
QString QVLCDebugLevelSpinBox::textFromValue( int v ) const
{
QString const texts[] = {
/* Note that min level 0 is 'errors' in Qt Ui
......
......@@ -36,21 +36,21 @@
#include <QTimer>
class QPixmap;
class QVLCFramelessButton : public QPushButton
class QFramelessButton : public QPushButton
{
Q_OBJECT
public:
QVLCFramelessButton( QWidget *parent = NULL );
QFramelessButton( QWidget *parent = NULL );
virtual QSize sizeHint() const { return iconSize(); }
protected:
virtual void paintEvent( QPaintEvent * event );
};
class QVLCElidingLabel : public QLabel
class QElidingLabel : public QLabel
{
public:
QVLCElidingLabel( const QString &s = QString(),
QElidingLabel( const QString &s = QString(),
Qt::TextElideMode mode = Qt::ElideRight,
QWidget * parent = NULL );
void setElideMode( Qt::TextElideMode );
......@@ -71,14 +71,14 @@ public:
}
};
class DebugLevelSpinBox : public QSpinBox
class QVLCDebugLevelSpinBox : public QSpinBox
{
Q_OBJECT
public:
DebugLevelSpinBox( QWidget *parent ) : QSpinBox( parent ) { };
QVLCDebugLevelSpinBox( QWidget *parent ) : QSpinBox( parent ) { };
protected:
virtual QString textFromValue( int ) const;
/* DebugLevelSpinBox is read-only */
/* QVLCDebugLevelSpinBox is read-only */
virtual int valueFromText( const QString& ) const { return -1; }
};
......
......@@ -106,7 +106,7 @@ void ClickLineEdit::focusOutEvent( QFocusEvent *ev )
#ifndef Q_WS_MAC
SearchLineEdit::SearchLineEdit( QWidget *parent ) : QLineEdit( parent )
{
clearButton = new QVLCFramelessButton( this );
clearButton = new QFramelessButton( this );
clearButton->setIcon( QIcon( ":/toolbar/clear" ) );
clearButton->setIconSize( QSize( 16, 16 ) );
clearButton->setCursor( Qt::ArrowCursor );
......
......@@ -69,7 +69,7 @@ private:
#endif
#ifndef Q_WS_MAC
class QVLCFramelessButton;
class QFramelessButton;
class SearchLineEdit : public QLineEdit
{
Q_OBJECT
......@@ -82,7 +82,7 @@ private:
void focusOutEvent( QFocusEvent *event );
void paintEvent( QPaintEvent *event );
void setMessageVisible( bool on );
QVLCFramelessButton *clearButton;
QFramelessButton *clearButton;
bool message;
public slots:
......
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