Results 1 to 5 of 5

Thread: How to remove title but with frame border?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Question How to remove title but with frame border?

    hello, friends..
    i wanna to put my widget on the title bar with qt

    on window platform,
    i use Qt::FrameLessWindowHint to hide the caption, and use WM_NCHITTEST to deal with move and resize.
    but without borders, i move the window to screen edge, window can't maximum or restore by system.......

    then , i tried to use SetWindowLong() to make border back...it works, but too ugly....code and the widget..
    at last, i make client area over title bar with WM_NCCALCSIZE message, it works, but have many bugs....then, i changes lots of QtGui's codes to make it deal with WM_NCCALCSIZE... update frameStruct and client Rect etc..

    but, on linux platform, i can't find any help from XLib Api... can i create canvas intead of window?
    or use Qt::FrameLessWindowHint, and try to solver Scrren Edge problem?

    thanks for any reply...

    so poor my english....

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to remove title but with frame border?

    Hmm I don't quite understand what you mean by 'put my widget on the title bar with qt'.

    Do you want to get rid of the title bar of a widget (top part of a widget with title, max/min/close buttons)?
    Or do you want to get rid of entry on the window task bar (on the bottom of the screen when icon of your app appears)?

    Whatever you want, I can bet that there's no need to go native, this way you make your code not-portable.
    Qt should suffice.

    And what 'screen edge problem' you mean?

  3. #3
    Join Date
    Mar 2011
    Location
    Denmark
    Posts
    74
    Thanks
    7
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to remove title but with frame border?

    If you have a frameless window and want to be able to maximize / minimize / close it by the system you need to add some more window flags

    Qt Code:
    1. FramelessWindow::FramelessWindow()
    2. : QWidget(0, Qt::WindowFlags(Qt::FramelessWindowHint | Qt::WindowMinMaxButtonsHint | Qt::WindowSystemMenuHint))
    To copy to clipboard, switch view to plain text mode 

    If you want to be able to grab the edges of your window and resize it you will have to implement this yourself or use a utility like Frameless Window Helper

Similar Threads

  1. Replies: 2
    Last Post: 21st March 2012, 14:30
  2. Replies: 5
    Last Post: 26th June 2011, 11:43
  3. How to remove QMainWindow's title and border
    By meraj ansari in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2010, 17:22
  4. Border and Frame
    By big4mil in forum Newbie
    Replies: 3
    Last Post: 12th March 2010, 19:46
  5. Replies: 4
    Last Post: 13th July 2009, 18:18

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.