X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FQtx%2FQtxWorkspace.cxx;h=b8ad4fc058fa63437d5e92432199c17ade033dc8;hb=bbc5c50035b23e5c74dd2ba28468a6adede1abbc;hp=bcdb2998950c73c4e938eb0ade36b973f48e11de;hpb=e07448c48ea5b2127e34fc7b8c3427d01c7ce17b;p=modules%2Fgui.git diff --git a/src/Qtx/QtxWorkspace.cxx b/src/Qtx/QtxWorkspace.cxx index bcdb29989..b8ad4fc05 100644 --- a/src/Qtx/QtxWorkspace.cxx +++ b/src/Qtx/QtxWorkspace.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -22,7 +22,7 @@ // #include "QtxWorkspace.h" -#include +#include /*! \class QtxWorkspace @@ -38,7 +38,7 @@ \param parent parent widget */ QtxWorkspace::QtxWorkspace( QWidget* parent ) -: QWorkspace( parent ) +: QMdiArea( parent ) { } @@ -54,24 +54,24 @@ QtxWorkspace::~QtxWorkspace() */ void QtxWorkspace::tileVertical() { - QWidgetList winList = windowList(); + QList winList = subWindowList(); if ( winList.isEmpty() ) return; int count = 0; - for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr ) + for ( QList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr ) if ( !( (*itr)->windowState() & Qt::WindowMinimized ) ) count++; if ( !count ) return; - if ( activeWindow() && ( activeWindow()->windowState() & Qt::WindowMaximized ) ) - activeWindow()->showNormal(); + if ( activeSubWindow() && ( activeSubWindow()->windowState() & Qt::WindowMaximized ) ) + activeSubWindow()->showNormal(); int y = 0; int heightForEach = height() / count; - for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it ) + for ( QList::iterator it = winList.begin(); it != winList.end(); ++it ) { QWidget* win = *it; if ( win->windowState() & Qt::WindowMinimized ) @@ -98,24 +98,24 @@ void QtxWorkspace::tileVertical() */ void QtxWorkspace::tileHorizontal() { - QWidgetList winList = windowList(); + QList winList = subWindowList(); if ( winList.isEmpty() ) return; int count = 0; - for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr ) + for ( QList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr ) if ( !( (*itr)->windowState() & Qt::WindowMinimized ) ) count++; if ( !count ) return; - if ( activeWindow() && activeWindow()->windowState() & Qt::WindowMaximized ) - activeWindow()->showNormal(); + if ( activeSubWindow() && activeSubWindow()->windowState() & Qt::WindowMaximized ) + activeSubWindow()->showNormal(); int x = 0; int widthForEach = width() / count; - for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it ) + for ( QList::iterator it = winList.begin(); it != winList.end(); ++it ) { QWidget* win = *it; if ( win->windowState() & Qt::WindowMinimized ) @@ -136,3 +136,11 @@ void QtxWorkspace::tileHorizontal() x += actualW; } } + +void QtxWorkspace::onSubWindowActivated( QMdiSubWindow* subWindow ) +{ + QWidget* w = 0; + if ( subWindow ) + w = subWindow->widget(); + emit windowActivated( w ); +}