int main(int argc, char **argv) { QGuiApplication app(argc, argv); QStringList args = app.arguments(); WId winId = 0; if (args.count() > 1) { bool ok; winId = args[1].toUInt(&ok); Q_ASSERT(ok); } RasterWindow window; window.show(); QWindow *foreign = QWindow::fromWinId(winId); Q_ASSERT(foreign != 0); window.setParent(foreign); return app.exec(); }
int main(int argc, char *argv[]) { printf("Create App\n"); #ifdef AA_DisableHighDpiScaling // XXX with high dpi scaling, plugin crashes without initial screen QCoreApplication::setAttribute(AA_DisableHighDpiScaling, true); #endif QApplication app(argc, argv); if (app.platformName() != "barebone") { printf("This app requires QBareBone platform\n"); return -1; } Card card; KmsManager* mgr = new KmsManager(card) QBareClient* bb = new QBareClient(app, mgr); //dump_screens(app); QList<QScreen*> screens = app.screens(); QScreen* lcd = screens[0]; QScreen* hdmi = screens[1]; int test_num = 0; if (test_num == 0) { MainWindow *w1 = new MainWindow(); //w1->winId(); //w1->windowHandle()->setScreen(lcd); w1->move(50, 50); w1->show(); //MainWindow *w2 = new MainWindow(); //w2->winId(); //w2->windowHandle()->setScreen(hdmi); //w2->move(300, 50); //w2->show(); } else if (test_num == 1) { QSurfaceFormat format; format.setSamples(16); TriangleWindow *window = new TriangleWindow(); window->setFormat(format); window->resize(640, 480); window->show(); window->setAnimating(true); } else if (test_num == 2) { RasterWindow *w = new RasterWindow(); w->show(); } else if (test_num == 3) { QWidget* moveblk = create_moveblocks(); moveblk->windowHandle()->setScreen(hdmi); moveblk->hide(); moveblk->show(); } printf("Enter mainloop\n"); app.exec(); delete bb; return 0; }
int main(int argc, char **argv) { QApplication app(argc, argv); RasterWindow window; window.show(); return app.exec(); }