PDA

View Full Version : Problems with showMaximize()



drow.it
26th January 2010, 06:29
I hide window title:
cMainWindow::cMainWindow( QWidget* parent /*= 0*/ )
: QMainWindow(parent, Qt::CustomizeWindowHint),
{
}

and I have slot to maximize/showNormal the window
void cMainWindow::toggleMaximize()
{
isMaximized() ? showNormal() : showMaximized();
}

While I maximize window it overlapped taskbar as if I use showFullScreen()
How to solve this problem?

high_flyer
26th January 2010, 10:27
How to solve this problem?
What problem?

drow.it
26th January 2010, 10:31
I need only maximize window without title. but it become fullScreen insted of maximize

high_flyer
26th January 2010, 12:00
Try using Qt::FramelessWindowHint.

drow.it
26th January 2010, 12:03
I have tried. But with the same result

high_flyer
26th January 2010, 12:06
Did you ADD FramelessWindowHint to your previous code, or did you use FramelessWindowHint INSTEAD the Qt::CustomizeWindowHint?

drow.it
26th January 2010, 12:15
I tried both alternatives. But with the same result. Besides with FramelessWindowHint I can not change window size with mouse and I have to realise changing window size in my code
ps. Sorry for my bad english :)

vishwajeet.dusane
26th January 2010, 13:25
Hi

Try this.
1. QDesktopWidget * QApplication::desktop ()
2. QDesktopWidget::availableGeometry which will give you available size of your desktop
3. QWidget::setMaximumSize to set maximum size of your titile less widget
4. call showMaximized()

This will ensure that your maximized widget will not cover full screen .

drow.it
26th January 2010, 13:32
Thanks. Now all work correctly.