Results 1 to 12 of 12

Thread: Can't get title bar to disappear from widget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,346
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: Can't get title bar to disappear from widget

    Reading the Qt::WindowFlags documentation, it looks like you might want Qt::Widget instead of Qt::Window. However, it also says that the Qt::Window bit cannot be cleared if the widget has no parent. So, you might try making the widget a child of the QDesktopWidget, which implies you might be able to clear the Qt::Window bit.

    And it probably was a typo in your posting, but you also want "|" and not "||" in the setWindowFlags() call.

    I would like to know if you try this and whether or not it works.

    -- edit --

    Looking further, it appears that if you set the flags Qt::Window | Qt::FramelessWindowHint | Qt::CustomizeWindowHint (and forget about the QDesktopWindow stuff above), this might do what you want.

    -- further edit --

    Verified using the QMainWindow-derived class in my own app that the above combination of flags removes the title bar.

    Qt Code:
    1. MyMainWindow mainWindow( 0, Qt::Window | Qt::FramelessWindowHint | Qt::CustomizeWindowHint );
    2. mainWindow.show();
    To copy to clipboard, switch view to plain text mode 

    However, you also can't move, minimize, maximize, close, or do anything else with the window except to resize it using the grab handle at the lower right. That is really, really unfriendly behavior. Is that how you want your users to view your app?
    Last edited by d_stranz; 24th October 2010 at 19:39.

  2. #2
    Join Date
    Aug 2009
    Posts
    140
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    22

    Default Re: Can't get title bar to disappear from widget

    Hi d_stranz,

    Thanks very much, I will try this and let you know as soon as I do. You're right about the typo.

    Matt

Similar Threads

  1. QWidget - Q_OBJECT makes the widget disappear
    By Sir Rogers in forum Qt Programming
    Replies: 6
    Last Post: 26th January 2010, 00:39
  2. widget without title bar???
    By db in forum Newbie
    Replies: 3
    Last Post: 30th August 2007, 22:16
  3. QLabel::setText causes part of widget to disappear
    By Pieter from Belgium in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2007, 10:22
  4. Mouse dragged widget without title
    By Tonal in forum Qt Programming
    Replies: 2
    Last Post: 14th November 2006, 13:28
  5. Replies: 9
    Last Post: 8th May 2006, 15:21

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
  •  
Qt is a trademark of The Qt Company.