Results 1 to 2 of 2

Thread: close button not there in Mac but its in window

  1. #1
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default close button not there in Mac but its in window

    Qt Code:
    1. MyControlPanel::MyControlPanel(QWidget *parent) :
    2. QFrame(parent, Qt::Window)
    3. {
    4.  
    5. setWindowTitle("Web SDK Simulator");
    6.  
    7. setupUi(this);
    8. MySettings::instance()->setParent(this,Qt::Window | Qt::WindowSystemMenuHint);
    9. }
    To copy to clipboard, switch view to plain text mode 

    I have code like this where I am creating a widget Setting which is child of Control Panel (type QFrame).
    The setting widget not showing any button on Mac while its display close button on title bar rightly.

    I have tried many options of window flags but to no avail.
    Pls menation if I am missing something or any work around to achoieve this.

    Ton of thanks,
    -netmat

  2. #2
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: close button not there in Mac but its in window

    #ifdef Q_OS_MAC
    Qt::WindowFlags flag = (this->windowFlags() | Qt::CustomizeWindowHint);
    flag |= Qt::WindowTitleHint;
    MySettings::instance()->setParent(this, flag);
    #else

    MySettings::instance()->overrideWindowFlags(windowFlags() & Qt::WindowCloseButtonHint);
    #endif
    this solved the problem.

Similar Threads

  1. [PyQt4] Want to connect a window's close button
    By Dodle in forum Qt Programming
    Replies: 7
    Last Post: 21st April 2010, 11:13
  2. how to disable X button to close th window
    By raghvendramisra in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2009, 20:01
  3. How to close parent window from child window?
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 14th October 2008, 11:40
  4. Close button in a tab
    By mitro in forum Newbie
    Replies: 2
    Last Post: 16th May 2008, 10:22
  5. How to "hide window when close button pressed"
    By iGoo in forum Qt Programming
    Replies: 4
    Last Post: 26th July 2006, 09:53

Tags for this Thread

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.