I am trying to implement a starup banner that should be shown above the main application window. It works fine on Windows, but on Mac OS X I can't get two windows shown at the same time (unless I show the banner after a some large time interval). Is there a way to ensure the window is visible on the screen before showing another one?
This is how I tried it:
#include <QApplication>
#include "mainwindow.h"
#include "banner.h"
int main(int argc, char * argv[])
{
MainWindow mainWindow;
mainWindow.show();
//mainWindow.raise();
Banner banner;
//QTimer::singleShot(0, &banner, SLOT(show()));
//QTimer::singleShot(0, &banner, SLOT(raise()));
banner.show();
return app.exec();
}
#include <QApplication>
#include "mainwindow.h"
#include "banner.h"
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
MainWindow mainWindow;
mainWindow.show();
//mainWindow.raise();
Banner banner;
//QTimer::singleShot(0, &banner, SLOT(show()));
//QTimer::singleShot(0, &banner, SLOT(raise()));
banner.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
I tried to use show, raise, delayed show/raise with zero-time interval, but nothing helps: still I see only the banner window when the application is launched, the main window becomes visible only when I click the application icon on the task bar.
Bookmarks