Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Passing DB Query data to another Window and show the values in respective fields



  • Hi with the help of Andre, I was able send Selecteditem of QListView to a QLineEdit in next window, now I need to send that Selecteditem's Query information to Second Window's Form fields. Do I need to use QStringList to hold all the information? Or any other way? guide me thanks :)

    Here is the source of firstwindow.cpp:

    @void MainWindow::showValue(){

    GetValue *v = new GetValue(ui->listView->currentIndex().data().toString());
    this->hide();
    v->show();
    v->setWindowTitle("Form Information");
    }
    @

    The Second WIndow's code:

    @GetValue::GetValue(const QString &text,QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::GetValue)
    {
    ui->setupUi(this);
    ui->lineEdit->setText(text);
    }@

    Here I need to show information from first window in the form of a query like: @Select * from User where UserName="Selecteditem";@

    All the information relating to that row will be displayed in the Second Window's fields.


Log in to reply