[Kde-bindings] Qyoto - how to Ok/Cancel dialog?

Christian A. Reiter chris.reiter at gmx.at
Fri Feb 26 09:24:46 UTC 2010


Am 2010-02-24 23:06, schrieb Linuxoid Oz:
> That worked, thank you.
>
> --- On *Wed, 24/2/10, Arno Rehn /<arno at arnorehn.de>/* wrote:
>
>
>     Cast the Enum value to an int first.
>
>
Hm, how about that?

            QMessageBox.StandardButton button = QMessageBox.Question
(this, "Confirm Remove", "Are you sure you want to remove?",
                QMessageBox.StandardButton.Ok,
QMessageBox.StandardButton.Cancel);
           
            if (button == QMessageBox.StandardButton.Ok) {
                //do something
            }

May be not the best possibility, but IMHO is better than typecasting.
wouldn't it be worth implementing the == operator in such cases?

Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20100226/5a9425af/attachment.html>


More information about the Kde-bindings mailing list