mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-20 04:41:36 +02:00
BasicHeader's addButton method allows you to add buttons to a header.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <QPixmap>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
#include <QPushButton>
|
||||
#include <QBoxLayout>
|
||||
|
||||
using namespace Tomahawk;
|
||||
@@ -119,6 +120,17 @@ BasicHeader::setPixmap( const QPixmap& pixmap, bool tinted )
|
||||
}
|
||||
|
||||
|
||||
QAbstractButton*
|
||||
BasicHeader::addButton( const QString& text )
|
||||
{
|
||||
QPushButton* button = new QPushButton( this );
|
||||
button->setText( text );
|
||||
ui->horizontalLayout->addWidget( button );
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BasicHeader::resizeEvent( QResizeEvent* event )
|
||||
{
|
||||
|
@@ -40,6 +40,8 @@ public:
|
||||
|
||||
QScopedPointer<Ui::HeaderWidget> ui;
|
||||
|
||||
QAbstractButton* addButton( const QString& text );
|
||||
|
||||
public slots:
|
||||
virtual void setCaption( const QString& s );
|
||||
virtual void setDescription( const QString& s );
|
||||
|
Reference in New Issue
Block a user