PDA

View Full Version : how to show the taskbar after maximim the window?



Kode.Cooper
11th January 2010, 11:22
hi there,
I create a window with flag FramelessWindowHint, and customized the
the titlebar, but when i pressed the maximim button, the window corvered the whole screen and the task bar.

I have tried the below code to. but you know, after setGeometry, the window state will not be
WindowMaximized any more.

Is the any other way for my question ? thanks .


if ( winCurState != Qt::WindowState::WindowMaximized )
{
m_parent->showMaximized();
m_parent->setGeometry(qApp->desktop()->availableGeometry());
m_parent->updateGeometry();
m_maxButton->setIcon( m_pixRestore );
}
else
{
m_parent->showNormal();
m_maxButton->setIcon( m_pixMax );
}

Tavit
11th January 2010, 15:05
Hi cooper,

The way of maximizing the window the two ways.. One is set the Geometry. and Second one is the setting maximize and minimize parametrers you can set as a acustom widget. so i think better go for pass the minimize and maximize the parameters.



minimize->setMaximumSize(12,3);
minimize->setMinimumSize(12,3);
minimize->setGeometry(300,17,12,3);


Thanks and regards,
Tavit.

Kode.Cooper
12th January 2010, 02:32
Hi cooper,

The way of maximizing the window the two ways.. One is set the Geometry. and Second one is the setting maximize and minimize parametrers you can set as a acustom widget. so i think better go for pass the minimize and maximize the parameters.



minimize->setMaximumSize(12,3);
minimize->setMinimumSize(12,3);
minimize->setGeometry(300,17,12,3);


Thanks and regards,
Tavit.

Hi, Tavit, thanks for your reply, I tried this way you mentioned before, But it seems not work well.
The same action occured when i pressed the maximim button to invoke the showMaximized. :(

ole
3rd June 2010, 09:14
Hi, cooper.

All you need to do is save your geometry before you maximize or minimize the widget, and call restoreGeometry replace of showNormal.

I think these codes below gonna help you.




void showSmall()
{
this->normalGeometry = this->saveGeometry();
this->showMinimized();
}


void showMaxRestore()
{
if (maxNormal)
{
this->restoreGeometry(this->normalGeometry);
maxNormal = !maxNormal;
maximize->setIcon(maxPix);
}
else
{
this->normalGeometry = this->saveGeometry();
this->showMaximized();
this->setGeometry(qApp->desktop()->availableGeometry());
maxNormal = !maxNormal;
maximize->setIcon(restorePix);
}
}