From be71b229889000e0a43e5bd99ba2482bbdea5fe6 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Wed, 3 Jun 2015 14:08:56 +0200 Subject: [PATCH] few bug with the new "page" function --- mainwindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 44cef52..2ba9746 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -172,15 +172,10 @@ int unsigned MainWindow::addWidget(const QString &key, const CLabel *a){ grid->addWidget(a, c/maxc, c%maxc, 1, 1, Qt::AlignJustify| Qt::AlignVCenter | Qt::AlignHCenter); QObject::connect(a, SIGNAL(released()), signalmap, SLOT(map())); signalmap->setMapping(a, key); - //if(c==(maxc*maxl)-1)return 1; + if(c==(maxc*maxl)-2)return 1; //(p-1)*(ml*mc)+c nombre de boutons en tout osef, - if((c==((maxc*maxl)-1))&&(!np)){ - np=1; - CLabel * next=new CLabel(QString("Next page"), *conf); - addWidget(QString("nextpage"), next); - return 1; - } + return 0; } @@ -696,6 +691,7 @@ void MainWindow::get(const QString & d, const QString &b){ QList tmp({x, c}); label->setText(a); exec(tmp); + page=0; //while(q->next()){ printItem(); //} @@ -1162,10 +1158,14 @@ bool MainWindow::printItem(){ qDebug()<<"printItem()"; if(page){ addWidget(QString("prevpage"), new CLabel(trUtf8("Prev."), *conf)); + }; while(q->next()){ int tmp=addWidget(q->value(actCol).toString(), new CLabel(q->value(labCol).toString(), *conf)); - if(tmp==1)return 1; + if(tmp==1){ + addWidget(QString("nextpage"), new CLabel(trUtf8("Next."), *conf)); + break; + }; i++; }; //grid->update(); -- 2.45.1