当前位置: 首页>>代码示例>>C++>>正文


C++ qAddPostRoutine函数代码示例

本文整理汇总了C++中qAddPostRoutine函数的典型用法代码示例。如果您正苦于以下问题:C++ qAddPostRoutine函数的具体用法?C++ qAddPostRoutine怎么用?C++ qAddPostRoutine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了qAddPostRoutine函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: defined

void Q3SocketDevice::init()
{
#if !defined(QT_NO_IPV6)
    if ( !initialized ) {
	WSAData wsadata;
	// IPv6 requires Winsock v2.0 or better.
	if ( WSAStartup( MAKEWORD(2,0), &wsadata ) != 0 ) {
#  if defined(QSOCKETDEVICE_DEBUG)
	    qDebug( "Q3SocketDevice: WinSock v2.0 initialization failed, disabling IPv6 support." );
#  endif
	} else {
	    qAddPostRoutine( cleanupWinSock );
	    initialized = 0x20;
	    return;
	}
    }
#endif

    if (!initialized) {
	WSAData wsadata;
	if ( WSAStartup( MAKEWORD(1,1), &wsadata ) != 0 ) {
#if defined(QT_CHECK_NULL)
	    qWarning( "Q3SocketDevice: WinSock initialization failed" );
#endif
#if defined(QSOCKETDEVICE_DEBUG)
	    qDebug( "Q3SocketDevice: WinSock initialization failed"  );
#endif
	    return;
	}
	qAddPostRoutine( cleanupWinSock );
	initialized = 0x11;
    }
}
开发者ID:RS102839,项目名称:qt,代码行数:33,代码来源:q3socketdevice_win.cpp

示例2: qt_xdnd_setup

void qt_xdnd_setup() {
    // set up protocol atoms
    qt_x11_intern_atom( "XdndEnter", &qt_xdnd_enter );
    qt_x11_intern_atom( "XdndPosition", &qt_xdnd_position );
    qt_x11_intern_atom( "XdndStatus", &qt_xdnd_status );
    qt_x11_intern_atom( "XdndLeave", &qt_xdnd_leave );
    qt_x11_intern_atom( "XdndDrop", &qt_xdnd_drop );
    qt_x11_intern_atom( "XdndFinished", &qt_xdnd_finished );
    qt_x11_intern_atom( "XdndTypeList", &qt_xdnd_type_list );

    qt_x11_intern_atom( "XdndSelection", &qt_xdnd_selection );

    qt_x11_intern_atom( "XdndAware", &qt_xdnd_aware );
    qt_x11_intern_atom( "XdndProxy", &qt_xdnd_proxy );


    qt_x11_intern_atom( "XdndActionCopy", &qt_xdnd_action_copy );
    qt_x11_intern_atom( "XdndActionLink", &qt_xdnd_action_link );
    qt_x11_intern_atom( "XdndActionMove", &qt_xdnd_action_move );
    qt_x11_intern_atom( "XdndActionPrivate", &qt_xdnd_action_private );

    qt_x11_intern_atom( "QT_SELECTION", &qt_selection_property );
    qt_x11_intern_atom( "INCR", &qt_incr_atom );

    qAddPostRoutine( qt_xdnd_cleanup );
}
开发者ID:AliYousuf,项目名称:abanq-port,代码行数:26,代码来源:qdnd_x11.cpp

示例3: make_navProcUPP

