Qt 4.8
Public Functions | Public Variables | List of all members
QtFontStyle::Key Struct Reference

Public Functions

 Key (const QString &styleString)
 
 Key ()
 
 Key (const Key &o)
 
bool operator!= (const Key &other)
 
bool operator< (const Key &o)
 
bool operator== (const Key &other)
 

Public Variables

signed int stretch: 12
 
uint style: 2
 
signed int weight: 8
 

Detailed Description

Definition at line 219 of file qfontdatabase.cpp.

Constructors and Destructors

◆ Key() [1/3]

QtFontStyle::Key::Key ( const QString styleString)

Definition at line 295 of file qfontdatabase.cpp.

297 {
298  weight = getFontWeight(styleString);
299 
300  if (styleString.contains(QLatin1String("Italic"))
301  || styleString.contains(QApplication::translate("QFontDatabase", "Italic")))
303  else if (styleString.contains(QLatin1String("Oblique"))
304  || styleString.contains(QApplication::translate("QFontDatabase", "Oblique")))
306 }
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:904
static QString translate(const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
static int getFontWeight(const QString &weightString)

◆ Key() [2/3]

QtFontStyle::Key::Key ( )
inline

◆ Key() [3/3]

QtFontStyle::Key::Key ( const Key o)
inline

Definition at line 223 of file qfontdatabase.cpp.

223 : style(o.style), weight(o.weight), stretch(o.stretch) { }

Functions

◆ operator!=()

bool QtFontStyle::Key::operator!= ( const Key other)
inline

Definition at line 232 of file qfontdatabase.cpp.

232  {
233  return !operator==(other);
234  }
bool operator==(const Key &other)

◆ operator<()

bool QtFontStyle::Key::operator< ( const Key o)
inline

Definition at line 235 of file qfontdatabase.cpp.

235  {
236  int x = (style << 12) + (weight << 14) + stretch;
237  int y = (o.style << 12) + (o.weight << 14) + o.stretch;
238  return (x < y);
239  }

◆ operator==()

bool QtFontStyle::Key::operator== ( const Key other)
inline

Definition at line 228 of file qfontdatabase.cpp.

228  {
229  return (style == other.style && weight == other.weight &&
230  (stretch == 0 || other.stretch == 0 || stretch == other.stretch));
231  }

Properties

◆ stretch

signed int QtFontStyle::Key::stretch

◆ style

uint QtFontStyle::Key::style

◆ weight

signed int QtFontStyle::Key::weight

The documentation for this struct was generated from the following file: