c++ - QTabWidget not appearing -
i have difficulties create ui.
what need :
1 qtabwidget 3 qwidget tabs. 1 of these widget contains qpushbuttons, qlineedits, , have contain qtabwidget.
my problem :
where i've sucess on other qtabwidget, 1 not appearing. i've manually put qpushbutton , qlineedit in .ui file. want dynamically create qtabwidget on same page.
my page code :
namespace ui { class cimageinterface; } class cimageinterface : public qwidget { q_object public: cimageinterface(); ~cimageinterface(); private: ui::cimageinterface* ui; capptabwidget* tabw_application; };
constructor :
cimageinterface::cimageinterface() : ui(new ui::cimageinterface) { tabw_application = new capptabwidget(this); ui->setupui(this); }
qtabwidget code :
class capptabwidget : public qtabwidget { q_object public: explicit capptabwidget(qwidget* parent); ~capptabwidget(); protected: private: ui::capptabwidget* ui; cappinterface* tab_application; int m_nbtab; };
contructor :
capptabwidget::capptabwidget(qwidget* parent) : ui(new ui::capptabwidget) , tab_application(new cappinterface) , m_nbtab(1) { this->setgeometry(0, 230, 800, 360); this->addtab(tab_application, "app5896"); }
cappinterface qwidget derived class, setupui in constructor. i'm able see qtabwidget show()
i'm not able put inside page.
thanks
thanks thuga helping me.
the solution put layout cimageinterface
, put qtabwidget
in it.
i've faced problem tring create in code, i've put in .ui file.
<layout class="qvboxlayout" name="apptablayout"> <property name="sizeconstraint"> <enum>qlayout::setnoconstraint</enum> </property>
and can :
cimageinterface::cimageinterface() : ui(new ui::cimageinterface) { tabw_application = new capptabwidget(this); ui->setupui(this); ui->apptablayout->addwidget(tabw_application); }
Comments
Post a Comment