Add tab (QtabWidget defined in UI file)
Hei,
I have a problem, designing my GUI in QtDesigner and adding QTabWidget, because it add tab's in there (UI file no tab's).
Code:
Code:
connect( pushButton, SIGNAL(clicked()), this, SLOT(addChatTab("Name")) );
Code:
void MyClass
::addChatTab( QString name
) {
tabWidget->addTab( newTab, ( name ) );
}
And if I clicked this button no tab's appering.
Re: Add tab (QtabWidget defined in UI file)
The following is not possible:
Code:
connect( pushButton, SIGNAL(clicked()), this, SLOT(addChatTab("Name")) );
A slot can have maximum the same amount of parameters as the signal.
Re: Add tab (QtabWidget defined in UI file)
Ok now works! If i remove QString param!
I can't either one param in slot?
Re: Add tab (QtabWidget defined in UI file)
Code:
void MyClass::addChatTab()
{
mainLayout->addWidget(fileNameLabel);
setLayout(mainLayout);
tabWidget->addTab( newTab, ( "New tab" ) );
}
How to add buttons/layout or something tabWidget, now it not works!