Results 1 to 6 of 6

Thread: Remove close button on a Dialog in Linux

  1. #1
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Remove close button on a Dialog in Linux

    I hav a application that makes use of a QDialog.Is there any way to remove close button on the Dialog.

  2. #2
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Remove close button on a Dialog in Linux

    No. Unless you remove the whole titlebar with it.

    A QWidget has a set of flags that handle this sort of thing: here. There is no flag to remove the close button.

    Edit: You could try turning off the Qt::WindowSystemMenuHint flag. But I'm not sure it would work.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  3. #3
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Remove close button on a Dialog in Linux

    I tried using setWindowFlags. On Windows OS i am getting the Dialog with no close button.But the same code shows a close button on Dialog..Any idea

  4. #4
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Remove close button on a Dialog in Linux

    Which flag did you use? I can't find any in the documentation.

    Anyway, maybe you can only do it in Windows.

    Why do you want to remove the close button anyway?
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  5. #5
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Remove close button on a Dialog in Linux

    I have an application that should work the same on Windows and Linux..In windows i had passed pWidget,Qt::WindowTitleHint as an arguements to the constructor of QDialog.It worked well on Windows but on Linux close button is visible...Any ideas

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Remove close button on a Dialog in Linux

    J-P Nurmi

Similar Threads

  1. Remove restore button
    By vermarajeev in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2007, 14:29
  2. Replies: 2
    Last Post: 5th February 2007, 18:42
  3. Replies: 3
    Last Post: 16th November 2006, 13:24
  4. 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.