How enable and add action to closeButton(QMessageBox)?
-
How can i set my close crest icon enabled? There is no buttons i have with ::NoRole, so that thing at top-right angle of MessageBox is always disabled, but i would like set some custom action on it(without adding another button).
setWindowFlags(Qt::WindowCloseButtonHint); do nothing, don't helped at all. And i hoped that .exec(); might return something special for closed action, but didn't find such stuff. +as i said close button disabled so...
-
How can i set my close crest icon enabled? There is no buttons i have with ::NoRole, so that thing at top-right angle of MessageBox is always disabled, but i would like set some custom action on it(without adding another button).
setWindowFlags(Qt::WindowCloseButtonHint); do nothing, don't helped at all. And i hoped that .exec(); might return something special for closed action, but didn't find such stuff. +as i said close button disabled so...
-
Did you consider using the different return codes?
(E.g. for information)@koahnig said in How enable and add action to closeButton(QMessageBox)?:
Did you consider using the different return codes?
No sense to consider all that stuff while main close button is disabled by default. First need to set it enabled, thats the point of this topic(first of two).
-
@koahnig said in How enable and add action to closeButton(QMessageBox)?:
Did you consider using the different return codes?
No sense to consider all that stuff while main close button is disabled by default. First need to set it enabled, thats the point of this topic(first of two).
-
@Engelard
Hi
You must have one button with QMessageBox::RejectRole
to have the close button enabled. ( the X )@mrjj i know! But that will mean that i will have one extra button, unnecessary one.
I wanted it just like that:
- Accept button
- Refresh button
That's it, not third button must be, but user should be able just close that modal window if he understand that none of two options fit him. I've added third button because of that, but only because of that flow of QMessageBox.
P.S. is it possible to hide third button somehow?
-
@mrjj i know! But that will mean that i will have one extra button, unnecessary one.
I wanted it just like that:
- Accept button
- Refresh button
That's it, not third button must be, but user should be able just close that modal window if he understand that none of two options fit him. I've added third button because of that, but only because of that flow of QMessageBox.
P.S. is it possible to hide third button somehow?