Skip to content

Commit

Permalink
over!
Browse files Browse the repository at this point in the history
  • Loading branch information
Sugar0612 committed Jun 13, 2021
1 parent 85a1ff2 commit 0d1b39f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
Binary file modified coin/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions create_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ create_list::create_list(QWidget *parent) : QWidget(parent)
name ->setGeometry(40, 40, 200, 40);

ok = new QPushButton(this);
ok ->setText("ok");
ok ->setText("确定");
ok ->setGeometry(40, 100, 70, 40);

cancel = new QPushButton(this);
cancel ->setText("cancel");
cancel ->setGeometry(120, 100, 70, 40);
cancel ->setText("取消");
cancel ->setGeometry(180, 100, 70, 40);

connect(ok, &QPushButton::clicked, [=] () {
this ->hide();
Expand Down
7 changes: 4 additions & 3 deletions lrc_win_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ lrc_win_main::lrc_win_main(QWidget *parent) : QWidget(parent)
QFont font;
font.setFamily("幼圆");
font.setPointSize(20);

font.setWeight(25);
setWindowFlag(Qt::FramelessWindowHint); // 删除以前的 最大化 最小化 关闭自己写

this ->resize(400, 80);

this ->resize(500, 80);

this->setWindowFlags(Qt::FramelessWindowHint); //使得窗体透明
this->setAttribute(Qt::WA_TranslucentBackground, true); // 透明显示
Expand All @@ -21,7 +22,7 @@ lrc_win_main::lrc_win_main(QWidget *parent) : QWidget(parent)
l = new QLabel(this);
l ->setGeometry(0, 0, this ->width(), this ->height());
l ->setFont(font);
l ->setStyleSheet("QLabel{color: white;}");
l ->setStyleSheet("QLabel{color: rgb(128, 0, 128);}");
l ->setText("糖糖音乐");
}

Expand Down
12 changes: 7 additions & 5 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi

search_line = new QLineEdit(btnL); // 搜索框
search_line ->setGeometry(180, 18, 180, 40);
search_line ->setStyleSheet("QLineEdit{border-style:none; padding:6px; border-radius: 50px;}");

//登录按钮
sign_in_btn = new mybtn(":/coin/sign_in.png", ":/coin/sign_in_c.png");
Expand Down Expand Up @@ -265,7 +266,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
tab_search ->setHorizontalHeaderLabels(list_col_table);// 设置列数的 名字
tab_search ->setGeometry(musiclist->width(), btnL ->height(), this ->width() - musiclist ->width(), this ->height() - btnL ->height() - 100);
tab_search ->stackUnder(songlist); // 优先级在songlist 之下
tab_search ->setSelectionBehavior(QAbstractItemView::SelectRows); //设置整行选择
tab_search ->hide();

tab_search ->setEditTriggers(QAbstractItemView::NoEditTriggers); // 不可编辑
Expand Down Expand Up @@ -656,7 +656,7 @@ void MainWindow::initPro() {

int idx = lrc_idx[j.key()]; // 找到item
int p_idx = p_lrcit == lrcMap.begin() - 1 ? -1 : lrc_idx[p_lrcit.key()]; // 找到上一个item

lrc ->l ->setText(lrc_itm[idx] ->text()); // 将内嵌歌词窗口的 歌词 给主窗口歌词
//恢复之前歌词字体大小
if(p_idx >= 0) {
lrc_itm[p_idx] ->setFont(p_font);
Expand Down Expand Up @@ -689,10 +689,13 @@ void MainWindow::initPro() {
void MainWindow::initMysql() {
db = QSqlDatabase::addDatabase("QMYSQL"); // 加载mysql 驱动
db.setHostName("localhost"); // 主机名
db.setPort(3306); // 端口
db.setDatabaseName("musicbase"); // 库名
db.setUserName("root"); //用户名
db.setPassword("tsy20010612"); // 密码
db.open(); //打开数据库
bool ok = db.open(); //打开数据库
if (ok) qDebug() << "connect ok!" << endl;

}

// 用来 单独封装控制 播放
Expand Down Expand Up @@ -1505,8 +1508,7 @@ void MainWindow::play_net_Music(int row, int col) {

// 收藏到 歌单
else if (col == 5) {
in_list = 1; // 收藏
is_insert = 0; // 不插入播放队列
in_list = 1; // 收藏不插入播放队列
g_row = row;
} else return;

Expand Down

0 comments on commit 0d1b39f

Please sign in to comment.