本文整理汇总了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;
}
}
示例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 );
}
示例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);
}
示例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);
}
}
}
}
}
示例5: TAppSettings
void TAppSettings::instantiate(const QString &path)
{
if (!appSettings) {
appSettings = new TAppSettings(path);
qAddPostRoutine(::cleanup);
}
}
示例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;
}
示例7: qAddPostRoutine
ApplicationSettings *ApplicationSettings::self() {
if (!settings_self) {
settings_self = new ApplicationSettings;
qAddPostRoutine(cleanup);
}
return settings_self;
}
示例8: lock
/*!
\internal
*/
void QTouchDevicePrivate::registerDevice(QTouchDevice *dev)
{
QMutexLocker lock(&devicesMutex);
if (deviceList()->isEmpty())
qAddPostRoutine(cleanupDevicesList);
deviceList()->append(dev);
}
示例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;
}
示例10: qAddPostRoutine
ViewItemManager *ViewItemManager::self() {
if (!_vim_self) {
_vim_self = new ViewItemManager;
qAddPostRoutine(cleanup);
}
return _vim_self;
}
示例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(); });
}
示例12: qAddPostRoutine
void ObjectFactory::registerFactory(const QString& node, ObjectFactory *factory) {
if (!factories) {
factories = new QMap<QString,ObjectFactory*>;
qAddPostRoutine(cleanupObjects);
}
factories->insert(node, factory);
}
示例13: TMultiplexingServer
void TMultiplexingServer::instantiate(int listeningSocket)
{
if (!multiplexingServer) {
multiplexingServer = new TMultiplexingServer(listeningSocket);
qAddPostRoutine(::cleanup);
}
}
示例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);
}
示例15: qAddPostRoutine
PlotItemManager *PlotItemManager::self() {
if (!_self) {
_self = new PlotItemManager;
qAddPostRoutine(cleanup);
}
return _self;
}