Results 1 to 5 of 5

Thread: how to set WDestructiveClose Flag

  1. #1
    Join Date
    Jun 2007
    Posts
    4
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default how to set WDestructiveClose Flag

    hello everyone,
    i'm new to qt and also to this forum. can anyone tell me how to set the WDestructiveClose flag for a MainWindow using QtDesigner3. I know how to do it by coding.. but not able to find how to do usind QtDesigner.. I'm using Linux OS but i think that doesn't makes any difference in the answer.
    thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to set WDestructiveClose Flag

    Well, you can't do that from Designer.
    What's wrong from doing it in the implementation? Because you can't build your app with Designer alone anyway.

    Regards

  3. #3
    Join Date
    Jun 2007
    Posts
    4
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: how to set WDestructiveClose Flag

    thanks for the reply.. the problem in doing it in the implementation is that i saw a warning in the source file generated by the QtDesigner(.ui.h file) which is:

    /************************************************** **************************
    ** ui.h extension file, included from the uic-generated form implementation.
    **
    ** If you want to add, delete, or rename functions or slots, use
    ** Qt Designer to update this file, preserving your code.
    **
    ** You should not define a constructor or destructor in this file.
    ** Instead, write your code in functions called init() and destroy().
    ** These will automatically be called by the form's constructor and
    ** destructor.
    ************************************************** ***************************/
    this means that we can not write constructor in that file..

    and what i've read is that WDestructiveClose flag can be set only in the constructor..

    so how to do it?????

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to set WDestructiveClose Flag

    Subclass the class and reimplement the constructor. ui.h is a hack that allows you to add some code to a Designer generated class without subclassing. If you subclass, you can move all your code from ui.h to the subclass to have a cleaner design.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to set WDestructiveClose Flag


  6. The following user says thank you to jacek for this useful post:

    amitkhanna (17th June 2007)

Similar Threads

  1. Changing AlwaysOnTop window flag
    By bpetty in forum Newbie
    Replies: 5
    Last Post: 19th February 2007, 23:45
  2. using Q::desktop flag
    By nupul in forum Newbie
    Replies: 1
    Last Post: 30th April 2006, 14:58
  3. Replies: 5
    Last Post: 13th March 2006, 20:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.