[Qt-interest] How to generate specific column depends on SqlQuery ? [Mysql]

Scott Aron Bloom scott at onshorecs.com
Sat Mar 13 05:07:38 CET 2010


Use QSqlTableModel

On Mar 12, 2010, at 5:57 PM, Aaron Lewis wrote:

> Hi,
>   I was wondering how to dynamically create a QTableView.
>
>   e.g  QSqlQuery.exec(select employee_name,employee_id from employees
> where location_id = 110);
>
>   I'd like to create a table , add new column depends on what you
> selects , in this example ,
>   it should be employee_name , employee_id , but how do i know what
> users type in ?
>
> I'm writing a Mysql Front End , want to generate a nice Table from
> user's queries ...
> e.g i have a QLineEdit to receive queries , and a PushButton to
> triggered sql commands.
>
> Any ideas will appreciate. ;-)
>
> -- 
> Best Regards,
> Aaron Lewis - PGP: 0x4A6D32A0
> FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
> irc: A4r0n on freenode
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list