KDialog, tabs, get active tab pushbuttons, qradiobuttons
Hei!
Small ui file -> contains QTabWidget
And cpp file I'm adding radiobuttons.
How to get active radiobuttons and something?
Code:
newTab is
QWidget (QRadioButtons etc
)
: KDialog()
, Ui::MyWindow()
{
.....
QRadioButtons
.....
newTab->setLayout( layout );
tabWidget->addTab( newTab, name );
.....
}
Re: KDialog, tabs, get active tab pushbuttons, qradiobuttons
Loop through your radio buttons and check if they are selected. And you might want give KDialog a parent.
Re: KDialog, tabs, get active tab pushbuttons, qradiobuttons
Ok, how to get active tab's qradiobuttons? I call this class many times (and everytime opens new tab, wich contains radiobuttons etc).
Re: KDialog, tabs, get active tab pushbuttons, qradiobuttons
How to loop QRadioButtons?
Re: KDialog, tabs, get active tab pushbuttons, qradiobuttons
All your objects have names, use those to check each and every radio button.
myRadioButton->isChecked();
myRadioButton->setChecked(true or false);
Change myRadioButton with the name of another radio button etc...
Now, if you want to make it yourself a lot easier, create a list of radiobuttons.
Code:
QList<QRadioButton *> myRadioButtons;
myRadioButtons.append(newRadioButton);
etc...
if (button->isChecked()) {
// do something
}
}
Re: KDialog, tabs, get active tab pushbuttons, qradiobuttons
Code:
QList<QRadioButton *> aRadioButtons;
aRadioButtons.append( aOption_ );
aRadioButtons.append( alOption_ );
aRadioButtons.append( bOption_ );
either way I can, too?
Re: KDialog, tabs, get active tab pushbuttons, qradiobuttons
I'm tring that:
Code:
QList<QRadioButton *> myList;
int index = 0;
if( myLits.at(index)->isChecked() )
{}
Re: KDialog, tabs, get active tab pushbuttons, qradiobuttons
I have a problem, I have a window but I would like to be a new tab.
Code:
Dialog *dialog = new Dialog( param );
Code:
Dialog
::Dialog( const QString
& param,
QWidget* parent
) , Ui::Dialog()
{
setupUi( this );
// Set up the label
...... etc
layout->addWidget( ... etc );
TabWidget->setLayout( layout );
tabWidget->addTab( TabWidget, "new tab" );
}