mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 05:34:17 +00:00
Now with a picture-button that does a thing
This commit is contained in:
parent
7f6d0c7484
commit
e5c336223c
4 changed files with 22 additions and 0 deletions
|
@ -6,6 +6,12 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
myButton = new QPushButton(this);
|
||||
myButton->setIcon(QIcon(":/res/icon128.png"));
|
||||
myButton->setIconSize(QSize(128, 128));
|
||||
myButton->resize(QSize(128, 128));
|
||||
connect(myButton, &QAbstractButton::clicked, this, &MainWindow::on_actionExit_triggered);
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
|
@ -28,6 +34,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
|||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
delete myButton;
|
||||
}
|
||||
|
||||
void MainWindow::on_actionExit_triggered()
|
||||
|
|
|
@ -24,6 +24,7 @@ private slots:
|
|||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
QAbstractButton *myButton = nullptr;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
@ -34,3 +34,6 @@ HEADERS += \
|
|||
|
||||
FORMS += \
|
||||
mainwindow.ui
|
||||
|
||||
RESOURCES += \
|
||||
resources.qrc
|
||||
|
|
11
resources.qrc
Normal file
11
resources.qrc
Normal file
|
@ -0,0 +1,11 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>res/icon128.png</file>
|
||||
<file>res/ic_add_to_queue_white_48px.svg</file>
|
||||
<file>res/ic_remove_circle_outline_white_48px.svg</file>
|
||||
<file>res/ic_remove_from_queue_white_48px.svg</file>
|
||||
<file>res/ic_tv_white_48px.svg</file>
|
||||
<file>res/ic_videogame_asset_white_48px.svg</file>
|
||||
<file>res/no_app_image.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
Loading…
Reference in a new issue