PDA

View Full Version : access to class functions/members in QTabWidget



ithinkso
9th January 2011, 01:44
Hi,

In my program i have class like this:

class WorkingTab : public QWidget

and QTabWidget in a mainwindow where i'm adding WorkingTab into tabs

WorkingTab *newtab = new WorkingTab;
tab_widget->addTab(newtab,"something")

And my question is...how can i access to WorkingTab class public functions/members via QTabWidget? I have no idea, QTabWidget::widget(int) returning only QWidget...i need my own WorkingTab class.

regards

Lykurg
9th January 2011, 08:20
The best would probably be to store the pointer in alocal variable. If not, cast the pointer into a pointer of your class. If they are Qt classes you can use qobject_cast.