// != 0 -> use activateMainWidget() directly
// == 0 -> use indirect method (following ...)
#define _dir_activateMainWidget 0
// indirectly ...
// != 0 -> use activateMainWidget()
#define _indir_activateMainWidget 0
// indirectly on this ...
// != 0 -> use show(); raise(); activateWindow()
#define _indir_this_show_raise_activateWindow 0
// != 0 -> use show(); raise(); activateWindow(); setFocus()
#define _indir_this_show_raise_activateWindow_setFocus 0
// != 0 -> use setWindowState(); show(); raise(); activateWindow()
#define _indir_this_setWindowState_show_raise_activateWindow 0
// != 0 -> use setWindowState(); show(); raise(); activateWindow(); setFocus()
#define _indir_this_setWindowState_show_raise_activateWindow_setFocus 1
// indirectly on pMainWidget widget ...
// != 0 -> use show(); raise(); activateWindow()
#define _indir_MainWidget_show_raise_activateWindow 0
// != 0 -> use show(); raise(); activateWindow(); setFocus()
#define _indir_MainWidget_show_raise_activateWindow_setFocus 0
// != 0 -> use setWindowState(); show(); raise(); activateWindow()
#define _indir_MainWidget_setWindowState_show_raise_activateWindow 0
// != 0 -> use setWindowState(); show(); raise(); activateWindow(); setFocus()
#define _indir_MainWidget_setWindowState_show_raise_activateWindow_setFocus 0
// indirectly on pExitAllButton button ...
// != 0 -> use show(); raise(); activateWindow()
#define _indir_ExitAllButton_show_raise_activateWindow 0
// != 0 -> use show(); raise(); activateWindow(); setFocus()
#define _indir_ExitAllButton_show_raise_activateWindow_setFocus 0
#include "clMain.h"
#include "Main.h"
#include "CustomEvent.h"
#include <QGridLayout>
clMain * pMain = 0;
{
pLayout->addWidget( pExitAllButton, 0, 0, 1, 1 );
pMainWidget->setLayout( pLayout );
setCentralWidget( pMainWidget );
connect( pExitAllButton, SIGNAL( clicked() ),
this, SLOT( vExitAllClicked() ) );
#if _dir_activateMainWidget
connect( pApp,
SIGNAL( messageReceived
( const QString & ) ),
pApp, SLOT( activateMainWidget() ) );
#else //_USE_activateMainWidget
connect( pApp,
SIGNAL( messageReceived
( const QString & ) ),
this, SLOT( vMessageReceivedFromOtherInst() ) );
#endif //_USE_activateMainWidget
setWindowTitle( "Original Title" );
show();
}
clMain::~clMain( void )
{
;
}
void clMain::vRaiseWindowForThisInst( void )
{
// indirectly ...
#if _indir_activateMainWidget
setWindowTitle( "** CHANGED #1 **" );
pApp->activateMainWidget();
#endif
// indirectly on this ...
#if _indir_this_show_raise_activateWindow
setWindowTitle( "** CHANGED #2a **" );
show();
raise();
activateWindow();
#endif
#if _indir_this_show_raise_activateWindow_setFocus
setWindowTitle( "** CHANGED #3a **" );
show();
raise();
activateWindow();
setFocus( Qt::OtherFocusReason );
#endif
#if _indir_this_setWindowState_show_raise_activateWindow
setWindowTitle( "** CHANGED #4a **" );
setWindowState( ( windowState() & ~ Qt::WindowMinimized ) | Qt::WindowActive );
show();
raise();
activateWindow();
#endif
#if _indir_this_setWindowState_show_raise_activateWindow_setFocus
setWindowTitle( "** CHANGED #5a **" );
setWindowState( ( windowState() & ~ Qt::WindowMinimized ) | Qt::WindowActive );
show();
raise();
activateWindow();
setFocus( Qt::OtherFocusReason );
#endif
// indirectly on pMainWidget widget ...
#if _indir_MainWidget_show_raise_activateWindow
setWindowTitle( "** CHANGED #2b **" );
pMainWidget->show();
pMainWidget->raise();
pMainWidget->activateWindow();
#endif
#if _indir_MainWidget_show_raise_activateWindow_setFocus
setWindowTitle( "** CHANGED #3b **" );
pMainWidget->show();
pMainWidget->raise();
pMainWidget->activateWindow();
pMainWidget->setFocus( Qt::OtherFocusReason );
#endif
#if _indir_MainWidget_setWindowState_show_raise_activateWindow
setWindowTitle( "** CHANGED #4b **" );
pMainWidget->setWindowState(
( pMainWidget->windowState() & ~ Qt::WindowMinimized ) | Qt::WindowActive );
pMainWidget->show();
pMainWidget->raise();
pMainWidget->activateWindow();
#endif
#if _indir_MainWidget_setWindowState_show_raise_activateWindow_setFocus
setWindowTitle( "** CHANGED #5b **" );
pMainWidget->setWindowState(
( pMainWidget->windowState() & ~ Qt::WindowMinimized ) | Qt::WindowActive );
pMainWidget->show();
pMainWidget->raise();
pMainWidget->activateWindow();
pMainWidget->setFocus( Qt::OtherFocusReason );
#endif
// indirectly on pExitAllButton button ...
#if _indir_ExitAllButton_show_raise_activateWindow
setWindowTitle( "** CHANGED #2c **" );
pExitAllButton->show();
pExitAllButton->raise();
pExitAllButton->activateWindow();
#endif
#if _indir_ExitAllButton_show_raise_activateWindow_setFocus
setWindowTitle( "** CHANGED #3c **" );
pExitAllButton->show();
pExitAllButton->raise();
pExitAllButton->activateWindow();
pExitAllButton->setFocus( Qt::OtherFocusReason );
#endif
}
void clMain
::customEvent( QEvent * event
) {
switch ( event->type() ) {
default :
break;
case Event_Main_Raise :
vRaiseWindowForThisInst();
break;
}
}
void clMain::vMessageReceivedFromOtherInst( void )
{
}
void clMain::vExitAllClicked( void )
{
close();
}
Bookmarks