Results 1 to 6 of 6

Thread: How to minimize frameless QWidget ?

  1. #1
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to minimize frameless QWidget ?

    Hi All,
    I am using Qt4.5 .I am having a problem in minimizing frameless window while working on linux platform
    I used the following code
    Qt Code:
    1. #include "widget.h"
    2. #include "ui_widget.h"
    3. #include <QPushButton>
    4. #include <QWidget>
    5. Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::WidgetClass)
    6. {
    7. ui->setupUi(this);
    8. setFixedSize(293, 711);
    9. setWindowFlags ( Qt::FramelessWindowHint ) ;
    10. QPushButton *b=new QPushButton("hello",this);
    11. b->setGeometry(20,20,120,30);
    12. connect(b,SIGNAL(clicked()),this,SLOT(showMinimized()));
    13. }
    To copy to clipboard, switch view to plain text mode 

    if i run the same code on Windows platform & MAC operating System it works....
    What is the alternative to minimize the frameless window on click on button in linux ?
    Reply soon
    Thanx
    Last edited by wysota; 10th April 2009 at 07:02. Reason: missing [code] tags

  2. #2
    Join Date
    Sep 2008
    Location
    New York
    Posts
    90
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to minimize frameless QWidget ?

    Quote Originally Posted by anupamgee View Post
    Hi All,
    I am using Qt4.5 .I am having a problem in minimizing frameless window while working on linux platform
    I used the following code
    Qt Code:
    1. #include "widget.h"
    2. #include "ui_widget.h"
    3. #include <QPushButton>
    4. #include <QWidget>
    5. Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::WidgetClass)
    6. {
    7. ui->setupUi(this);
    8. setFixedSize(293, 711);
    9. setWindowFlags ( Qt::FramelessWindowHint ) ;
    10. QPushButton *b=new QPushButton("hello",this);
    11. b->setGeometry(20,20,120,30);
    12. connect(b,SIGNAL(clicked()),this,SLOT(showMinimized()));
    13. }
    To copy to clipboard, switch view to plain text mode 

    if i run the same code on Windows platform & MAC operating System it works....
    What is the alternative to minimize the frameless window on click on button in linux ?
    Reply soon
    Thanx
    Play with setWindowFlags function and take a look at this example QTDIR/examples/widgets/windowflags.

  3. #3
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to minimize frameless QWidget ?

    Thanx for the rep...
    i check that example and tried different flags but still nothing changed...
    i want to minimize the frameless window on the click of a button....
    plzz help...

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to minimize frameless QWidget ?

    u can hide the window..achieves the same purpose as minimizing

  5. #5
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to minimize frameless QWidget ?

    I hv tried hide also...
    but problem with hide is that on hiding,the program icon on task bar also gets hidden....
    i also want that program icon in task bar on hiding...Is there any way to do that???
    Or any other way to minimize frameless widget??

  6. #6
    Join Date
    Apr 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to minimize frameless QWidget ?

    I have the same problem on Linux. If I hide the window manager frame I can't minimize the application (it works if I have the system border). Hiding the window also hides the application on the desktop window list.

    Any ideas or workarounds for this problem?

Similar Threads

  1. QtScript Binding problem with QWidget
    By zack in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2009, 09:38
  2. Replies: 0
    Last Post: 11th November 2008, 15:36
  3. Dynamic updates of a QWidget in a QScrollArea
    By plamkata in forum Qt Programming
    Replies: 2
    Last Post: 20th July 2008, 23:45
  4. Error in put one QWidget in another QWidget
    By xjtu in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2008, 16:05
  5. Replies: 3
    Last Post: 8th March 2007, 14: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.