Qt Code:
{ Q_OBJECT public: ~test(){} private: Ui::test ui; };To copy to clipboard, switch view to plain text mode
Qt Code:
{ ui.setupUi(this); rt->setColumnCount(4); rt->setRowCount(10); rt->setRowHeight(0, 22); rt->verticalHeader()->hide(); hv->addWidget(rt); setLayout(hv); }To copy to clipboard, switch view to plain text mode
If your designer UI is empty, which it must be since none of its contents would be added to the layout, why have the instance at all?
Cheers,
_
you are right. I am not sure what exactly the problem was, but removing all the designer stuff makes it work.
Essentially we end up with this:
class abc : public QWidget
{
public:
abc(QWidget* p = 0) : QWidget(p)
{
QHBoxLayout* lay = new QHBoxLayout(this);
QTableWidget* tw = new QTableWidget();
tw->setColumnCount(8);
tw->setRowCount(20);
lay->addWidget(tw);
setLayout(lay);
}
};
and that works fine. thanks for your help!
tuli (20th August 2014)
Bookmarks