Important: Please read the Qt Code of Conduct -

Qt formulary in QGis

  • Hello,
    I’m new to Qt so sorry if the question is basic!
    I did a formulary with qt designer, and after I change a little bit the code (the .h and the .cpp) because I want a formulary with two ComboBox relationated. I mean depending on the choice in the first ComboBox the choice list in the second one change.
    My formulary work in Qt, when I test it all is OK but when I try to use it in QGIS it doesn’t works: choice in the second ComboBox never appears. My columns in the QGIS table have the same name as the ComboBox.
    Can you help me?
    Thanks and sorry for my (terrible) English!


  • Moderators

    Do you have some code? Without code it is really hard to guess what might be going wrong.

  • Ok,
    this is for example my .h
    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    ui(new Ui::MainWindow)
    connect(ui->comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(changeLinkedComboBox(QString)));

    //init linkedComboBox avec la valeur A de comboBox


    delete ui;

    void MainWindow::changeLinkedComboBox(QString text)
    QStringList listItems;
    if (text == QString("A"))
    listItems << "a1" << "a2";
    listItems << "b1" << "b2";




    I thik QGIS only read the .ui and note the .h and .cpp at the same time right?

    Edit: please use @ tags around code sections; Andre

Log in to reply