static const NavEventUPP make_navProcUPP()
{
    if(mac_navProcUPP)
        return mac_navProcUPP;
    qAddPostRoutine(cleanup_navProcUPP);
    return mac_navProcUPP = NewNavEventUPP(qt_mac_filedialog_event_proc);
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:7,代码来源:q3filedialog_mac.cpp

示例4: qAddPostRoutine

void TSessionStoreFactory::loadPlugins()
{
    if (!ssifs) {
        ssifs = new QList<TSessionStoreInterface *>();
        qAddPostRoutine(cleanup);
        
        // Init hash
        hash.insert(TSessionSqlObjectStore().key().toLower(), SqlObject);
        hash.insert(TSessionCookieStore().key().toLower(), Cookie);
        hash.insert(TSessionFileStore().key().toLower(), File);

        QDir dir(Tf::app()->pluginPath());
        QStringList list = dir.entryList(QDir::Files);
        for (QStringListIterator i(list); i.hasNext(); ) {
            QPluginLoader loader(dir.absoluteFilePath(i.next()));
            TSessionStoreInterface *iface = qobject_cast<TSessionStoreInterface *>(loader.instance());
            if ( iface ) {
                ssifs->append(iface);
                QStringList keys = iface->keys();
                for (QStringListIterator j(keys); j.hasNext(); ) {
                    hash.insert(j.next(), Plugin);
                }
            }   
        }
    }
}
开发者ID:pivaldi,项目名称:TreeFrog,代码行数:26,代码来源:tsessionstorefactory.cpp

示例5: TAppSettings

void TAppSettings::instantiate(const QString &path)
{
    if (!appSettings) {
        appSettings = new TAppSettings(path);
        qAddPostRoutine(::cleanup);
    }
}
开发者ID:skipbit,项目名称:treefrog-framework,代码行数:7,代码来源:tappsettings.cpp

示例6: graphics

static WebGraphicHash* graphics()
{
    WebGraphicHash* hash = _graphics();

    if (hash->isEmpty()) {

        // prevent ~QPixmap running after ~QApplication (leaks native pixmaps)
        qAddPostRoutine(earlyClearGraphics);

        // QWebSettings::MissingImageGraphic
        hash->insert("missingImage", QPixmap(QLatin1String(":webkit/resources/missingImage.png")));
        // QWebSettings::MissingPluginGraphic
        hash->insert("nullPlugin", QPixmap(QLatin1String(":webkit/resources/nullPlugin.png")));
        // QWebSettings::DefaultFrameIconGraphic
        hash->insert("urlIcon", QPixmap(QLatin1String(":webkit/resources/urlIcon.png")));
        // QWebSettings::TextAreaSizeGripCornerGraphic
        hash->insert("textAreaResizeCorner", QPixmap(QLatin1String(":webkit/resources/textAreaResizeCorner.png")));
        // QWebSettings::DeleteButtonGraphic
        hash->insert("deleteButton", QPixmap(QLatin1String(":webkit/resources/deleteButton.png")));
        // QWebSettings::InputSpeechButtonGraphic
        hash->insert("inputSpeech", QPixmap(QLatin1String(":webkit/resources/inputSpeech.png")));
    }

    return hash;
}
开发者ID:victusfate,项目名称:webkit-graphics,代码行数:25,代码来源:ImageQt.cpp

示例7: qAddPostRoutine

ApplicationSettings *ApplicationSettings::self() {
  if (!settings_self) {
    settings_self = new ApplicationSettings;
    qAddPostRoutine(cleanup);
  }
  return settings_self;
}
开发者ID:jhgorse,项目名称:kst,代码行数:7,代码来源:applicationsettings.cpp

示例8: lock

/*!
  \internal
  */
void QTouchDevicePrivate::registerDevice(QTouchDevice *dev)
{
    QMutexLocker lock(&devicesMutex);
    if (deviceList()->isEmpty())
        qAddPostRoutine(cleanupDevicesList);
    deviceList()->append(dev);
}
开发者ID:AlexSoehn,项目名称:qt-base-deb,代码行数:10,代码来源:qtouchdevice.cpp

示例9: locker

/// Returns the actual singleton instance, creates it on first access. Mutex-protected.
/// ContextRegistryInfo and ContextPropertyInfo use this method to access the backend.
/// The optional \a backendName specifies the backend to force, ie: 'xml' or 'cdb'.
InfoBackend* InfoBackend::instance(const QString &backendName)
{
    static QMutex mutex;
    QMutexLocker locker(&mutex);
    if (!backendInstance)
    {
        // Backend instance doesn't exist -> create it
        if (backendName == "xml")
            backendInstance = new InfoXmlBackend;
        else if (backendName == "cdb")
            backendInstance = new InfoCdbBackend;
        else {
            if (InfoCdbBackend::databaseExists())
                backendInstance = new InfoCdbBackend;
            else
                backendInstance = new InfoXmlBackend;
        }

        // Move the backend to the main thread
        backendInstance->moveToThread(QCoreApplication::instance()->thread());

        // We must ensure that:
        // 1) QFileSystemWatcher is deleted before QCoreApplication.
        // 2) libcontextsubscriber can be unloaded successfully
        // (QCoreApplication cannot have a post routine that is inside a library
        // that has been unloaded.)

        // For 1), we add a post routine to QCoreApplication for deleting the
        // QFileSystemWathcer, for 2) we remove the post routine and delete the
        // QFileSystemWatcher when the library is unloaded.
        qAddPostRoutine(destroyInstance);
    }

    return backendInstance;
}
开发者ID:rburchell,项目名称:ck,代码行数:38,代码来源:infobackend.cpp

示例10: qAddPostRoutine

ViewItemManager *ViewItemManager::self() {
  if (!_vim_self) {
    _vim_self = new ViewItemManager;
    qAddPostRoutine(cleanup);
  }
  return _vim_self;
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:7,代码来源:viewitemmanager.cpp

示例11: qAddPostRoutine

OpenCVItem::OpenCVItem(QGraphicsItem *parent)
    :P(parent,Qt::Window) {

    static OpenCVStyle * style_=nullptr;
    if (style_==nullptr) {
        style_=new __private::OpenCVItemStyle/*construct by default style*/;
        qAddPostRoutine([]() {delete style_; style_=nullptr; });
    }

    this->setStyle(style_);

    {
        QPalette pal=this->palette();
        pal.setBrush(QPalette::Background,Qt::transparent);
        this->setPalette(pal);
    }

    this->resize(128,128);
    this->setMinimumWidth(128);
    this->setMinimumHeight(128);
    this->setPos(std::rand()&63,(std::rand()&63)+36);
    this->setAttribute(Qt::WA_DeleteOnClose);

    connect(this,&OpenCVItem::yChanged,this,[this]() {_onYChanged(); });
    connect(this,&OpenCVItem::xChanged,this,[this]() {_onXChanged(); });
}
开发者ID:ngzHappy,项目名称:OCVT0,代码行数:26,代码来源:OpenCVItem.cpp

示例12: qAddPostRoutine

void ObjectFactory::registerFactory(const QString& node, ObjectFactory *factory) {
  if (!factories) {
    factories = new QMap<QString,ObjectFactory*>;
    qAddPostRoutine(cleanupObjects);
  }
  factories->insert(node, factory);
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:7,代码来源:objectfactory.cpp

示例13: TMultiplexingServer

void TMultiplexingServer::instantiate(int listeningSocket)
{
    if (!multiplexingServer) {
        multiplexingServer = new TMultiplexingServer(listeningSocket);
        qAddPostRoutine(::cleanup);
    }
}
开发者ID:gaoxiaojun,项目名称:treefrog-framework,代码行数:7,代码来源:tmultiplexingserver_linux.cpp

示例14: make_navFilterUPP

static const NavObjectFilterUPP make_navFilterUPP()
{
    if(mac_navFilterUPP)
        return mac_navFilterUPP;
    qAddPostRoutine(cleanup_navFilterUPP);
    return mac_navFilterUPP = NewNavObjectFilterUPP(qt_mac_nav_filter);
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:7,代码来源:q3filedialog_mac.cpp

示例15: qAddPostRoutine

PlotItemManager *PlotItemManager::self() {
  if (!_self) {
    _self = new PlotItemManager;
    qAddPostRoutine(cleanup);
  }
  return _self;
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:7,代码来源:plotitemmanager.cpp


注:本文中的qAddPostRoutine函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。