Well, actually both examples aren't working, it never enters the function_something/activatetab.
More of my code
{
tabWidget->addTab( new Tab_1, tr("Tab_1") );
tabWidget->addTab( new Tab_2, tr("Tab_2") );
tabWidget->addTab( new Tab_3_Tab, tr("Tab_3") );
tabWidget->addTab( new Tab_4, tr("Tab_4") );
//then i used one of connect examples
connect( tabWidget, SIGNAL(tabWidget->currentChanged(int)), this, SLOT( function_something1() ));
//or
connect(tabWidget, SIGNAL(currentChanged(int)), SLOT(activateTab(int)));
mainLayout
->setSizeConstraint
( QLayout::SetFixedSize );
mainLayout->addWidget(tabWidget);
setLayout(mainLayout);
}
...
My_tab::My_tab( QWidget *parent) : QDialog(parent)
{
tabWidget = new QTabWidget;
tabWidget->addTab( new Tab_1, tr("Tab_1") );
tabWidget->addTab( new Tab_2, tr("Tab_2") );
tabWidget->addTab( new Tab_3_Tab, tr("Tab_3") );
tabWidget->addTab( new Tab_4, tr("Tab_4") );
//then i used one of connect examples
connect( tabWidget, SIGNAL(tabWidget->currentChanged(int)), this, SLOT( function_something1() ));
//or
connect(tabWidget, SIGNAL(currentChanged(int)), SLOT(activateTab(int)));
mainLayout = new QVBoxLayout;
mainLayout->setSizeConstraint( QLayout::SetFixedSize );
mainLayout->addWidget(tabWidget);
setLayout(mainLayout);
}
...
To copy to clipboard, switch view to plain text mode
Bookmarks