FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Translation of Qt sdi example

 
Post new topic   Reply to topic     Forum Index -> QtD
View previous topic :: View next topic  
Author Message
jaddison



Joined: 25 Aug 2009
Posts: 8

PostPosted: Sun Sep 13, 2009 6:28 pm    Post subject: Translation of Qt sdi example Reply with quote

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(&copyAct.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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> QtD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group