[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bindings
Subject:    Re: [Kde-bindings] Qyoto - how to Ok/Cancel dialog?
From:       "Christian A. Reiter" <chris.reiter () gmx ! at>
Date:       2010-02-26 9:24:46
Message-ID: 4B87935E.20309 () gmx ! at
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Am 2010-02-24 23:06, schrieb Linuxoid Oz:
> That worked, thank you.
>
> --- On *Wed, 24/2/10, Arno Rehn /<arno@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

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Am 2010-02-24 23:06, schrieb Linuxoid Oz:
<blockquote cite="mid:930834.24771.qm@web111006.mail.gq1.yahoo.com"
 type="cite">
  <table cellpadding="0" cellspacing="0" border="0">
    <tbody>
      <tr>
        <td
 style="font-family: inherit; font-style: inherit; font-variant: inherit; \
font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: \
inherit; font-stretch: inherit; -x-system-font: none;"  valign="top">That worked, \
thank you.<br>  <br>
--- On <b>Wed, 24/2/10, Arno Rehn <i><a class="moz-txt-link-rfc2396E" \
href="mailto:arno@arnorehn.de">&lt;arno@arnorehn.de&gt;</a></i></b> wrote:<br>
        <blockquote
 style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: \
5px;"><br>  <div class="plainMail">Cast the Enum value to an int first.<br>
          <br>
          </div>
        </blockquote>
        </td>
      </tr>
    </tbody>
  </table>
  <br>
</blockquote>
Hm, how about that?<br>
<br>
            QMessageBox.StandardButton button = QMessageBox.Question
(this, "Confirm Remove", "Are you sure you want to remove?", <br>
                QMessageBox.StandardButton.Ok,
QMessageBox.StandardButton.Cancel);<br>
            <br>
            if (button == QMessageBox.StandardButton.Ok) {<br>
                //do something<br>
            }<br>
<br>
May be not the best possibility, but IMHO is better than typecasting.<br>
wouldn't it be worth implementing the == operator in such cases?<br>
<br>
Christian<br>
</body>
</html>



_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic