/*! Sets the application-wide default style sheet to \a sheet, deleting any style sheet previously set. The ownership is transferred to Q3StyleSheet. \sa defaultSheet() */ void Q3StyleSheet::setDefaultSheet(Q3StyleSheet* sheet) { if (defaultsheet != sheet) { if (defaultsheet) qt_cleanup_stylesheet.reset(); delete defaultsheet; } defaultsheet = sheet; if (defaultsheet) qt_cleanup_stylesheet.set(&defaultsheet); }
/*! Sets the default \a factory, destroying any previously set mime source provider. The ownership of the factory is transferred to Qt. \sa defaultFactory() */ void Q3MimeSourceFactory::setDefaultFactory(Q3MimeSourceFactory* factory) { if (!defaultfactory) qmime_cleanup_factory.set(&defaultfactory); else if (defaultfactory != factory) delete defaultfactory; defaultfactory = factory; }
/*! 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 also serves as the initial style sheet for the more complex render widgets, QTextEdit and QTextBrowser. \sa setDefaultSheet() */ Q3StyleSheet* Q3StyleSheet::defaultSheet() { if (!defaultsheet) { defaultsheet = new Q3StyleSheet(); qt_cleanup_stylesheet.set(&defaultsheet); } return defaultsheet; }
/*! Returns the application-wide default mime source factory. This factory is used by rich text rendering classes such as QSimpleRichText, QWhatsThis and QMessageBox to resolve named references within rich text documents. It serves also as the initial factory for the more complex render widgets, QTextEdit and QTextBrowser. \sa setDefaultFactory() */ Q3MimeSourceFactory* Q3MimeSourceFactory::defaultFactory() { if (!defaultfactory) { defaultfactory = new Q3MimeSourceFactory(); qmime_cleanup_factory.set(&defaultfactory); QTextImageHandler::externalLoader = richTextImageLoader; } return defaultfactory; }