From 1419f1d2e5dea02f3235ac634f5fbda6ca5518af Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Wed, 5 Nov 2014 17:29:18 +0100 Subject: [PATCH] I've added "printItem()" (to print maxc*maxl-2 buttons on each page) --- mainwindow.cpp | 39 ++++++++++++++++++++------------------- mainwindow.h | 2 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 291b3ff..8b4297b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -162,7 +162,7 @@ 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; //p*(ml*mc)+c nombre de boutons en tout osef, /* if((c==((maxc*maxl)-1))&&(!np)){ @@ -664,23 +664,9 @@ void MainWindow::get(const QString & d, const QString &b){ QList tmp({x, c}); label->setText(a); exec(tmp); - int labCol = 0;//r.indexOf("label"); - int actCol = 1;//r.indexOf("action"); - int i=0; - qDebug()<<"bcl to add buttons"; - if(page){ - addWidget(QString("prevpage"), new CLabel(trUtf8("Prev."), *conf)); - } - //grid->count()%(maxl*maxc)!=0) here while(q->next()){ - int tmp=addWidget(q->value(actCol).toString(), new CLabel(q->value(labCol).toString(), *conf)); - if(tmp==1)break; - i++; - }; - grid->update(); - //scroll->updateGeometry(); - screen->updateGeometry(); - qDebug()<<"end getButtons : "<setVideoOutput(videoWidget); - videoWidget->show(); grid->addWidget(videoWidget,0,0,1,-1); connect(video, SIGNAL(videoAvailableChanged(bool)), video, SLOT(play())); @@ -1105,6 +1090,22 @@ void MainWindow::reset(){ QList b({"delete from buttons;"}); exec(b); } -bool MainWindow::printItem(const QString & key, const CLabel * a){ +bool MainWindow::printItem(){ + int labCol = 0;//r.indexOf("label"); + int actCol = 1;//r.indexOf("action"); + int i=0; + qDebug()<<"bcl to add buttons"; + 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)break; + i++; + }; + grid->update(); + //scroll->updateGeometry(); + screen->updateGeometry(); + qDebug()<<"end getButtons : "<