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

List:       kde-bindings
Subject:    [Kde-bindings] Qyoto - how to Ok/Cancel dialog?
From:       linuxoidoz () yahoo ! com ! au
Date:       2010-02-24 13:06:07
Message-ID: 201002242306.07722.linuxoidoz () yahoo ! com ! au
[Download RAW message or body]

Hello,

Here's a C++ example for a two button dialog:

         int button = QMessageBox::question(this,
             tr("Confirm Remove"),
             tr("Are you sure you want to remove \"%1\"?").arg(name),
             QMessageBox::Yes | QMessageBox::No);

         if (button == QMessageBox::Yes) {
		//do something
         }

If I translate it to C#:

	int 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
         }

it says "Operator `==' cannot be applied to operands of type `int' and \
`Qyoto.QMessageBox.StandardButton". 

I've also tried this part:

	int ret = dlg.Exec();
	switch (ret) {
		case QMessageBox.StandardButton.Ok:
		   // Save was clicked
		   break;
		case QMessageBox.StandardButton.Cancel:
		   // Don't Save was clicked
		   break;
	}

 same thing: "Cannot implicitly convert type `Qyoto.QMessageBox.StandardButton' to \
`int'. An explicit conversion exists (are you missing a cast?)"

How do you get the dialog to work in Qyoto? Thank you.
_______________________________________________
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