]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
attempt to add scrollarea ...
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Sat, 26 Apr 2014 16:52:36 +0000 (18:52 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Sat, 26 Apr 2014 16:52:36 +0000 (18:52 +0200)
mainwindow.cpp

index d020cf975214f7a89690b6e7f10774f1e36f7e27..c22c272b8fbbfdda417175f8295902fae5ad045c 100644 (file)
@@ -21,9 +21,15 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
         conf->setValue(QString("first"), 1);
     };
     screen=new QWidget(this);
-    scroll=new QScrollArea(screen);
-    grid=new QGridLayout(scroll);
     screen->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+    /*scroll=new QScrollArea;
+    scroll->setWidget(screen);
+    scroll->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+    scroll->setVerticalScrollBarPolicy(2);*/
+    grid=new QGridLayout(screen);
+    grid->setSizeConstraint(QLayout::SetMinimumSize);
+
+
     signalmap=new QSignalMapper(this);
     connect(signalmap, SIGNAL(mapped(const QString &)), this, SLOT(action(const QString &)));
     connect(this, SIGNAL(datafilled()), this, SLOT(start()));
@@ -352,7 +358,7 @@ void MainWindow::getButtons(const QString &a){
     if(updatelocker.tryLock(60000))updatelocker.unlock();
     else{qDebug()<<"updatelocker is locked more than 1mn";}
     QString b="%"+a+"%";
-    QList<QString> tmp({"select label,action from ui where keyword like ?;", b});
+    QList<QString> tmp({"select label,action from ui where keyword like ? order by id;", b});
     label->setText(a);
     exec(tmp);
     int labCol = 0;//r.indexOf("label");
@@ -372,7 +378,7 @@ void MainWindow::chooseButtonDB(){
 }
 void MainWindow::chooseButtonDB(const QString & a){
     flush();
-    qDebug()<<"exec()="<<exec(QList<QString>({"select id,label from ui where keyword like ?;", a}));
+    qDebug()<<"exec()="<<exec(QList<QString>({"select id,label from ui where keyword like ? order by id;", a}));
     while (q->next()) {
         const QString action="edit "+q->value(0).toString();
         addWidget(action, new CLabel(q->value(1).toString(), conf->value(QString("button")).toString()));
@@ -393,7 +399,7 @@ void MainWindow::editButtonDB(const QString & a){
 }
 
 void MainWindow::downloadUi(){
-    qDebug()<<"updateUi() : "<<conf->value(QString("download"), QVariant("https://raw.github.com/Nothing2Do/diary-mobile-android/master/ui.sql")).toString();
+    qDebug()<<"updateUi() : "<<conf->value(QString("download")).toString();
     download(conf->value(QString("download")).toString());
     connect(m, SIGNAL(downloaded()), SLOT(writeUi()));
 }