Originally Posted by
b1
formB = new UIDisplayPart::UIDisplayPart;
...
formB->show();
formB->raise();
formB->activateWindow();
QWidget::activateWindow() won't work for windows that aren't shown and new windows are shown after the control goes back to the event loop.
This might work:
void BackOrderForm::activateFormB()
{
formB->activateWindow();
}
...
QTimer::singleShot( 0,
this,
SLOT( activateFormB
() ) );
// or if you don't like timers:
// QMetaObject::invokeMethod( this, "activateFormB", Qt::QueuedConnection );
void BackOrderForm::activateFormB()
{
formB->activateWindow();
}
...
QTimer::singleShot( 0, this, SLOT( activateFormB() ) );
// or if you don't like timers:
// QMetaObject::invokeMethod( this, "activateFormB", Qt::QueuedConnection );
To copy to clipboard, switch view to plain text mode
Another solution you can try is:
formB->show();
formB->raise();
QApplication::processEvents();
// or QApplication::processEvents( QEventLoop::ExcludeUserInputEvents ); formB->activateWindow();
formB->show();
formB->raise();
QApplication::processEvents(); // or QApplication::processEvents( QEventLoop::ExcludeUserInputEvents );
formB->activateWindow();
To copy to clipboard, switch view to plain text mode
Bookmarks