Results 1 to 10 of 10

Thread: How to disable 3 controls on the main application

  1. #1
    Join Date
    May 2006
    Posts
    32
    Thanks
    1
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to disable 3 controls on the main application

    Hello Everyone..

    I have question here? I want to disable controll
    s like mimimize, maximize and exit buttons on the title bar of the application and i could remove atleat 2 of them correctly. but finding difficulty further. Is there any way to do this and my title bar should look with only caption on it. Any help? Thanks in advance!!
    Regards

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to disable 3 controls on the main application

    I dont know how this works..
    but it works...

    Qt Code:
    1. QMainWindow window(0,Qt::WindowTitleHint);
    2. window.setWindowTitle("Hello abc");
    3. window.show();
    To copy to clipboard, switch view to plain text mode 

    By the way what workaround you tried ? I would like to know

  3. #3
    Join Date
    May 2006
    Posts
    32
    Thanks
    1
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to disable 3 controls on the main application

    Hi...

    I tried on QWidget by setting the fixed size for the widget something like this..

    Qt Code:
    1. w.setFixedSize(int x, int y)
    To copy to clipboard, switch view to plain text mode 

    This is will diable the maximize contoll on the application...

    In the same way i want then not be visible on the title bar
    Regards

  4. #4
    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: How to disable 3 controls on the main application

    Which Qt version are you using?

  5. #5
    Join Date
    May 2006
    Posts
    32
    Thanks
    1
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to disable 3 controls on the main application

    Using Qt 3.3.3 version on X11
    Regards

  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to disable 3 controls on the main application

    by the way,
    isnt QMainWindow window(0,Qt::WindowTitleHint); working for you ?

  7. #7
    Join Date
    May 2006
    Posts
    32
    Thanks
    1
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to disable 3 controls on the main application

    Your option code is not working with Qt 4. I want this to done on Qt 3 and now i am checking in both version of Qt.
    Regards

  8. #8
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to disable 3 controls on the main application

    I dont know abt Qt 3,
    I am using Qt 4.2
    But I am just setting the windows flags of the QMainWindow constructor.
    I see the Qt 3 version has const char* as second parameter.

    Q3MainWindow::Q3MainWindow ( QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = Qt::WType_TopLevel )
    Just set the Qt::WindowTitleHint parameter for Qt::WindowsFlags

  9. #9
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to disable 3 controls on the main application

    You can use a QtoolBar instead of a widget. The QToolBar inherits QDockWindow... There you can provide a close button if you want......

    Hope this helps

  10. #10
    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: How to disable 3 controls on the main application

    Try passing Qt::WStyle_Customize|Qt::WStyle_Title. I doubt you'll be able to get rid of the close button this way, but you might try.

Similar Threads

  1. accessing my main application window widget
    By jayw710 in forum Newbie
    Replies: 8
    Last Post: 15th November 2007, 19:33
  2. Replies: 3
    Last Post: 8th December 2006, 18:51
  3. Replies: 4
    Last Post: 31st August 2006, 12:11
  4. Replies: 3
    Last Post: 31st March 2006, 18:38
  5. Replies: 1
    Last Post: 15th February 2006, 22:17

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.