Q3StyleSheet Class ReferenceThe Q3StyleSheet class is a collection of styles for rich text rendering and a generator of tags. Далее... #include <Q3StyleSheet> Данный класс является частью библиотеки поддержки Qt 3. Он предоставлен для поддержки ранее написанного кода. Мы настоятельно не рекомендуем использовать этот класс в новом коде. Для получения дополнительной информации смотрите Портирование на Qt 4. Унаследован от: QObject. Открытые функции
Статические открытые члены
Дополнительные унаследованные члены
Подробное описаниеThe Q3StyleSheet class is a collection of styles for rich text rendering and a generator of tags. By creating Q3StyleSheetItem objects for a style sheet you build a definition of a set of tags. This definition will be used by the internal rich text rendering system to parse and display text documents to which the style sheet applies. Rich text is normally visualized in a QTextEdit or a QTextBrowser. However, QLabel, QWhatsThis and QMessageBox also support it, and other classes are likely to follow. With QSimpleRichText it is possible to use the rich text renderer for custom widgets as well. The default Q3StyleSheet object has the following style bindings, sorted by structuring bindings, anchors, character style bindings (i.e. inline styles), special elements such as horizontal lines or images, and other tags. In addition, rich text supports simple HTML tables. The structuring tags are
Anchors and links are done with a single tag:
The default character style bindings are
Special elements are:
In addition, rich text supports simple HTML tables. A table consists of one or more rows each of which contains one or more cells. Cells are either data cells or header cells, depending on their content. Cells which span rows and columns are supported.
Описание функций-членовQ3StyleSheet::Q3StyleSheet ( QObject * parent = 0, const char * name = 0 )Creates a style sheet called name, with parent parent. Like any QObject it will be deleted when its parent is destroyed (if the child still exists). By default the style sheet has the tag definitions defined above. Q3StyleSheet::~Q3StyleSheet () [virtual]Destroys the style sheet. All styles inserted into the style sheet will be deleted. QString Q3StyleSheet::convertFromPlainText ( const QString & plain, Q3StyleSheetItem::WhiteSpaceMode mode = Q3StyleSheetItem::WhiteSpacePre ) [static]Вспомогательная функция. Конвертирует простую текстовую строку plain в параграф форматированного текста при сохранении большинства ее вида. mode определяет whitespace mode. Possible values are Q3StyleSheetItem::WhiteSpacePre (no wrapping, all whitespaces preserved) and Q3StyleSheetItem::WhiteSpaceNormal (wrapping, simplified whitespaces). See also escape(). Q3StyleSheet * Q3StyleSheet::defaultSheet () [static]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. See also setDefaultSheet(). void Q3StyleSheet::error ( const QString & msg ) const [virtual]This virtual function is called when an error occurs when processing rich text. Reimplement it if you need to catch error messages. Errors might occur if some rich text strings contain tags that are not understood by the stylesheet, if some tags are nested incorrectly, or if tags are not closed properly. msg is the error message. QString Q3StyleSheet::escape ( const QString & plain ) [static]Вспомогательная функция. Конвертирует простую текстовую строку plain в параграф форматированного текста с экранированием любых HTML мета-символов. See also convertFromPlainText(). Q3StyleSheetItem * Q3StyleSheet::item ( const QString & name )Returns the style called name or 0 if there is no such style. const Q3StyleSheetItem * Q3StyleSheet::item ( const QString & name ) constЭто перегруженная функция. Returns the style called name or 0 if there is no such style (const version) bool Q3StyleSheet::mightBeRichText ( const QString & text ) [static]Возвращает истину если строка text подобна форматированному тексту; в противном случае ложь. Эта функция использует простой и поэтому быстрый эвристический способ анализа. Она, главным образом, проверяет, есть ли что-либо, что напоминает признаки форматирования до первого разрыва строки. Хотя для большинства случаев результат может быть правилен, никакой гарантии не дается. void Q3StyleSheet::scaleFont ( QFont & font, int logicalSize ) const [virtual]Scales the font font to the appropriate physical point size corresponding to the logical font size logicalSize. When calling this function, font has a point size corresponding to the logical font size 3. Logical font sizes range from 1 to 7, with 1 being the smallest. See also Q3StyleSheetItem::logicalFontSize(), Q3StyleSheetItem::logicalFontSizeStep(), and QFont::setPointSize(). void Q3StyleSheet::setDefaultSheet ( Q3StyleSheet * sheet ) [static]Sets the application-wide default style sheet to sheet, deleting any style sheet previously set. The ownership is transferred to Q3StyleSheet. See also defaultSheet(). |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |