CMemorySerializer::CMemorySerializer(): iser(this), oser(this) { readPos = 0; registerTypes(iser); registerTypes(oser); iser.fileVersion = SERIALIZATION_VERSION; }
int main(int argc, char **argv) { QApplication app(argc, argv); gst_init(&argc, &argv); ges_init(); registerTypes(); QDeclarativeView view; QGLWidget *g = new QGLWidget; view.setViewport(g); createGLSurface("timelineSurface", &view); createGLSurface("editorSurface", &view); view.setSource(QUrl::fromLocalFile("Timeline.qml")); view.setResizeMode(QDeclarativeView::SizeRootObjectToView); view.resize(640, 480); view.show(); if (!QDir::current().exists("media")) { qDebug () << "Media files missing. Download them by running './download.sh'"; return -1; } QObject::connect((QObject*)view.engine(), SIGNAL(quit()), &app, SLOT(quit())); return app.exec(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); waitDialog = 0; buf1.I = buf1.Q = 0; buf2.I = buf2.Q = 0; buf3.I = buf3.Q = 0; buf4.I = buf4.Q = 0; buf5.I = buf5.Q = 0; freqAxis = 0; yAxis11 = 0; yAxis21 = 0; yAxis12 = 0; yAxis22 = 0; stopRequest = false; calStepRequest = false; updateDisabledState(); registerTypes(); configureWorkerThread(); createPlots(); setupSignalsAndSlots(); loadVNADLL(); }
void Object::init() { registerTypes(); draggers = Object::create("object"); draggers->addChild(new DraggerObject(AXIS_X)); draggers->addChild(new DraggerObject(AXIS_Y)); draggers->addChild(new DraggerObject(AXIS_Z)); }
void DBusInterfaceManager::supportedChanged(const PropertyList &supportedProperties) { DebugOut()<<"supported Properties: "<<supportedProperties.size()<<endl; if(!connection) { return; } registerTypes(); }
Q_DECL_EXPORT int main(int argc, char *argv[]) { QApplication app(argc, argv); app.setOrganizationName("cuteTube2"); app.setApplicationName("cuteTube2"); Settings settings; Clipboard clipboard; Dailymotion dailymotion; DBusService dbus; NetworkAccessManagerFactory factory; Resources resources; ResourcesPlugins plugins; Transfers transfers; Utils utils; VideoLauncher launcher; Vimeo vimeo; YouTube youtube; initDatabase(); registerTypes(); plugins.load(); settings.setNetworkProxy(); QQmlApplicationEngine engine; QQmlContext *context = engine.rootContext(); context->setContextProperty("Clipboard", &clipboard); context->setContextProperty("CookieJar", factory.cookieJar()); context->setContextProperty("Dailymotion", &dailymotion); context->setContextProperty("DBus", &dbus); context->setContextProperty("Plugins", &plugins); context->setContextProperty("Resources", &resources); context->setContextProperty("Settings", &settings); context->setContextProperty("Transfers", &transfers); context->setContextProperty("Utils", &utils); context->setContextProperty("VideoLauncher", &launcher); context->setContextProperty("Vimeo", &vimeo); context->setContextProperty("YouTube", &youtube); context->setContextProperty("AUDIO_CONVERTOR_ENABLED", (QFile::exists("/usr/bin/ffmpeg")) || (QFile::exists("/usr/bin/avconv"))); context->setContextProperty("MAX_RESULTS", MAX_RESULTS); context->setContextProperty("VERSION_NUMBER", VERSION_NUMBER); engine.setNetworkAccessManagerFactory(&factory); engine.load("/opt/cutetube2/qml/main.qml"); return app.exec(); }
int main(int argc, char *argv[]) { // Prevent config being written to ~/.config/Unknown Organization/pixelpulse2.conf QCoreApplication::setOrganizationName("Pixelpulse2"); QCoreApplication::setApplicationName("Pixelpulse2"); QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates)); init_signal_handlers(argv[0]); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; registerTypes(); FileIO fileIO; BossacWrapper bossacWrapper; SessionItem smu_session; smu_session.openAllDevices(); engine.rootContext()->setContextProperty("session", &smu_session); QVariantMap versions; versions.insert("build_date", BUILD_DATE); versions.insert("git_version", GIT_VERSION); engine.rootContext()->setContextProperty("versions", versions); engine.rootContext()->setContextProperty("fileio", &fileIO); engine.rootContext()->setContextProperty("bossac", &bossacWrapper); if (argc > 1) { if (strcmp(argv[1], "-v") || strcmp(argv[1], "--version")) { std::cout << GIT_VERSION << ": Built on " << BUILD_DATE << std::endl; return 0; } engine.load(argv[1]); } else { engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); } int r = app.exec(); smu_session.closeAllDevices(); return r; }
Q_DECL_EXPORT int main(int argc, char *argv[]) { QApplication app(argc, argv); app.setOrganizationName("MusiKloud2"); app.setApplicationName("MusiKloud2"); app.setApplicationVersion(VERSION_NUMBER); app.setWindowIcon(QIcon::fromTheme("musikloud2")); Settings settings; Clipboard clipboard; DBusService dbus; Resources resources; ResourcesPlugins plugins; SoundCloud soundcloud; Transfers transfers; Utils utils; initDatabase(); registerTypes(); plugins.load(); settings.setNetworkProxy(); QQmlApplicationEngine engine; QQmlContext *context = engine.rootContext(); context->setContextProperty("Clipboard", &clipboard); context->setContextProperty("DBus", &dbus); context->setContextProperty("Plugins", &plugins); context->setContextProperty("Resources", &resources); context->setContextProperty("Settings", &settings); context->setContextProperty("SoundCloud", &soundcloud); context->setContextProperty("Transfers", &transfers); context->setContextProperty("Utils", &utils); context->setContextProperty("MAX_RESULTS", MAX_RESULTS); context->setContextProperty("VERSION_NUMBER", VERSION_NUMBER); engine.load("/opt/musikloud2/qml/main.qml"); return app.exec(); }
int main(int argc, char **argv) { QApplication app(argc, argv); QTextCodec *codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForLocale(codec); QTextCodec::setCodecForCStrings(codec); QTextCodec::setCodecForTr(codec); QDeclarativeView view; registerTypes(); #if defined(Q_OS_WIN32) QNetworkProxyFactory::setUseSystemConfiguration(true); #endif gUniqueNetwrkManager = view.engine()->networkAccessManager(); // For Maemo 5 and Symbian use screen resolution but for desktop use different size #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) || defined(Q_WS_HARMATTAN) || defined(Q_WS_SIMULATOR) // Get screen dimensions QDesktopWidget *desktop = QApplication::desktop(); const QRect screenRect = desktop->screenGeometry(); view.setResizeMode(QDeclarativeView::SizeRootObjectToView); #else // On desktop we use nHD QPoint topLeft(100,100); QSize size(360, 640); QRect screenRect(topLeft, size); #endif #ifdef Q_OS_SYMBIAN if (iAvkonAppUi) { iAvkonAppUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait); } #endif //#ifdef Q_OS_SYMBIAN // if (iAvkonAppUi) // { // iAvkonAppUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait); // // Hide the CBA // MEikAppUiFactory *factory = CEikonEnv::Static()->AppUiFactory(); // factory->CreateResourceIndependentFurnitureL(iAvkonAppUi); // CEikButtonGroupContainer *cba = CEikButtonGroupContainer::NewL(CEikButtonGroupContainer::ECba, // CEikButtonGroupContainer::EHorizontal, // iAvkonAppUi, 0); // CEikButtonGroupContainer *oldCba = factory->SwapButtonGroup(cba); // cba->MakeVisible(EFalse); // } //#endif QObject::connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit())); // Set the screen size to QML context QDeclarativeContext* context = view.rootContext(); context->setContextProperty("screenWidth", screenRect.width()); context->setContextProperty("screenHeight", screenRect.height()); view.setSource(QUrl("qrc:/main.qml")); #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) || defined(Q_WS_HARMATTAN) || defined(Q_WS_SIMULATOR) view.showFullScreen(); #else view.show(); #endif return app.exec(); }
void tst_qqmlvaluetypeproviders::initTestCase() { QQmlDataTest::initTestCase(); registerTypes(); }
CLoadFile::CLoadFile(const boost::filesystem::path & fname, int minimalVersion /*= version*/) : serializer(this) { registerTypes(serializer); openNextFile(fname, minimalVersion); }
CTypeList::CTypeList() { registerTypes(*this); }
QMap<QgsWKBTypes::Type, QgsWKBTypes::wkbEntry>* QgsWKBTypes::entries() { static QMap<QgsWKBTypes::Type, QgsWKBTypes::wkbEntry> entries = registerTypes(); return &entries; }
int main(int argc, char *argv[]) { appPath = argv[0]; printf("\nQt Creator Debugging Helper testing tool\n\n"); printf("Running query protocol\n"); qDumpObjectData440(1, 42, 0, 1, 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); fputc('\n', stdout); const TypeDumpFunctionMap tdm = registerTypes(); const TypeDumpFunctionMap::const_iterator cend = tdm.constEnd(); if (argc < 2) { usage(argv[0], tdm); return 0; } // Parse args QStringList tests; for (int a = 1; a < argc; a++) { const char *arg = argv[a]; if (arg[0] == '-') { switch (arg[1]) { case 'a': optTestAll = true; break; case 'u': optTestUninitialized = true; break; case 'v': optVerbose++; break; case 'e': optEmptyContainers = true; break; default: fprintf(stderr, "Invalid option %s\n", arg); usage(argv[0], tdm); return -1; } } else { tests.push_back(QLatin1String(arg)); } } // Go int rc = 0; if (optTestAll) { for (TypeDumpFunctionMap::const_iterator it = tdm.constBegin(); it != cend; ++it) { const QString test = it.key(); if (tests.contains(test)) { printf("\nSkipping: %s\n", qPrintable(test)); } else { printf("\nTesting: %s\n", qPrintable(test)); rc += (*it.value())(); if (optTestUninitialized) printf("Survived: %s\n", qPrintable(test)); } } } else { foreach(const QString &test, tests) { printf("\nTesting: %s\n", qPrintable(test)); const TypeDumpFunctionMap::const_iterator it = tdm.constFind(test); if (it == cend) { rc = -1; fprintf(stderr, "\nUnhandled type: %s\n", qPrintable(test)); } else { rc = (*it.value())(); } } }
int main(int argc, char *argv[]) { KAboutData aboutData("ktp-auth-handler", i18n("Telepathy Authentication Handler"), KTP_AUTH_HANDLER_VERSION); aboutData.addAuthor(i18n("David Edmundson"), i18n("Developer"), "*****@*****.**"); aboutData.addAuthor(i18n("Daniele E. Domenichelli"), i18n("Developer"), "*****@*****.**"); aboutData.setProductName("telepathy/auth-handler"); aboutData.setProgramIconName(QLatin1String("telepathy-kde")); KAboutData::setApplicationData(aboutData); // This is a very very very ugly hack that attempts to solve the following problem: // D-Bus service activated applications inherit the environment of dbus-daemon. // Normally, in KDE, startkde sets these environment variables. However, the session's // dbus-daemon is started before this happens, which means that dbus-daemon does NOT // have these variables in its environment and therefore all service-activated UIs // think that they are not running in KDE. This causes Qt not to load the KDE platform // plugin, which leaves the UI in a sorry state, using a completely wrong theme, // wrong colors, etc... // See also: // - https://bugs.kde.org/show_bug.cgi?id=269861 // - https://bugs.kde.org/show_bug.cgi?id=267770 // - https://git.reviewboard.kde.org/r/102194/ // Here we are just going to assume that kde-telepathy is always used in KDE and // not anywhere else. This is probably the best that we can do. setenv("KDE_FULL_SESSION", "true", 0); setenv("KDE_SESSION_VERSION", "5", 0); KTp::TelepathyHandlerApplication app(argc, argv); // FIXME: Move this to tp-qt4 itself registerTypes(); Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create( QDBusConnection::sessionBus(), Tp::Account::FeatureCore); Tp::ConnectionFactoryPtr connectionFactory = Tp::ConnectionFactory::create( QDBusConnection::sessionBus(), Tp::Connection::FeatureCore); Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create( QDBusConnection::sessionBus()); channelFactory->addCommonFeatures(Tp::Channel::FeatureCore); Tp::ClientRegistrarPtr clientRegistrar = Tp::ClientRegistrar::create( accountFactory, connectionFactory, channelFactory); QMap<QString,Tp::AbstractClientPtr> handlers; handlers.insert(QLatin1String("KTp.SASLHandler"), Tp::SharedPtr<SaslHandler>(new SaslHandler)); handlers.insert(QLatin1String("KTp.TLSHandler"), Tp::SharedPtr<TlsHandler>(new TlsHandler)); Tp::ChannelClassSpecList confAuthFilter = Tp::ChannelClassSpecList() << Tp::ChannelClassSpec::textChatroom(); handlers.insert(QLatin1String("KTp.ConfAuthObserver"), Tp::SharedPtr<ConferenceAuthObserver>(new ConferenceAuthObserver(confAuthFilter))); int loadedHandlers = handlers.count(); QMap<QString,Tp::AbstractClientPtr>::ConstIterator iter = handlers.constBegin(); for (; iter != handlers.constEnd(); ++iter) { if (!clientRegistrar->registerClient(iter.value(), iter.key())) { loadedHandlers--; } } if (loadedHandlers == 0) { qDebug() << "No handlers registered. Exiting"; return 1; } return app.exec(); }