#include #include #include int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget w; // These data came from a situation where Mac 'took' the second screen from Windows. // (here the widget somehow disappeared - and a strage state was stored on close) // That shouldn't happen (I will see if I can reproduce), but what is even worse is that // closing the program and restoring without having the screen // assume a person took the laptop home - then a restart of the program *must* // show the window. const char *d = "AdnQywADAAD///ofAAAAvv///YsAAAPW///6JwAAAN3///2DAAADzv////8AAAAAB4D///onAAAA3f///YMAAAPO"; QByteArray ba = QByteArray::fromBase64(d); bool wasRestored = w.restoreGeometry(ba); qDebug() << "Geometry before show:" << w.geometry(); w.show(); qDebug() << qVersion() << "Did restore: " << wasRestored << " geometry:" << w.geometry(); return a.exec(); }