本游戏一共有二十关,你可以从第一关开始接着来,当你完成第一关之后会自动跳到下一关,你还可以直接选择自己想要闯的关卡。进入关卡之后会有一个4*4的网格,里面分布着金币和银币,点击银币它本身和附近的币就会翻面,当网格中只剩金币时,闯关成功。
实现效果:


链接:https://pan.baidu.com/s/1DyG-INZZVFnbaVPzd0EyaQ?pwd=zkh4
提取码:zkh4
mainscene
MainScene::MainScene(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainScene)
{
ui->setupUi(this);
//配置主场景
//设置窗口固定大小
setFixedSize(320,588);
//设置窗口图标
setWindowIcon(QIcon(":/res/Coin0001.png"));
//设置窗口标题
setWindowTitle("翻金币主场景");
//退出按钮实现
connect(ui->actionquit,&QAction::triggered,[=](){
this->close();
});
//准备开始按钮的音效
QSound *startSound=new QSound(":/res/TapButtonSound.wav");
//startSound->setLoops(10); //代表循环次数,如果是-1代表无线循环
startSound->play();
//开始按钮
MyPushButton *startBtn=new MyPushButton(":/res/MenuSceneStartButton.png");
startBtn->setParent(this);
startBtn->move(this->width()*0.35,this->height()*0.7); //移动到合适的位置
//实例化选择关卡场景
chooseSence=new ChooseLevelScene;
//监听选择关卡的返回按钮信号
connect(chooseSence,&ChooseLevelScene::chooseSceneBack,this,[=](){
this->setGeometry(chooseSence->geometry());
chooseSence->hide(); //将选择关卡隐藏掉
this->show(); //重新显示主场景
});
//点击start按钮 实现弹跳效果
connect(startBtn,&MyPushButton::clicked,[=](){
//播放开始音效资源
startSound->play();
//弹跳效果
startBtn->zoom1();
startBtn->zoom2();
//延时进入到选择关卡场景中
QTimer::singleShot(500,this,[=](){ //延时500ms在进行以下操作
//设置chooseScene场景的位置
chooseSence->setGeometry(this->geometry());
//自身隐藏
this->hide();
//显示选择关卡场景
chooseSence->show();
});
});
}
void MainScene::paintEvent(QPaintEvent *)
{
QPainter painter(this); //声明画家
//1、画背景图
QPixmap pix; //声明对象
pix.load(":/res/PlayLevelSceneBg.png"); //在对象中加载图片
painter.drawPixmap(0,0,this->width(),this->height(),pix); //画背景图
//2、画背景上图标
pix.load(":/res/Title.png"); //加载图片
pix=pix.scaled(pix.width()*0.5,pix.height()*0.5); //因图标有点大,所以在这里按比例缩小一倍
painter.drawPixmap(10,30,pix); //画上图标
}
MainScene::~MainScene()
{
delete ui;
}
mypushbutton
MyPushButton::MyPushButton (QString normalImg,QString pressImg)
{
this->normalImgPath=normalImg;
this->pressImgPath=pressImg;
QPixmap pix;
bool ret=pix.load(normalImg);
if(!ret)
{
qDebug()<<"图片加载失败";
return;
}
//设置图片固定大小
this->setFixedSize(pix.width(),pix.height());
//设置不规则图片样式
this->setStyleSheet("QPushButton{border:0px;}");
//设置图标
this->setIcon(pix);
//设置图标大小
this->setIconSize(QSize(pix.width(),pix.height()));
}
void MyPushButton::zoom1()
{
//创建动态对象
QPropertyAnimation *animation=new QPropertyAnimation(this,"geometry");
//设置动画时间间隔
animation->setDuration(200); //200ms
//起始位置
animation->setStartValue(QRect(this->x(),this->y(),this->width(),this->height()));
//结束位置
animation->setEndValue(QRect(this->x(),this->y()+10,this->width(),this->height()));
//设置弹跳曲线
animation->setEasingCurve(QEasingCurve::OutBounce);
//执行动画
animation->start();
}
void MyPushButton::zoom2()
{
//创建动态对象
QPropertyAnimation *animation=new QPropertyAnimation(this,"geometry");
//设置动画时间间隔
animation->setDuration(200); //200ms
//起始位置
animation->setStartValue(QRect(this->x(),this->y()+10,this->width(),this->height()));
//结束位置
animation->setEndValue(QRect(this->x(),this->y(),this->width(),this->height()));
//设置弹跳曲线
animation->setEasingCurve(QEasingCurve::OutBounce);
//执行动画
animation->start();
}
void MyPushButton:: mousePressEvent(QMouseEvent *e)
{
if(this->pressImgPath!=" ") //传入的按下图片不为空 说明需要有按下状态 切换图片
{
QPixmap pix;
bool ret=pix.load(pressImgPath);
if(!ret)
{
qDebug()<<"图片加载失败";
return;
}
//设置图片固定大小
this->setFixedSize(pix.width(),pix.height());
//设置不规则图片样式
this->setStyleSheet("QPushButton{border:0px;}");
//设置图标
this->setIcon(pix);
//设置图标大小
this->setIconSize(QSize(pix.width(),pix.height()));
}
return QPushButton:: mousePressEvent(e);
}
void MyPushButton:: mouseReleaseEvent(QMouseEvent *e)
{
if(this->pressImgPath!=" ") //传入的按下图片不为空 说明需要有按下状态 切换成初始图片
{
QPixmap pix;
bool ret=pix.load(normalImgPath);
if(!ret)
{
qDebug()<<"图片加载失败";
return;
}
//设置图片固定大小
this->setFixedSize(pix.width(),pix.height());
//设置不规则图片样式
this->setStyleSheet("QPushButton{border:0px;}");
//设置图标
this->setIcon(pix);
//设置图标大小
this->setIconSize(QSize(pix.width(),pix.height()));
}
return QPushButton:: mouseReleaseEvent(e);
}
chooselevelscene
ChooseLevelScene::ChooseLevelScene(QWidget *parent) : QMainWindow(parent)
{
//配置选择关卡场景
this->setFixedSize(320,588);
//设置图标
this->setWindowIcon(QPixmap(":/res/Coin0001.png"));
//设置标题
this->setWindowTitle("选择关卡场景");
//创建菜单栏
QMenuBar *bar=menuBar();
setMenuBar(bar);
//创建开始菜单
QMenu *startMenu=bar->addMenu("开始");
//创建退出 菜单项
QAction *quitAction=startMenu->addAction("退出");
//点击退出 实现退出游戏
connect(quitAction,&QAction::triggered,[=](){
this->close();
});
//选择关卡按钮音效
QSound *chooseSound=new QSound(":/res/TapButtonSound.wav");
//返回按钮音效
QSound *backSound=new QSound(":/res/BackButtonSound.wav");
//返回按钮
MyPushButton *backBtn=new MyPushButton(":/res/BackButton.png",":/res/BackButtonSelected.png");
backBtn->setParent(this);
backBtn->move(this->width()-backBtn->width(),this->height()-backBtn->height());
//点击返回
connect(backBtn,&MyPushButton::clicked,[=](){
//播放返回按钮音效
backSound->play();
//qDebug()<<"点击了返回按钮";
//告诉主场景 我返回了,主场景监听ChooseSceneBack的返回按钮
//延时返回
QTimer::singleShot(500,this,[=](){
emit this->chooseSceneBack();
});
});
//创建选择关卡的按钮
for(int i=0;i<20;i++)
{
MyPushButton *menuBtn=new MyPushButton(":/res/LevelIcon.png");
menuBtn->setParent(this);
menuBtn->move(25+i%4*70,130+i/4*70);
//监听每个按钮的点击事件
connect(menuBtn,&MyPushButton::clicked,[=](){
//播放选择关卡音效
chooseSound->play();
QString str=QString("你选择的是第 %1 关").arg(i+1);
qDebug()<<str;
//进入到游戏场景
this->hide(); //将选关场景隐藏掉
play=new PlayScene(i+1); //创建游戏场景
//设置游戏场景的初始位置
play->setGeometry(this->geometry());
play->show(); //显示游戏场景
connect(play,&PlayScene::chooseSceneBack,[=](){
this->setGeometry(play->geometry());
this->show();
delete play;
play=NULL;
});
});
QLabel *label=new QLabel;
label->setParent(this);
label->setFixedSize(menuBtn->width(),menuBtn->height());
label->setText(QString::number(i+1));
label->move(25+i%4*70,130+i/4*70);
//设置label上的文字对齐方式 水平居中和垂直居中
label->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
//设置让鼠标进行穿透 51号属性
label->setAttribute(Qt::WA_TransparentForMouseEvents);
}
}
void ChooseLevelScene::paintEvent(QPaintEvent *)
{
//加载背景
QPainter painter(this);
QPixmap pix;
pix.load(":/res/OtherSceneBg.png");
painter.drawPixmap(0,0,this->width(),this->height(),pix);
//加载需要插入的背景标题图
pix.load(":/res/Title.png");
painter.drawPixmap((this->width()-pix.width())*0.5,30,pix.width(),pix.height(),pix);
}
playscene
PlayScene::PlayScene(int levelNum)
{
QString str=QString("进入了第 %1 关").arg(levelNum);
qDebug()<<str;
this->levelIndex=levelNum;
//初始化游戏场景
//设置固定大小
this->setFixedSize(320,588);
//设置图标
this->setWindowIcon(QPixmap(":/res/Coin0001.png"));
//设置标题
this->setWindowTitle("翻金币场景");
//创建菜单栏
QMenuBar *bar=menuBar();
setMenuBar(bar);
//创建开始菜单
QMenu *startMenu=bar->addMenu("开始");
//创建退出 菜单项
QAction *quitAction=startMenu->addAction("退出");
//点击退出 实现退出游戏
connect(quitAction,&QAction::triggered,[=](){
this->close();
});
//添加音效资源
//返回按钮音效
QSound *backSound=new QSound(":/res/BackButtonSelected.png",this);
//翻金币音效
QSound *flipSound=new QSound(":/res/ConFlipSound.wav",this);
//胜利按钮音效
QSound *winSound=new QSound(":/res/LevelWinSound.wav",this);
//返回按钮
MyPushButton *backBtn=new MyPushButton(":/res/BackButton.png",":/res/BackButtonSelected.png");
backBtn->setParent(this);
backBtn->move(this->width()-backBtn->width(),this->height()-backBtn->height());
//点击返回
connect(backBtn,&MyPushButton::clicked,[=](){
//播放返回按钮音效
backSound->play();
qDebug()<<"翻金币场景中:点击了返回按钮";
QTimer::singleShot(500,this,[=](){
emit this->chooseSceneBack();
});
});
//显示当前关卡数
QLabel *label=new QLabel; //创建QLabel类控件对象
label->setParent(this);
QFont font; //创建字体对象
font.setFamily("华文新魏"); //设置字体
font.setPointSize(20); //设置字号大小
QString str1=QString("Level: %1").arg(this->levelIndex);
label->setFont(font); //将字体设置到标签控件中
label->setText(str1); //设置控件文本( Level: %1 )
label->setGeometry(30,this->height()-50,120,50); //设置控件的大小和位置
dataConfig config;
//初始化每个关卡的二维数组
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
this->gameArray[i][j]=config.mData[this->levelIndex][i][j];
}
}
//胜利图片显示
QLabel *winLabel=new QLabel;
QPixmap temPix;
temPix.load(":/res/LevelCompletedDialogBg.png");
winLabel->setGeometry(0,0,temPix.width(),temPix.height());
winLabel->setPixmap(temPix);
winLabel->setParent(this);
winLabel->move((this->width()-temPix.width()*0.5),-temPix.height());
//显示金币的背景图案
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
//绘制背景图片
QPixmap pix=QPixmap(":/res/BoardNode(1).png");
QLabel *label1=new QLabel;
label1->setGeometry(0,0,pix.width(),pix.height());
label1->setPixmap(pix);
label1->setParent(this);
label1->move(57+i*50,200+j*50);
//创建金币
QString str;
if(this->gameArray[i][j]==1)
{
//显示金币
str=":/res/Coin0001.png";
}
else
{
str=":/res/Coin0008.png";
}
MyCoin *coin=new MyCoin(str);
coin->setParent(this);
coin->move(59+i*50,204+j*50);
//给金币赋值
coin->posX=i;
coin->posY=j;
coin->flag=this->gameArray[i][j]; //1正面 0反面
//将金币放入到 金币的二维数组里 以便于后期的维护
coinBtn[i][j]=coin;
//点击金币 进行翻转
connect(coin,&MyCoin::clicked,[=](){
//翻金币音效
flipSound->play();
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
this->coinBtn[i][j]->isWin=true;
}
}
coin->changeFlag();
this->gameArray[i][j]=this->gameArray[i][j]==0?1:0;
//翻转周围硬币,延时翻转
QTimer::singleShot(300,this,[=](){
//周围的右侧金币反转的条件
if(coin->posX+1<=3)
{
coinBtn[coin->posX+1][coin->posY]->changeFlag();
this->gameArray[coin->posX+1][coin->posY]=this->gameArray[coin->posX+1][coin->posY]==0?1:0;
}
//周围的左侧金币反转的条件
if(coin->posX-1>=0)
{
coinBtn[coin->posX-1][coin->posY]->changeFlag();
this->gameArray[coin->posX-1][coin->posY]=this->gameArray[coin->posX-1][coin->posY]==0?1:0;
}
//周围上侧的金币反转的条件
if(coin->posY+1<=3)
{
coinBtn[coin->posX][coin->posY+1]->changeFlag();
this->gameArray[coin->posX][coin->posY+1]=this->gameArray[coin->posX][coin->posY+1]==0?1:0;
}
//周围上侧的金币反转的条件
if(coin->posY-1>=0)
{
coinBtn[coin->posX][coin->posY-1]->changeFlag();
this->gameArray[coin->posX][coin->posY-1]=this->gameArray[coin->posX][coin->posY-1]==0?1:0;
}
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
this->coinBtn[i][j]->isWin=false;
}
}
//判断是否胜利
this->isWin=true;
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
if(coinBtn[i][j]->flag==false) //只要有一个是反面,那就算失败
{
this->isWin=false;
break;
}
}
}
if(this->isWin==true)
{
//添加胜利音效
winSound->play();
qDebug()<<"游戏胜利";
//将所有按钮的胜利标志改为true 如果再次点击按钮,直接return,不作响应
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
coinBtn[i][j]->isWin=true;
}
}
//将胜利的图片移动下来
QPropertyAnimation *animation=new QPropertyAnimation(winLabel,"geometry");
//设置时间间隔
animation->setDuration(1000);
//设置开始位置
animation->setStartValue(QRect(winLabel->x()-150,winLabel->y(),winLabel->width(),winLabel->height()));
//设置结束位置
animation->setEndValue(QRect(winLabel->x()-150,winLabel->y()+120,winLabel->width(),winLabel->height()));
//设置缓和曲线
animation->setEasingCurve(QEasingCurve::OutBounce);
//执行动画
animation->start();
}
});
});
}
}
}
void PlayScene::paintEvent(QPaintEvent *)
{
//创建背景
QPainter painter(this);
QPixmap pix;
pix.load(":/res/PlayLevelSceneBg.png");
painter.drawPixmap(0,0,this->width(),this->height(),pix);
//加载标题
pix.load(":/res/Title.png");
pix=pix.scaled(pix.width()*0.5,pix.height()*0.5);
painter.drawPixmap(10,30,pix.width(),pix.height(),pix);
}
mycoin
MyCoin::MyCoin(QString btnImg)
{
QPixmap pix;
bool ret=pix.load(btnImg);
if(!ret)
{
QString str=QString("图片 %1 加载失败").arg(btnImg);
qDebug()<<str;
return;
}
this->setFixedSize(pix.width(),pix.height());
this->setStyleSheet("QPushButton{border:0px;}");
this->setIcon(pix);
this->setIconSize(QSize(pix.width(),pix.height()));
//初始化定时器对象
timer1=new QTimer(this);
timer2=new QTimer(this);
//监听正面翻反面的信号,并且翻转金币
connect(timer1,&QTimer::timeout,[=](){
QPixmap pix;
QString str=QString(":/res/Coin000%1.png").arg(this->min++);
pix.load(str);
this->setFixedSize(pix.width(),pix.height());
this->setStyleSheet("QPushButton{border:0px;}");
this->setIcon(pix);
this->setIconSize(QSize(pix.width(),pix.height()));
//判断 如果翻完了,将min重置为1
if(this->min > this->max)
{
this->min=1;
isAnimation=false; //关闭做动画
timer1->stop();
}
});
//监听反面翻正面的信号,并且翻转金币
connect(timer2,&QTimer::timeout,[=](){
QPixmap pix;
QString str=QString(":/res/Coin000%1.png").arg(this->max--);
pix.load(str);
this->setFixedSize(pix.width(),pix.height());
this->setStyleSheet("QPushButton{border:0px;}");
this->setIcon(pix);
this->setIconSize(QSize(pix.width(),pix.height()));
//判断 如果翻完了,将max重置为8
if(this->max < this->min)
{
this->max=8;
isAnimation=false; //关闭做动画
timer2->stop();
}
});
}
//改变正反面标志的方法
void MyCoin::changeFlag()
{
//如果是正面 翻成反面
if(this->flag)
{
//开始正面翻反面的定时器
timer1->start(30);
isAnimation=true; //开始做动画
this->flag=false;
}
else //反面翻正面
{
timer2->start(30);
isAnimation=true; //开始做动画
this->flag=true;
}
}
void MyCoin::mousePressEvent(QMouseEvent *e)
{
if(this->isAnimation|this->isWin)
{
return;
}
else
{
QPushButton::mousePressEvent(e);
}
}
dataconfig
dataConfig::dataConfig(QObject *parent) : QObject(parent)
{
int array1[4][4] = {{1, 1, 1, 1},
{1, 1, 0, 1},
{1, 0, 0, 0},
{1, 1, 0, 1} } ;
QVector< QVector<int>> v;
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array1[i][j]);
}
v.push_back(v1);
}
mData.insert(1,v);
int array2[4][4] = { {1, 0, 1, 1},
{0, 0, 1, 1},
{1, 1, 0, 0},
{1, 1, 0, 1}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array2[i][j]);
}
v.push_back(v1);
}
mData.insert(2,v);
int array3[4][4] = { {0, 0, 0, 0},
{0, 1, 1, 0},
{0, 1, 1, 0},
{0, 0, 0, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array3[i][j]);
}
v.push_back(v1);
}
mData.insert(3,v);
int array4[4][4] = { {0, 1, 1, 1},
{1, 0, 0, 1},
{1, 0, 1, 1},
{1, 1, 1, 1}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array4[i][j]);
}
v.push_back(v1);
}
mData.insert(4,v);
int array5[4][4] = { {1, 0, 0, 1},
{0, 0, 0, 0},
{0, 0, 0, 0},
{1, 0, 0, 1}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array5[i][j]);
}
v.push_back(v1);
}
mData.insert(5,v);
int array6[4][4] = { {1, 0, 0, 1},
{0, 1, 1, 0},
{0, 1, 1, 0},
{1, 0, 0, 1}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array6[i][j]);
}
v.push_back(v1);
}
mData.insert(6,v);
int array7[4][4] = { {0, 1, 1, 1},
{1, 0, 1, 1},
{1, 1, 0, 1},
{1, 1, 1, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array7[i][j]);
}
v.push_back(v1);
}
mData.insert(7,v);
int array8[4][4] = { {0, 1, 0, 1},
{1, 0, 0, 0},
{0, 0, 0, 1},
{1, 0, 1, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array8[i][j]);
}
v.push_back(v1);
}
mData.insert(8,v);
int array9[4][4] = { {1, 0, 1, 0},
{1, 0, 1, 0},
{0, 0, 1, 0},
{1, 0, 0, 1}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array9[i][j]);
}
v.push_back(v1);
}
mData.insert(9,v);
int array10[4][4] = { {1, 0, 1, 1},
{1, 1, 0, 0},
{0, 0, 1, 1},
{1, 1, 0, 1}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array10[i][j]);
}
v.push_back(v1);
}
mData.insert(10,v);
int array11[4][4] = { {0, 1, 1, 0},
{1, 0, 0, 1},
{1, 0, 0, 1},
{0, 1, 1, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array11[i][j]);
}
v.push_back(v1);
}
mData.insert(11,v);
int array12[4][4] = { {0, 1, 1, 0},
{0, 0, 0, 0},
{1, 1, 1, 1},
{0, 0, 0, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array12[i][j]);
}
v.push_back(v1);
}
mData.insert(12,v);
int array13[4][4] = { {0, 1, 1, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 1, 1, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array13[i][j]);
}
v.push_back(v1);
}
mData.insert(13,v);
int array14[4][4] = { {1, 0, 1, 1},
{0, 1, 0, 1},
{1, 0, 1, 0},
{1, 1, 0, 1}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array14[i][j]);
}
v.push_back(v1);
}
mData.insert(14,v);
int array15[4][4] = { {0, 1, 0, 1},
{1, 0, 0, 0},
{1, 0, 0, 0},
{0, 1, 0, 1}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array15[i][j]);
}
v.push_back(v1);
}
mData.insert(15,v);
int array16[4][4] = { {0, 1, 1, 0},
{1, 1, 1, 1},
{1, 1, 1, 1},
{0, 1, 1, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array16[i][j]);
}
v.push_back(v1);
}
mData.insert(16,v);
int array17[4][4] = { {0, 1, 1, 1},
{0, 1, 0, 0},
{0, 0, 1, 0},
{1, 1, 1, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array17[i][j]);
}
v.push_back(v1);
}
mData.insert(17,v);
int array18[4][4] = { {0, 0, 0, 1},
{0, 0, 1, 0},
{0, 1, 0, 0},
{1, 0, 0, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array18[i][j]);
}
v.push_back(v1);
}
mData.insert(18,v);
int array19[4][4] = { {0, 1, 0, 0},
{0, 1, 1, 0},
{0, 0, 1, 1},
{0, 0, 0, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array19[i][j]);
}
v.push_back(v1);
}
mData.insert(19,v);
int array20[4][4] = { {0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}} ;
v.clear();
for(int i = 0 ; i < 4;i++)
{
QVector<int>v1;
for(int j = 0 ; j < 4;j++)
{
v1.push_back(array20[i][j]);
}
v.push_back(v1);
}
mData.insert(20,v);