1 #include "STD_SDIDesktop.h"
3 #include <SUIT_ViewWindow.h>
7 #include <qobjectlist.h>
9 /*!Constructor. Create instance of QVBox*/
10 STD_SDIDesktop::STD_SDIDesktop()
13 myMainWidget = new QVBox( this );
14 myMainWidget->setFrameStyle( QFrame::Panel | QFrame::Sunken );
16 setCentralWidget( myMainWidget );
20 STD_SDIDesktop::~STD_SDIDesktop()
24 /*!\retval SUIT_ViewWindow - return const active window.*/
25 SUIT_ViewWindow* STD_SDIDesktop::activeWindow() const
27 const QObjectList* children = myMainWidget->children();
31 QPtrList<SUIT_ViewWindow> winList;
32 for ( QObjectListIt it( *children ); it.current(); ++it )
34 if ( it.current()->inherits( "SUIT_ViewWindow" ) )
35 winList.append( (SUIT_ViewWindow*)it.current() );
38 SUIT_ViewWindow* win = 0;
39 for ( QPtrListIterator<SUIT_ViewWindow> itr( winList ); itr.current() && !win; ++itr )
41 if ( itr.current()->isActiveWindow() )
45 if ( !win && !winList.isEmpty() )
46 win = winList.getFirst();
51 /*!\retval QPtrList<SUIT_ViewWindow> - return const active window list.*/
52 QPtrList<SUIT_ViewWindow> STD_SDIDesktop::windows() const
54 QPtrList<SUIT_ViewWindow> winList;
55 winList.append( activeWindow() );
59 /*!\retval QWidget - pointer to main window.*/
60 QWidget* STD_SDIDesktop::parentArea() const