Results 1 to 13 of 13

Thread: Windows Buttons

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Windows Buttons

    Hiiii to all....................

    I have one problem..........i need to hide all buttons which are shown on title bar of window ie
    maxminized,minized,close. Even i go through the windows flags,window state,window types
    but i don't get any apporpiate one.

    Can any one suggest me how can i do this.I just want to hide buttons only not the title bar


    thanxx in advance

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Windows Buttons

    Hi, play around with the Window Flags Example to find a suitable combination of window flags.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Windows Buttons

    hiiiiiiiiiii..............i hv seen the example too..............i don't get apporiate one.
    instead just handle the close button by close event.
    can any one suggest any better option
    thanxx in advance.........

  4. #4
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Windows Buttons

    use this

    setWindowFlags(Qt::WindowTitleHint);


    I think it will work .
    Ashish Kumar Saryar

  5. #5
    Join Date
    Jan 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Windows Buttons

    hiiiii.................

    i hv try it too....................but it appears both ie title bar as well as buttons.................
    i am using platform redhat as-4.
    so what shd i do to hide these buttons...................

    plz suggest something..........i am using below mention code............can any one rectify it........

    myform1-> setWindowFlags(Qt::FramelessWindowHint);
    myform1-> setWindowFlags(Qt::WindowTitleHint);

    thanxx in advance...........

  6. #6
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Windows Buttons

    Well the first line is overriding the second. If you want to set both you need to OR them together like this.

    myform1-> setWindowFlags(Qt::FramelessWindowHint | Qt::WindowTitleHint);

  7. #7
    Join Date
    Jan 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Windows Buttons

    hiiiii....................

    i hv tried ur code but becoz of 'or' operator it is working for only one option & taking first one.ie widget become frameless without any title bar. so i replaced or with and ie

    myform1-> setWindowFlags(Qt::FramelessWindowHint & Qt::WindowTitleHint);
    it show window title bar but problem is again that with all three buttons.

    so plz suggest me what shd i do.

    thanxx in advance..........

  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: Windows Buttons

    Just try setWindowFlags(Qt::WindowTitleHint);
    I didnt get any of the three buttons...
    This is my code.. u can try
    Qt Code:
    1. #include <QApplication>
    2. #include <QLabel>
    3. #include<QMainWindow>
    4.  
    5. int main(int argc, char **argv) {
    6. QApplication app(argc, argv);
    7.  
    8. QMainWindow *window = new QMainWindow;
    9. QLabel *label = new QLabel("Hello World!");
    10.  
    11. window->setCentralWidget(label);
    12. window->setWindowFlags(Qt::WindowTitleHint);
    13. window->show();
    14.  
    15. return app.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 

    BTW, I am using windows with Qt 4.3.0 on Visual Studio 2005.
    Hope it helps u
    Last edited by aamer4yu; 11th March 2008 at 13:57.

  9. #9
    Join Date
    Jan 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Windows Buttons

    hiiii................
    i hv tried ur code......but again all three buttons r visible...................
    my platform is redhat as 4 might be coz of platfrom difference it is causing an error.........

    can any one suggest me code ie effects on redhat platform


    thanxx in advance..........

  10. #10
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Windows Buttons

    Try reset flags to 0 first before setting them. It worked for me in Linux.
    Qt 5.3 Opensource & Creator 3.1.2

  11. #11
    Join Date
    Jan 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Windows Buttons

    hiiii.....................i hv already done this...........but it doesn't effect my code...........

    here is my code.................but its not effect i mean show all three buttons..

    Qt Code:
    1. Qt::WindowFlags flags = 0;
    2. flags |= Qt::FramelessWindowHint;
    3. flags &= Qt::WindowTitleHint; //even i tried with or also ie
    4. //flags|= Qt::WindowTitleHint
    5. myform1->setWindowFlags(flags);
    To copy to clipboard, switch view to plain text mode 
    so what shd i do.............


    thanxx in advance...................
    Last edited by jpn; 13th March 2008 at 06:31. Reason: missing [code] tags

Similar Threads

  1. QSkinWindows Classes
    By kernel_panic in forum Qt-based Software
    Replies: 45
    Last Post: 20th April 2010, 12:35
  2. Windows not appearing in XP.
    By beardybloke in forum Qt Programming
    Replies: 7
    Last Post: 24th October 2007, 17:32
  3. Replies: 10
    Last Post: 25th February 2007, 00:23
  4. converting unix exe to windows binary
    By deekayt in forum General Programming
    Replies: 2
    Last Post: 17th September 2006, 01:00
  5. MDI windows without QWorkspace
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 16th June 2006, 17:15

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.