C++ Qt 05 - Displaying Windows

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
15,035
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 8, 2011

Lean how to display main Windows and Dialogs in Modal and Modeless methods

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (VoidRealms)

  • Great vid dude, but I'm having trouble with the code inside the new window void, when I type .setModal(true) and .exec() and then I run the program, it gives me errors saying that the class "x" has no member named setModal and exec.

    Please help!

  • @Reloadedrhapsody I think your window is a mainwindow, try using a QDialog instead

  • @VoidRealms dude, I'm totally new to this program, is there any way I can chat with you (if you have time) so you can help me?? Please? My proyect is due friday

    please? yes? :D hahaha

  • @Reloadedrhapsody hehe sorry i have been uber busy with work and kid, you can always email me!

  • I'm adding you to my recommended channels immediately.

see all

All Comments (36)

Sign In or Sign Up now to post a comment!
  • as I wrote previously, good job.

  • @thowabu I'm a bit hazy on this part too. If QT truly does release the space once it's finished, in the example wouldn't it better to just use a local pointer instead of a member pointer?

  • Hi, there´s something i dont understand.

    Why was it necesary to go thru the trouble of declaring a class member of type MyDialog on MainWindow (adding mDialog to mainwindow.h, etc)?

    why not just create the dialog on the heap inside the OnNewWindow function? like...

    MyDialog dlg = new MyDialog(this);

    i think that in this situation mDialog class member is useless, since the pointer will be overwritten every time the user clicks the new window button.

  • @BobWyaJnr :

    I think I got it.

    He allocate the memory for the Object.

    Function "new" give back the pointer and do the C++ CTor and so on.

    Every time he does it.

    So evertime a New Dialog is created and "running".

    But I never reach the older created Objects.

    Shouldn´t a good Programmer avoid this Situation??

    (Obviously QT will release the Space on exit..)

  • @thowabu

    Consider what the C++ 'new' command does - creates a new heap variable and gives you a pointer to it. Each time you create a new dialogue window object you overwrite the previous pointer reference in the 'mdialog' pointer (private class variable).

  • Qt creator was build in Qt? That's a paradox. Aaaaaaaaaaaaaaaaaaaaaaaaaaah

  • 8:45 gives error

    ISO C++ forbids declaration of 'myDialog' with no type

  • how can I do to create and give functions to buttons if I can't use the form??

  • You've earned my subscription.

  • What the fuck happened to nice and educational youtube channels? Oh, VoidRealms is there, forget what I just wrote! :D Great!

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more