这是未完成的UI界面(有缺失和不缺失,底下终端显示的是当前获取的随机数)
这是切换扑克图片的函数
QString poke(int num)
{
srand( (unsigned)time(NULL) ); // 设置随机序列的种子
switch(num)
{
case 1 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/14.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/27.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/40.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/53.jpg);}"};
int r = rand() % 4;
return candidates[r];
}
break;
case 2 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/15.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/28.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/41.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/54.jpg);}"};
int r = rand() % 4;
return candidates[r];
}
break;
case 3 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/16.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/29.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/42.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/55.jpg);}"};
int r = rand() % 4;
return candidates[r];
}
break;
case 4 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/17.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/30.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/43.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/56.jpg);}"};
int r = rand() % 4;
return candidates[r];
}
break;
case 5 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/18.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/31.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/44.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/57.jpg);}"};
int r = rand() % 4;
return candidates[r];
}
break;
case 6 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/19.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/32.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/45.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/58.jpg);}"};
int r = rand() % 4;
return candidates[r];
}
break;
case 7 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/20.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/33.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/46.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/59.jpg);}"};
int r = rand() % 4;
return candidates[r];
}
break;
case 8 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/21.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/34.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/47.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/60.jpg);}"};
int r = rand() % 4;
return candidates[r];
}
break;
case 9 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/22.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/35.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/48.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/61.jpg);}"};
int r = rand() % 4;
return candidates[r];
}
break;
case 10 :
{
QString candidates[] = {"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/23.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/36.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/49.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/62.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/24.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/25.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/26.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/11.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/12.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/13.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/37.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/38.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/39.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/50.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/51.jpg);}",
"QLabel{border-image: url(C:/Users/zhongzebin/Desktop/QT_practice/24_game/photo/poke/52.jpg);}"};
int r = rand() % 16;
return candidates[r];
}
break;
default:
break;
}
}
};