Showing Selected Row in a Search Bar or Another Window, Resizing QFormLayout Widgets
-
Hello great minds,
Please I need your assistance.
I am attaching two photos to this post: 1 shows a desktop application window with widgets inside.
The other is a qTableWidgets that contains every recorded data but outputs only what is searched for.From the application first window, you can see a searchbox and a searchbutton.
Once a word is typed in the searchbox, if the item exists in the database, it will be displayed in the qTableWidget otherwise nothing will be displayed.i) Can anyone teach me with codes example on how I can display the content of a selected row of the qtablewidget in the searchbox of the qTablewidget (you can also see a searchbox in the qTablewidget window).
ii) Can you also teach me how every detail of the selected record can be displayed in the first window as displayed in the photo, with each record showing in the corresponding field of the window showing items details to be captured there.
iii) I would like someone to tell me how I can increase or decrease the length of the qFormLayout rows (the qLineEdit widgets)
Please use some codes to illustrate your point as if you're teaching a beginner so I can understand better.
Thanks
-
Hi,
As already suggested in another of your thread, QFormLayout has the fieldGrowthPolicy property to manage the expansion of the fields.
Since you want to show content of a database, did you already took a look at the QtSql module ?
The QSqlQueryModel allows you to show data based on a query where you can do the filtering at the database level.
Or you can use a QSqlTableModel that directly shows all the content of a table.
All these classes have examples associated with them.
You should start there and then continue with your application.
-
The documentation and the examples that are linked in these pages gives you material to study and test.