File tree Expand file tree Collapse file tree 5 files changed +16
-12
lines changed Expand file tree Collapse file tree 5 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 2
2
#include < QString>
3
3
#include < QTabWidget>
4
4
#include < QTabBar>
5
+ #include < QPixmap>
5
6
6
7
extern " C" {
7
8
#include < libavformat/avformat.h>
@@ -24,11 +25,12 @@ extern "C" {
24
25
#define PROGRAM_VER " <html><head/><body><p><span style=\" font-size:12pt;\" >%1</span></p></body></html>"
25
26
#define ABOUT_HTML " <html><head/><body><p>%1</p><p>%2</p></body></html>"
26
27
27
- AboutDialog::AboutDialog (const Config &config, QWidget *parent) :
28
+ AboutDialog::AboutDialog (const Config &config, const QPixmap &icon, QWidget *parent) :
28
29
QDialog(parent),
29
30
ui(std::make_unique<Ui::AboutDialog>())
30
31
{
31
32
ui->setupUi (this );
33
+ ui->label ->setPixmap (icon);
32
34
ui->tabs ->setCurrentIndex (0 );
33
35
ui->program_ver ->setText (QString (PROGRAM_VER).arg (QString (tr (" Version %1" )).arg (
34
36
#ifdef PROJECT_VERSION_GIT
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ namespace Ui {
10
10
class AboutDialog ;
11
11
}
12
12
class QLabel ;
13
+ class QPixmap ;
13
14
14
15
class AboutDialog : public QDialog
15
16
{
@@ -22,6 +23,6 @@ class AboutDialog : public QDialog
22
23
23
24
public:
24
25
void closeEvent (QCloseEvent *event) override { event->accept (); }
25
- explicit AboutDialog (const Config &config, QWidget *parent = nullptr );
26
+ explicit AboutDialog (const Config &config, const QPixmap &icon, QWidget *parent = nullptr );
26
27
~AboutDialog () override ;
27
28
};
Original file line number Diff line number Diff line change 20
20
#include < QStyle>
21
21
#include < QStyleOption>
22
22
#include < QIcon>
23
+ #include < QPixmap>
24
+
23
25
#include < fmt/core.h>
24
26
#include < fmt/chrono.h>
25
-
26
27
#include " main.hpp"
27
28
#include " sync.hpp"
28
29
#include " config.hpp"
36
37
#define LOG_FILENAME EXECUTABLE_NAME " .log"
37
38
38
39
Application::Application (QWidget *parent) :
39
- QMainWindow(parent),
40
- ui(std::make_unique<Ui::MainWindow>()),
41
- config(std::make_unique<Config>()),
42
- style(QApplication::style()),
43
- settings(EXECUTABLE_NAME, EXECUTABLE_NAME)
40
+ QMainWindow(parent),
41
+ ui(std::make_unique<Ui::MainWindow>()),
42
+ icon(std::make_unique<QPixmap>(" :/icons/easyaudiosync256.png" )),
43
+ config(std::make_unique<Config>()),
44
+ style(QApplication::style()),
45
+ settings(EXECUTABLE_NAME, EXECUTABLE_NAME)
44
46
{
45
47
config->check_features ();
46
48
config->load (settings);
@@ -214,7 +216,7 @@ void Application::on_action_settings_triggered()
214
216
215
217
void Application::on_action_about_triggered ()
216
218
{
217
- auto dialog = new AboutDialog (*config, this );
219
+ auto dialog = new AboutDialog (*config, *icon, this );
218
220
dialog->setAttribute (Qt::WA_DeleteOnClose, true );
219
221
dialog->setModal (true );
220
222
dialog->show ();
Original file line number Diff line number Diff line change 19
19
class Sync ;
20
20
struct Config ;
21
21
class QLineEdit ;
22
+ class QPixmap ;
22
23
23
24
namespace Ui {
24
25
class MainWindow ;
@@ -52,6 +53,7 @@ public slots:
52
53
53
54
private:
54
55
std::unique_ptr<Ui::MainWindow> ui;
56
+ std::unique_ptr<QPixmap> icon;
55
57
std::unique_ptr<Config> config;
56
58
QStyle *style;
57
59
QSettings settings;
Original file line number Diff line number Diff line change 39
39
<property name =" text" >
40
40
<string />
41
41
</property >
42
- <property name =" pixmap" >
43
- <pixmap resource =" ../../assets/icons/icons.qrc" >:/icons/easyaudiosync256.png</pixmap >
44
- </property >
45
42
<property name =" scaledContents" >
46
43
<bool >true</bool >
47
44
</property >
You can’t perform that action at this time.
0 commit comments