Qt 4.8
Public Functions | Private Functions | Properties | Friends | List of all members
QSupportedWritingSystems Class Reference

The QSupportedWritingSystems class is used when registering fonts with the internal Qt fontdatabase. More...

#include <qplatformfontdatabase_qpa.h>

Public Functions

QSupportedWritingSystemsoperator= (const QSupportedWritingSystems &other)
 Assigns the other supported writing systems object to this object. More...
 
 QSupportedWritingSystems ()
 
 QSupportedWritingSystems (const QSupportedWritingSystems &other)
 
void setSupported (QFontDatabase::WritingSystem, bool supported=true)
 Sets the supported state of the writing system given by writingSystem to the value specified by support. More...
 
bool supported (QFontDatabase::WritingSystem) const
 Returns true if the writing system given by writingSystem is supported; otherwise returns false. More...
 
 ~QSupportedWritingSystems ()
 Destroys the object. More...
 

Private Functions

void detach ()
 

Properties

QWritingSystemsPrivated
 

Friends

Q_GUI_EXPORT bool operator!= (const QSupportedWritingSystems &, const QSupportedWritingSystems &)
 
Q_GUI_EXPORT bool operator== (const QSupportedWritingSystems &, const QSupportedWritingSystems &)
 

Detailed Description

The QSupportedWritingSystems class is used when registering fonts with the internal Qt fontdatabase.

Since
4.8

Its to provide an easy to use interface for indicating what writing systems a specific font supports.

Definition at line 60 of file qplatformfontdatabase_qpa.h.

Constructors and Destructors

◆ QSupportedWritingSystems() [1/2]

QSupportedWritingSystems::QSupportedWritingSystems ( )

◆ QSupportedWritingSystems() [2/2]

QSupportedWritingSystems::QSupportedWritingSystems ( const QSupportedWritingSystems other)

Definition at line 157 of file qplatformfontdatabase_qpa.cpp.

158 {
159  d = other.d;
160  d->ref.ref();
161 }
bool ref()
Atomically increments the value of this QAtomicInt.
QWritingSystemsPrivate * d

◆ ~QSupportedWritingSystems()

QSupportedWritingSystems::~QSupportedWritingSystems ( )

Destroys the object.

Definition at line 180 of file qplatformfontdatabase_qpa.cpp.

181 {
182  if (!d->ref.deref())
183  delete d;
184 }
bool deref()
Atomically decrements the value of this QAtomicInt.
QWritingSystemsPrivate * d

Functions

◆ detach()

void QSupportedWritingSystems::detach ( )
private

Definition at line 186 of file qplatformfontdatabase_qpa.cpp.

187 {
188  if (d->ref != 1) {
190  if (!d->ref.deref())
191  delete d;
192  d = newd;
193  }
194 }
bool deref()
Atomically decrements the value of this QAtomicInt.
QWritingSystemsPrivate * d

◆ operator=()

QSupportedWritingSystems & QSupportedWritingSystems::operator= ( const QSupportedWritingSystems other)

Assigns the other supported writing systems object to this object.

Definition at line 166 of file qplatformfontdatabase_qpa.cpp.

167 {
168  if (d != other.d) {
169  other.d->ref.ref();
170  if (!d->ref.deref())
171  delete d;
172  d = other.d;
173  }
174  return *this;
175 }
bool ref()
Atomically increments the value of this QAtomicInt.
bool deref()
Atomically decrements the value of this QAtomicInt.
QWritingSystemsPrivate * d

◆ setSupported()

void QSupportedWritingSystems::setSupported ( QFontDatabase::WritingSystem  writingSystem,
bool  support = true 
)

Sets the supported state of the writing system given by writingSystem to the value specified by support.

A value of true indicates that the writing system is supported; a value of false indicates that it is unsupported.

See also
supported()

Definition at line 204 of file qplatformfontdatabase_qpa.cpp.

Referenced by QBasicUnixFontDatabase::addTTFile(), determineWritingSystemsFromTrueTypeBits(), QFontconfigDatabase::populateFontDatabase(), QCoreTextFontDatabase::populateFontDatabase(), and QPlatformFontDatabase::registerQPF2Font().

205 {
206  detach();
207  d->vector[writingSystem] = support;
208 }
QWritingSystemsPrivate * d

◆ supported()

bool QSupportedWritingSystems::supported ( QFontDatabase::WritingSystem  writingSystem) const

Returns true if the writing system given by writingSystem is supported; otherwise returns false.

See also
setSupported()

Definition at line 216 of file qplatformfontdatabase_qpa.cpp.

Referenced by QFontconfigDatabase::populateFontDatabase(), and qt_registerFont().

217 {
218  return d->vector.at(writingSystem);
219 }
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
QWritingSystemsPrivate * d

Friends and Related Functions

◆ operator!=

Q_GUI_EXPORT bool operator!= ( const QSupportedWritingSystems ,
const QSupportedWritingSystems  
)
friend

◆ operator==

Q_GUI_EXPORT bool operator== ( const QSupportedWritingSystems ,
const QSupportedWritingSystems  
)
friend

Properties

◆ d

QWritingSystemsPrivate* QSupportedWritingSystems::d
private

Definition at line 75 of file qplatformfontdatabase_qpa.h.

Referenced by operator=(), and QSupportedWritingSystems().


The documentation for this class was generated from the following files: