Results 1 to 4 of 4

Thread: can we dsable the close button of a dialog during runtime, till some process gets exe

  1. #1
    Join Date
    Sep 2006
    Posts
    21
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default can we dsable the close button of a dialog during runtime till some process gets exec

    Hai

    can we dsable the close button of a dialog during runtime, till some process gets executed.After this process gets executed i want to retain tthe close button to enabled state.

    Regards and Thanks ,
    vinayasheela

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: can we dsable the close button of a dialog during runtime till some process gets exec

    You can override the closeEvent and ignore() the event if you don't want your widget closed.

  3. #3
    Join Date
    Sep 2006
    Posts
    21
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: can we dsable the close button of a dialog during runtime, till some process gets exe

    i dont want it(closed button) to be in disabled state only.After some process gets executed i want it to get back to the original state i.e enabled state.

    thanks

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: can we dsable the close button of a dialog during runtime, till some process gets

    If you want the behaviour to change then just stop ignoring the event...

    Qt Code:
    1. void MyWidget::closeEvent(QCloseEvent *e){
    2. if(someVar==true) e->ignore(); else e->accept();
    3. }
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to wysota for this useful post:

    vinnu (17th November 2006)

Similar Threads

  1. Replies: 3
    Last Post: 23rd July 2006, 19:02

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.