diff --git a/mainwindow.cpp b/mainwindow.cpp index 41a26bd..f17771b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -6,6 +6,7 @@ MainWindow::MainWindow(QWidget *parent) , ui(new Ui::MainWindow) { ui->setupUi(this); + initMainWindow(); // 初始化界面 } MainWindow::~MainWindow() @@ -13,3 +14,23 @@ MainWindow::~MainWindow() delete ui; } +void MainWindow::initMainWindow() +{ + setWindowTitle("音乐播放器"); + ui->song_list_widget->setAttribute(Qt::WA_TranslucentBackground); + ui->label_artist->setAttribute(Qt::WA_TranslucentBackground); + ui->label_song_list->setAttribute(Qt::WA_TranslucentBackground); + ui->label_song_name->setAttribute(Qt::WA_TranslucentBackground); + ui->label_meta_album->setAttribute(Qt::WA_TranslucentBackground); + ui->contrl_widget->setAttribute(Qt::WA_TranslucentBackground); + ui->widget_show->setAttribute(Qt::WA_TranslucentBackground); + ui->volume_widget->setAttribute(Qt::WA_TranslucentBackground); + ui->widget_3->setAttribute(Qt::WA_TranslucentBackground); + ui->time_left_label->setAttribute(Qt::WA_TranslucentBackground); + ui->time_right_label->setAttribute(Qt::WA_TranslucentBackground); + + ui->time_slider->setStyleSheet("QSlider::groove:horizontal { background-color: white; }" + "QSlider::handle:horizontal { background-color: blue; width: 20px;}"); + ui->volume_slider->setStyleSheet("QSlider::groove:horizontal { background-color: gray; }" + "QSlider::handle:horizontal { background-color: yellow; width: 20px;}"); +} diff --git a/mainwindow.h b/mainwindow.h index 4643e32..c23167a 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -15,6 +15,9 @@ public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); +public: + void initMainWindow(); + private: Ui::MainWindow *ui; }; diff --git a/mainwindow.ui b/mainwindow.ui index b232854..b48c321 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,17 +6,364 @@ 0 0 - 800 - 600 + 1055 + 750 MainWindow - - + + background-image: url(:/img/background5); + + + + + + 50 + 150 + 581 + 391 + + + + font: 12pt "微软雅黑";color: rgb(255, 255, 0); +background-image: url(:/img/background2); + + + + + + 750 + 80 + 241 + 461 + + + + color: rgb(255, 255, 0); + + + + 新建项目 + + + + + 新建项目 + + + + + 新建项目 + + + + + + + 190 + 100 + 111 + 31 + + + + font: 10pt "微软雅黑"; +color: rgb(255, 255, 0); + + + 歌手 + + + Qt::AlignCenter + + + + + + 240 + 30 + 221 + 41 + + + + font: 16pt "微软雅黑"; +color: rgb(255, 255, 0); + + + 歌名 + + + Qt::AlignCenter + + + + + + 380 + 100 + 111 + 31 + + + + font: 10pt "微软雅黑";color: rgb(255, 255, 0); + + + 专辑 + + + Qt::AlignCenter + + + + + + 800 + 30 + 141 + 41 + + + + font: 18pt "微软雅黑";color: rgb(255, 255, 0); + + + 歌曲列表 + + + Qt::AlignCenter + + + + + + 110 + 590 + 471 + 74 + + + + + + + ... + + + + :/icon/back:/icon/back + + + + 50 + 50 + + + + + + + + ... + + + + :/icon/last:/icon/last + + + + 50 + 50 + + + + + + + + ... + + + + :/icon/button_play:/icon/button_play + + + + 50 + 50 + + + + + + + + ... + + + + :/icon/next:/icon/next + + + + 50 + 50 + + + + + + + + ... + + + + :/icon/front:/icon/front + + + + 50 + 50 + + + + + + + + + + 130 + 550 + 421 + 20 + + + + Qt::Horizontal + + + + + + 760 + 550 + 219 + 120 + + + + + + + Qt::Horizontal + + + + + + + + + + ... + + + + :/icon/mute2:/icon/mute2 + + + + 50 + 50 + + + + + + + + ... + + + + :/icon/volume0:/icon/volume0 + + + + 50 + 50 + + + + + + + + ... + + + + :/icon/volume1:/icon/volume1 + + + + 50 + 50 + + + + + + + + + + + + + 40 + 550 + 72 + 15 + + + + TextLabel + + + + + + 570 + 550 + 72 + 15 + + + + TextLabel + + + + + + + 0 + 0 + 1055 + 26 + + + - + + +