Beispiel #1
0
void Toys::UpdateWindowFlags()
{
	for(TOY_LIST::const_iterator i=m_List.begin(); i!=m_List.end(); i++)
	{
		Toy *toy = *i;
		QPoint pos( toy->frameGeometry().topLeft() );
		Qt::WindowStates ws = toy->windowState();
		bool wasVisible = toy->isVisible();

		toy->hide();

		toy->setWindowFlags( GetWindowFlags() );

		if( ws.testFlag(Qt::WindowMinimized) )
		{
			toy->showMinimized();
		}
		else if( ws.testFlag(Qt::WindowMaximized) )
		{
			toy->showMaximized();
			if( !wasVisible )
				toy->close();
		}
		else
		{
			toy->move( pos );
			toy->showNormal();
			Toy::ClipToScreen( *toy );
			if( !wasVisible )
				toy->close();
		}
	}
}
Beispiel #2
0
void Toys::ActivateToy(size_t index)
{
	if(index < m_List.size())
	{
		Toy *toy = m_List[index];

		Qt::WindowStates ws = toy->windowState();

		if(	ws.testFlag(Qt::WindowMaximized) )
			toy->showMaximized();
		else
			toy->showNormal();

		toy->activateWindow();
	}
}