/* \internal Aquire ownership of the shared double buffer pixmap, subject to the following conditions: \list 1 \i double buffering is enabled globally. \i the shared double buffer pixmap is not in use. \i the size specified in begin() is valid, and within limits. \endlist If all of these conditions are met, then this QSharedDoubleBuffer object becomes the owner of the shared double buffer pixmap. The shared double buffer pixmap is resize if necessary, and this function returns a pointer to the pixmap. Ownership must later be relinquished by calling releasePixmap(). If none of the above conditions are met, this function returns zero. \sa releasePixmap() */ QPixmap *QSharedDoubleBuffer::getPixmap() { if ( isDisabled() ) { // double buffering disabled globally return 0; } if ( qdb_owner ) { // shared pixmap already in use return 0; } if ( rw <= 0 || rh <= 0 || ( hardLimitWidth > 0 && rw >= hardLimitWidth ) || ( hardLimitHeight > 0 && rh >= hardLimitHeight ) ) { // invalid size, or hard limit reached return 0; } if ( rw >= sharedLimitWidth || rh >= sharedLimitHeight ) { if ( flags & Force ) { rw = QMIN(rw, 8000); rh = QMIN(rh, 8000); // need to create a big pixmap and start the cleaner if ( ! qdb_force_pixmap ) { qdb_force_pixmap = new QPixmap( rw, rh ); qdb_pixmap_cleanup.add( &qdb_force_pixmap ); } else if ( qdb_force_pixmap->width () < rw || qdb_force_pixmap->height() < rh ) { qdb_force_pixmap->resize( rw, rh ); } qdb_owner = this; staticCleaner()->start(); return qdb_force_pixmap; } // size is outside shared limit return 0; } if ( ! qdb_shared_pixmap ) { qdb_shared_pixmap = new QPixmap( rw, rh ); qdb_pixmap_cleanup.add( &qdb_shared_pixmap ); } else if ( qdb_shared_pixmap->width() < rw || qdb_shared_pixmap->height() < rh ) { qdb_shared_pixmap->resize( rw, rh ); } qdb_owner = this; return qdb_shared_pixmap; }
/*! Returns the application-wide default style sheet. This style sheet is used by rich text rendering classes such as QSimpleRichText, QWhatsThis and QMessageBox to define the rendering style and available tags within rich text documents. It serves also as initial style sheet for the more complex render widgets QTextEdit and QTextBrowser. \sa setDefaultSheet() */ QStyleSheet* QStyleSheet::defaultSheet() { if (!defaultsheet) { defaultsheet = new QStyleSheet(); qt_cleanup_stylesheet.add( defaultsheet ); } return defaultsheet; }
QEditorFactory * QEditorFactory::defaultFactory() { if( defaultfactory == 0 ){ defaultfactory = new QEditorFactory(); q_cleanup_editor_factory.add( &defaultfactory ); } return defaultfactory; }
/*! Sets the application-wide default style sheet to \a sheet, deleting any style sheet previously set. The ownership is transferred to QStyleSheet. \sa defaultSheet() */ void QStyleSheet::setDefaultSheet( QStyleSheet* sheet) { if ( defaultsheet != sheet ) { if ( defaultsheet ) qt_cleanup_stylesheet.remove( defaultsheet ); delete defaultsheet; } defaultsheet = sheet; if ( defaultsheet ) qt_cleanup_stylesheet.add( defaultsheet ); }
void QEditorFactory::installDefaultFactory( QEditorFactory * factory ) { if( factory == 0 || factory == defaultfactory ) return; if( defaultfactory != 0 ){ q_cleanup_editor_factory.remove( &defaultfactory ); delete defaultfactory; } defaultfactory = factory; q_cleanup_editor_factory.add( &defaultfactory ); }
QPluginManager<WidgetInterface> *widgetManager() { if ( !widgetPluginManager ) { QString pluginDir = "/designer"; #if !defined(UIC) if ( qwf_plugin_dir ) pluginDir = *qwf_plugin_dir; #endif widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(), pluginDir ); cleanup_manager.add( &widgetPluginManager ); #if defined(UIC) if ( dbnounload ) widgetPluginManager->setAutoUnload( FALSE ); if ( dbpaths ) { QStringList::ConstIterator it = dbpaths->begin(); for ( ; it != dbpaths->end(); ++it ) widgetPluginManager->addLibraryPath( *it ); } #endif } return widgetPluginManager; }