Results 1 to 4 of 4

Thread: QDialog without Title Bar

  1. #1
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default QDialog without Title Bar

    Any way to implement/derive a QDialog or QMainWindow without a title bar, i.e. no icon, no title, no [?] or [x].
    I need the dialog to be resizable and movable by the user, so
    Qt Code:
    1. setWindowFlags( Qt::FramelessWindowHint );
    2. // or
    3. setWindowFlags( Qt::SplashScreen );
    To copy to clipboard, switch view to plain text mode 
    don't do the trick.

    Thx for any hints.

  2. #2
    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: QDialog without Title Bar

    Set the frameless window hint and implement moving and resizing the dialog yourself.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QDialog without Title Bar

    You can look at the code here, I didn't tried but surely can give hints on how do it :
    http://qt-apps.org/content/show.php/...content=138161
    Or here for a more direct answer I think :
    https://github.com/alexcastano/borde.../MainFrame.cpp
    Last edited by Alundra; 19th March 2015 at 02:57.

  4. The following user says thank you to Alundra for this useful post:

    Henry Blue Heeler (30th March 2015)

  5. #4
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: QDialog without Title Bar

    If anyone is paying attention, NcFramelessHelper worked great.
    I didn't actually need a frame-less window, yet I got what I needed with:
    Qt Code:
    1. mFh = new NcFramelessHelper;
    2.  
    3. mFh->setWidgetMovable( true );
    4.  
    5. mFh->setWidgetResizable( true );
    6.  
    7. mFh->activateOn( this );
    8.  
    9. setWindowFlags( Qt::CustomizeWindowHint ); // This along with NcFramelessHelper allows no title bar yet
    10. // a dialog frame and the dialog is movable and resizable
    To copy to clipboard, switch view to plain text mode 
    Last edited by Henry Blue Heeler; 2nd April 2015 at 01:16. Reason: Learned something

Similar Threads

  1. Replies: 0
    Last Post: 4th October 2010, 21:53
  2. QDialog - no title bar
    By Tomasz in forum Newbie
    Replies: 3
    Last Post: 22nd July 2010, 15:39
  3. Show maximize button in the title bar of a QDialog under GNOME
    By lalesculiviu in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2010, 07:46
  4. stylesheet to QDialog Title Bar
    By srinirc in forum Qt Programming
    Replies: 2
    Last Post: 24th November 2009, 15:32
  5. Replies: 5
    Last Post: 21st April 2008, 07:54

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.