jaddison
Joined: 25 Aug 2009 Posts: 8
|
Posted: Sun Sep 13, 2009 6:28 pm Post subject: Translation of Qt sdi example |
|
|
I translated the Qt example examples/mainwindows/sdi/ from Qt/C++ to QtD/D. Everything seems to be working except for one thing. In the createActions function I can only connect one of the two signals from textEdit (the last two statements in the function). If both are included the program compiles, but crashes when any MainWindow is closed. If one or neither are included the program runs fine except without the missing feature(s).
Code: | ...
cutAct.setEnabled(false);
copyAct.setEnabled(false);
// QtD bug????
// only one of the following statements can be included
// otherwise the app crashes when a MainWindow is closed
// textEdit.copyAvailable.connect(&cutAct.setEnabled);
textEdit.copyAvailable.connect(©Act.setEnabled);
}
|
A couple of other notes on my translation:
I had trouble building strings with format so I used string concatenation.
I couldn't get QApplication.setOverrideCursor(Qt.WaitCursor) to work, but was able to make it work with QApplication.setOverrideCursor(new QCursor(Qt.WaitCursor)).
I think there were some other workarounds but I don't recall just now. I'm sure someone familiar with QtD/D could review my translation and identify many things that could/should have been done more correctly. If anyone is interested in this code, I'd be happy to provide it.
Thanks,
Jason |
|