示例#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();
		}
	}
}
示例#2
0
void Toys::DeleteToy(size_t index)
{
	if(index < m_List.size())
	{
		Toy *toy = m_List[index];

		m_List.erase(m_List.begin() + index);

		toy->close();
		toy->deleteLater();

		BuildRecvWidgetsTable();

		emit changed();
	}
}