adding QAction to QDialog is not working
hi,
I want to add QAction to my customized dialog inherited from QDialog.
QDialog has addAction method to add actions to QDialog. But it seems that Qaction added is not visible on QDialog.
This way i am creating QAction and adding it to QDialog :
Code:
QAction *actCount
= new QAction(QIcon(tr
("English_en\\countonback.png")), tr
("Count On / Back"),
this);
addAction( actCount );
Can anybody guide me what is wrong and how to do it.
Thanks in advance
Regards,
~Sanjay
Re: adding QAction to QDialog is not working
Hi!
void QWidget::addAction ( QAction * action )
-Appends the action action to this widget's list of actions.
Create an QToolButton add the action to the button with:
void QToolButton::setDefaultAction ( QAction * action ) [slot]
then add the button to the QDialogs layout.
Re: adding QAction to QDialog is not working
thanks,
Its working.
But i am having one more problem.
Actions i have added now has button like appearance. Is it possible to have action like appearance.
Regards,
~Sanjay
Re: adding QAction to QDialog is not working
You could add this action to QToolBar and add this toolbar to the dialogs layout
or take a look at:
http://doc.trolltech.com/4.4/widgets-styles.html