[libcalamaresui] Apply coding style to widgets/

This commit is contained in:
Adriaan de Groot 2019-08-13 20:57:52 +02:00
parent 27c3a5a11d
commit 6224d6605b
5 changed files with 16 additions and 20 deletions

View File

@ -23,16 +23,17 @@
ClickableLabel::ClickableLabel( QWidget* parent ) ClickableLabel::ClickableLabel( QWidget* parent )
: QLabel( parent ) : QLabel( parent )
{} {
}
ClickableLabel::ClickableLabel( const QString& text, QWidget* parent ) ClickableLabel::ClickableLabel( const QString& text, QWidget* parent )
: QLabel( text, parent ) : QLabel( text, parent )
{} {
}
ClickableLabel::~ClickableLabel() ClickableLabel::~ClickableLabel() {}
{}
void void
@ -48,5 +49,7 @@ ClickableLabel::mouseReleaseEvent( QMouseEvent* event )
{ {
QLabel::mouseReleaseEvent( event ); QLabel::mouseReleaseEvent( event );
if ( m_time.elapsed() < qApp->doubleClickInterval() ) if ( m_time.elapsed() < qApp->doubleClickInterval() )
{
emit clicked(); emit clicked();
}
} }

View File

@ -42,4 +42,4 @@ private:
QTime m_time; QTime m_time;
}; };
#endif // CLICKABLELABEL_H #endif // CLICKABLELABEL_H

View File

@ -22,21 +22,18 @@
FixedAspectRatioLabel::FixedAspectRatioLabel( QWidget* parent ) FixedAspectRatioLabel::FixedAspectRatioLabel( QWidget* parent )
: QLabel( parent ) : QLabel( parent )
{} {
}
FixedAspectRatioLabel::~FixedAspectRatioLabel() FixedAspectRatioLabel::~FixedAspectRatioLabel() {}
{}
void void
FixedAspectRatioLabel::setPixmap( const QPixmap& pixmap ) FixedAspectRatioLabel::setPixmap( const QPixmap& pixmap )
{ {
m_pixmap = pixmap; m_pixmap = pixmap;
QLabel::setPixmap( pixmap.scaled( QLabel::setPixmap( pixmap.scaled( contentsRect().size(), Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
contentsRect().size(),
Qt::KeepAspectRatio,
Qt::SmoothTransformation ) );
} }
@ -44,9 +41,5 @@ void
FixedAspectRatioLabel::resizeEvent( QResizeEvent* event ) FixedAspectRatioLabel::resizeEvent( QResizeEvent* event )
{ {
Q_UNUSED( event ) Q_UNUSED( event )
QLabel::setPixmap( m_pixmap.scaled( QLabel::setPixmap( m_pixmap.scaled( contentsRect().size(), Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
contentsRect().size(),
Qt::KeepAspectRatio,
Qt::SmoothTransformation ) );
} }

View File

@ -31,11 +31,11 @@ public:
virtual ~FixedAspectRatioLabel() override; virtual ~FixedAspectRatioLabel() override;
public slots: public slots:
void setPixmap( const QPixmap &pixmap ); void setPixmap( const QPixmap& pixmap );
void resizeEvent( QResizeEvent* event ) override; void resizeEvent( QResizeEvent* event ) override;
private: private:
QPixmap m_pixmap; QPixmap m_pixmap;
}; };
#endif // FIXEDASPECTRATIOLABEL_H #endif // FIXEDASPECTRATIOLABEL_H

View File

@ -35,4 +35,4 @@ private:
QLabel* m_waitingLabel; QLabel* m_waitingLabel;
}; };
#endif // WAITINGWIDGET_H #endif // WAITINGWIDGET_H