PDA

View Full Version : QTableView



jamesjara
24th June 2009, 21:08
Lykurg :: a) please also note our Newbie section
ready


QTableView *gridclientes = crearvista(QObject::tr("Mantenimiento"),&tabla);
gridclientes->show();

Hi i am new thanks for the help,
i created a tablegrids for a test application.. but i have a problem
The problem is: i can show my table with gridclientes->show(); , but this is showed like in a modalmessage. How i do to "render" the QTABLEVIEW to a element in the form UI. for example y have a element Layout(QVBoxLayout)..
i want to put the qtableview inside that..

;)

wysota
24th June 2009, 21:46
Call QLayout::addWidget() on the widget.

jamesjara
25th June 2009, 23:33
please can you give a example?

wysota
25th June 2009, 23:55
Layout->addWidget(gridclients);

jamesjara
26th June 2009, 01:24
i tried that buttt always said

error: `Layout' undeclared (first use this function)

spirit
26th June 2009, 07:37
Layout it's a variable which you should create, i.e.


...
MyWidget *myWidget = new MyWidget();
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(myWidget);
...