PDA

View Full Version : How to minimize frameless QWidget ?



anupamgee
10th April 2009, 07:21
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

#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
#include <QWidget>
Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::WidgetClass)
{
ui->setupUi(this);
setFixedSize(293, 711);
setWindowFlags ( Qt::FramelessWindowHint ) ;
QPushButton *b=new QPushButton("hello",this);
b->setGeometry(20,20,120,30);
connect(b,SIGNAL(clicked()),this,SLOT(showMinimize d()));
}

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

Sheng
10th April 2009, 19:23
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

#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
#include <QWidget>
Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::WidgetClass)
{
ui->setupUi(this);
setFixedSize(293, 711);
setWindowFlags ( Qt::FramelessWindowHint ) ;
QPushButton *b=new QPushButton("hello",this);
b->setGeometry(20,20,120,30);
connect(b,SIGNAL(clicked()),this,SLOT(showMinimize d()));
}

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.

anupamgee
11th April 2009, 08:00
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...

talk2amulya
12th April 2009, 23:15
u can hide the window..achieves the same purpose as minimizing

anupamgee
13th April 2009, 06:35
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??

napsy
8th August 2010, 17:27
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?