Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Passing DB Query data to another Window and show the values in respective fields
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 595 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    highlander
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved