Results 1 to 3 of 3

Thread: QDialog::setWindowFlags() problem

  1. #1
    Join Date
    Apr 2006
    Location
    Minsk, Belarus
    Posts
    23
    Thanks
    3
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QDialog::setWindowFlags() problem

    Hi all!

    There is some modal dialogs in my app, and I want those dialogs to be shown centered relatively to the main window of the app. Every dialog is subclassed form QDialog, has its own constructor and is invoked by QDialog::exec() method. Correct parent is passed to every dialog upon initialization.

    Everything works fine and the dialogs are shown centered in relation to their parent window unless I add the following line to the constructor of any dialog:

    Qt Code:
    1. setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint );
    To copy to clipboard, switch view to plain text mode 

    Whenever this line is added, the dialog is always shown at the arbitrary lacation close to the top-left corner of the main window.

    Can someone explain what's happening here? And what's the best solution for this case (I have to remove that question mark from the dialogs anyway).

    Thanks in advance.

  2. #2
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Thanks
    55
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QDialog::setWindowFlags() problem

    It's probably related to http://doc.trolltech.com/qtjambi-1.0...ndowFlags-prop
    but I couldn't tell you what you should be doing to avoid this problem.
    Software Engineer



  3. #3
    Join Date
    Apr 2006
    Location
    Minsk, Belarus
    Posts
    23
    Thanks
    3
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QDialog::setWindowFlags() problem

    Just in case somebody else encounters the same problem: I have contacted Trolltech support over this problem and they've accepted it as their bug. Probably should be fixed in one of the upcoming QT releases.

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 13:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 13:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 15:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 22:36
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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.