[Kde-bindings] Qt, Qyoto buttons work intermediately
Richard Dale
rdale at foton.es
Sun Feb 14 10:32:32 UTC 2010
On Sunday 14 February 2010 05:46:03 am linuxoidoz at yahoo.com.au wrote:
> Don't know if this is a Qyoto bug or I'm doing something wrong. When I
> build my project and click buttons sometimes they work, sometimes they
> don't. If I rebuild it, then they might start working or stop. Really
> strange.
>
> I have these functions:
>
> QObject.Connect(btnSource, Qt.SIGNAL("clicked()"), MainWindow,
> Qt.SLOT("GetSource(MainWindow)")); QObject.Connect(btnAbout,
> Qt.SIGNAL("clicked()"), MainWindow, Qt.SLOT("ShowAbout(MainWindow)"));
>
> [Q_SLOT]
> private void ShowAbout(QMainWindow win) {
> QMessageBox.About(win, "About", "About Project");
> }
>
> [Q_SLOT]
> private void GetSource(QMainWindow win) {
> fileDialog = new QFileDialog(win);
> string folderPath = "";
> folderPath = fileDialog.Directory().ToString();
> }
>
>
> The ShowAbout sometimes shows the message, sometimes it doesn't, the
> GetSource never works. What am I doing wrong? Thank you.
You are connecting to Qt.SLOT("GetSource(MainWindow)") which should be
Qt.SLOT("GetSource(QMainWindow)"), and Qt.SLOT("ShowAbout(MainWindow)") which
should be Qt.SLOT("ShowAbout(QMainWindow)").
-- Richard
More information about the Kde-bindings
mailing list