From: Nothing2Do.fr Date: Wed, 14 Aug 2019 23:07:32 +0000 (+0200) Subject: Qt 5.13 has some cosmetic change X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=4ea9e2f7fb75074c35ae8561916ef2894ae061a4;p=diary-mobile.git Qt 5.13 has some cosmetic change --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 6cb158d..029fe46 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -239,7 +239,7 @@ void MainWindow::action(const QString &a){ if(bs==1){ d=QInputDialog::getText(this, "setInt", tr("Variable's name ?", "text to ask value's name before changing it (setint)"), QLineEdit::Normal, QString(""), &ok); if(!ok)return; - e=QInputDialog::getInt(this, "setInt", d, QLineEdit::Normal, conf->value(d).toInt(), &ok); + e=QInputDialog::getInt(this, "setInt", d, QLineEdit::Normal, conf->value(d).toInt(), *&ok); if(!ok)return; }else if(bs==2){ d=b[1]; @@ -299,7 +299,7 @@ void MainWindow::action(const QString &a){ int max=conf->value(QString("maxcolumn")).toInt()*conf->value(QString("maxline")).toInt(); if(!page)tmp=q->seek(0); else tmp=q->seek(page*(max-2)); - if(deb)QMessageBox::information(this, tr("result", "box title to debug prevpage"), int(tmp)); + //if(deb)QMessageBox::information(this, tr("result", "box title to debug prevpage"), int(tmp)); printItem(*q); } @@ -411,7 +411,8 @@ void MainWindow::action(const QString &a){ for(int i=0; isize();a++){ - addWidget(QString("box "+tmpvalues[a]+"#"), new CLabel(tmpkeys[a], *conf)); + QString tmp("box "+tmpvalues[a]+"#"); + addWidget(tmp, new CLabel(tmpkeys[a], *conf)); //if(deb)QMessageBox::information(this, QString("val"), QString(tmpkeys[a]+"=="+tmpvalues[a])); } }else if(b[1]==QString("edit")){ flush(); for(int a=0;asize();a++){ - addWidget(QString("val "+tmpkeys[a]+"#"), new CLabel(tmpkeys[a], *conf)); + QString tmp("val "+tmpkeys[a]+"#"); + addWidget(tmp, new CLabel(tmpkeys[a], *conf)); //if(deb)QMessageBox::information(this, QString("val"), QString(tmpkeys[a]+"=="+tmpvalues[a])); } }else if(bs==2){ @@ -672,19 +675,19 @@ void MainWindow::firstrun(){ conf->setValue(QString("start"), QVariant("begin")); conf->setValue(QString("restore"), QVariant("http://www.abc.de/db")); conf->setValue(QString("db"), QVariant("/data/data/fr.nothing2do.diarymobile/files/db")); - conf->setValue(QString("selectbuttons"), QVariant("select keyword,label,action from buttons order by id;")); - conf->setValue(QString("sqlbuttons"), QVariant("INSERT INTO buttons (keyword,label,action) VALUES(?,?,?);")); - conf->setValue(QString("selectraw"), QVariant("select date,texte from raw order by date;")); + conf->setValue(QString("selectbuttons"), QVariant("select keyword,label,action from buttons order by id")); + conf->setValue(QString("sqlbuttons"), QVariant("INSERT INTO buttons (keyword,label,action) VALUES(?,?,?)")); + conf->setValue(QString("selectraw"), QVariant("select date,texte from raw order by date")); conf->setValue(QString("menuback"), QVariant("-menuback")); - conf->setValue(QString("choosebuttons"), QVariant("select id,label from buttons where keyword like ? order by label;")); + conf->setValue(QString("choosebuttons"), QVariant("select id,label from buttons where keyword like ? order by label")); conf->setValue(QString("addbuttons"), QVariant("insert into buttons (keyword, label, action) values (:keyword, :label, :action)")); - conf->setValue(QString("addraw"), QVariant("INSERT INTO raw (date, texte) VALUES (:date, :txt);")); - conf->setValue(QString("getbuttons"), QVariant("select label,action,id from buttons where keyword like ? order by label;")); - conf->setValue(QString("editbuttons"), QVariant("select id,keyword,label,action from buttons where id=?;")); - conf->setValue(QString("updatebuttons"), QVariant("update buttons set keyword=?, label=?, action=? where id=?;")); + conf->setValue(QString("addraw"), QVariant("INSERT INTO raw (date, texte) VALUES (:date, :txt)")); + conf->setValue(QString("getbuttons"), QVariant("select label,action,id from buttons where keyword like ? order by label")); + conf->setValue(QString("editbuttons"), QVariant("select id,keyword,label,action from buttons where id=?")); + conf->setValue(QString("updatebuttons"), QVariant("update buttons set keyword=?, label=?, action=? where id=?")); conf->setValue(QString("deletebuttons"), QVariant("delete from buttons where id=?")); - conf->setValue(QString("testbuttons"), QVariant("select id,keyword from buttons where label=? and action=?;")); - conf->setValue(QString("changekeyword"), QVariant("select keyword,label,action,id from buttons where keyword like ?;")); + conf->setValue(QString("testbuttons"), QVariant("select id,keyword from buttons where label=? and action=?")); + conf->setValue(QString("changekeyword"), QVariant("select keyword,label,action,id from buttons where keyword like ?")); conf->setValue(QString("volumdown"), QVariant("back")); conf->setValue(QString("volumup"), QVariant("begin")); conf->setValue(QString("askkeyword"), QVariant(0)); @@ -710,10 +713,10 @@ QString MainWindow::get2(int column){ return qq->value(column).toString(); } int MainWindow::exec(const QList & a){ - qDebug()<<"exec("<prepare: "<prepare(a[0]); + qDebug()<<"exec("<prepare: "<prepare(a.at(0)); for (int j=1; jbindValue(j-1, a[j]); - qDebug()<<"bind "<bindValue(j-1, a.at(j)); + qDebug()<<"bind "<exec(); QSqlError b=q->lastError(); @@ -825,7 +828,7 @@ void MainWindow::chooseDB(const QString & b){ QString c="%"+b+"%", a="buttons"; qDebug()<<"exec()="<({conf->value(QString("choose"+a)).toString(), c})); while (q->next()) { - const QString action="edit "+q->value(0).toString(); + QString action="edit "+q->value(0).toString(); addWidget(action, new CLabel(q->value(1).toString(), *conf)); } } @@ -835,7 +838,7 @@ void MainWindow::chooseDB(const QString & a,const QString & b){ qDebug()<<"exec()="<({conf->value(QString("choose"+a)).toString(), c})); while (q->next()) { - const QString action="edit "+q->value(0).toString(); + QString action="edit "+q->value(0).toString(); addWidget(action, new CLabel(q->value(1).toString(), *conf)); } } @@ -1304,25 +1307,30 @@ void MainWindow::reset(){ QList b({"delete from buttons;"}); exec(b); } -bool MainWindow::printItem(const QSqlQuery & a){ +bool MainWindow::printItem(QSqlQuery & a){ int labCol = 0;//r.indexOf("label"); int actCol = 1;//r.indexOf("action"); int idcol = 2;//r.indexOf("id"); int i=0; qDebug()<<"printItem()"; if(page){ - addWidget(QString("prevpage"), new CLabel(tr("Prev"), *conf)); + QString tmp("prevpage"); + addWidget(tmp, new CLabel(tr("Prev"), *conf)); }; + bool t; do{ int tmp=0; - if(a.isValid())tmp=addWidget(a.value(actCol).toString(), new CLabel(a.value(labCol).toString(), *conf, a.value(idcol).toInt())); + QString tmp4=a.value(actCol).toString(); + if(a.isValid())tmp=addWidget(tmp4, new CLabel(a.value(labCol).toString(), *conf, a.value(idcol).toInt())); if(tmp==1){ - addWidget(QString("nextpage"), new CLabel(tr("Next"), *conf)); + QString tmp3("nextpage"); + addWidget(tmp3, new CLabel(tr("Next"), *conf)); return 1; }; i++; - }while(a.next()); + t=a.next(); + }while(t); qDebug()<<"end printItem : "<