Qt 4.8
Public Types | Public Functions | Properties | List of all members
QDeclarativeFontValueType Class Reference

#include <qdeclarativevaluetype_p.h>

Inheritance diagram for QDeclarativeFontValueType:
QDeclarativeValueType QObject

Public Types

enum  Capitalization {
  MixedCase = QFont::MixedCase, AllUppercase = QFont::AllUppercase, AllLowercase = QFont::AllLowercase, SmallCaps = QFont::SmallCaps,
  Capitalize = QFont::Capitalize
}
 
enum  FontWeight {
  Light = QFont::Light, Normal = QFont::Normal, DemiBold = QFont::DemiBold, Bold = QFont::Bold,
  Black = QFont::Black
}
 

Public Functions

bool bold () const
 
Capitalization capitalization () const
 
QString family () const
 
bool italic () const
 
qreal letterSpacing () const
 
bool overline () const
 
int pixelSize () const
 
qreal pointSize () const
 
 QDeclarativeFontValueType (QObject *parent=0)
 
virtual void read (QObject *, int)
 
void setBold (bool b)
 
void setCapitalization (Capitalization)
 
void setFamily (const QString &)
 
void setItalic (bool b)
 
void setLetterSpacing (qreal spacing)
 
void setOverline (bool b)
 
void setPixelSize (int size)
 
void setPointSize (qreal size)
 
void setStrikeout (bool b)
 
void setUnderline (bool b)
 
virtual void setValue (QVariant value)
 
void setWeight (FontWeight)
 
void setWordSpacing (qreal spacing)
 
bool strikeout () const
 
bool underline () const
 
virtual QVariant value ()
 
FontWeight weight () const
 
qreal wordSpacing () const
 
virtual void write (QObject *, int, QDeclarativePropertyPrivate::WriteFlags)
 
- Public Functions inherited from QDeclarativeValueType
 QDeclarativeValueType (QObject *parent=0)
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Properties

bool bold
 
Capitalization capitalization
 
QDeclarativeNullableValue< int > dpi
 
QString family
 
QFont font
 
bool italic
 
qreal letterSpacing
 
bool overline
 
int pixelSize
 
bool pixelSizeSet
 
qreal pointSize
 
bool pointSizeSet
 
bool strikeout
 
bool underline
 
FontWeight weight
 
qreal wordSpacing
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 474 of file qdeclarativevaluetype_p.h.

Enumerations

◆ Capitalization

◆ FontWeight

Constructors and Destructors

◆ QDeclarativeFontValueType()

QDeclarativeFontValueType::QDeclarativeFontValueType ( QObject parent = 0)

Definition at line 839 of file qdeclarativevaluetype.cpp.

Functions

◆ bold()

bool QDeclarativeFontValueType::bold ( ) const

Referenced by setFamily().

◆ capitalization()

Capitalization QDeclarativeFontValueType::capitalization ( ) const

Referenced by setPixelSize().

◆ family()

QString QDeclarativeFontValueType::family ( ) const

Referenced by setValue().

◆ italic()

bool QDeclarativeFontValueType::italic ( ) const

Referenced by setWeight().

◆ letterSpacing()

qreal QDeclarativeFontValueType::letterSpacing ( ) const

Referenced by setCapitalization().

◆ overline()

bool QDeclarativeFontValueType::overline ( ) const

Referenced by setUnderline().

◆ pixelSize()

int QDeclarativeFontValueType::pixelSize ( ) const

Referenced by setPointSize().

◆ pointSize()

qreal QDeclarativeFontValueType::pointSize ( ) const

Referenced by setStrikeout().

◆ read()

void QDeclarativeFontValueType::read ( QObject obj,
int  idx 
)
virtual

Implements QDeclarativeValueType.

Definition at line 844 of file qdeclarativevaluetype.cpp.

845 {
846  void *a[] = { &font, 0 };
848  pixelSizeSet = false;
849  pointSizeSet = false;
850 }
static int metacall(QObject *, Call, int, void **)
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ setBold()

void QDeclarativeFontValueType::setBold ( bool  b)

Definition at line 885 of file qdeclarativevaluetype.cpp.

886 {
887  font.setBold(b);
888 }
void setBold(bool)
If enable is true sets the font&#39;s weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
Definition: qfont.h:352

◆ setCapitalization()

void QDeclarativeFontValueType::setCapitalization ( QDeclarativeFontValueType::Capitalization  c)

Definition at line 992 of file qdeclarativevaluetype.cpp.

993 {
995 }
void setCapitalization(Capitalization)
Sets the capitalization of the text in this font to caps.
Definition: qfont.cpp:1798
unsigned char c[8]
Definition: qnumeric_p.h:62
Capitalization
Rendering option for text this font applies to.
Definition: qfont.h:129

◆ setFamily()

void QDeclarativeFontValueType::setFamily ( const QString family)

Definition at line 875 of file qdeclarativevaluetype.cpp.

876 {
877  font.setFamily(family);
878 }
void setFamily(const QString &)
Sets the family name of the font.
Definition: qfont.cpp:924

◆ setItalic()

void QDeclarativeFontValueType::setItalic ( bool  b)

Definition at line 905 of file qdeclarativevaluetype.cpp.

906 {
907  font.setItalic(b);
908 }
void setItalic(bool b)
Sets the style() of the font to QFont::StyleItalic if enable is true; otherwise the style is set to Q...
Definition: qfont.h:360

◆ setLetterSpacing()

void QDeclarativeFontValueType::setLetterSpacing ( qreal  spacing)

Definition at line 1002 of file qdeclarativevaluetype.cpp.

1003 {
1005 }
void setLetterSpacing(SpacingType type, qreal spacing)
Sets the letter spacing for the font to spacing and the type of spacing to type.
Definition: qfont.cpp:1696

◆ setOverline()

void QDeclarativeFontValueType::setOverline ( bool  b)

Definition at line 925 of file qdeclarativevaluetype.cpp.

926 {
927  font.setOverline(b);
928 }
void setOverline(bool)
If enable is true, sets overline on; otherwise sets overline off.
Definition: qfont.cpp:1354

◆ setPixelSize()

void QDeclarativeFontValueType::setPixelSize ( int  size)

Definition at line 975 of file qdeclarativevaluetype.cpp.

976 {
977  if (size >0) {
978  if (pointSizeSet)
979  qWarning() << "Both point size and pixel size set. Using pixel size.";
980  font.setPixelSize(size);
981  pixelSizeSet = true;
982  } else {
983  pixelSizeSet = false;
984  }
985 }
Q_CORE_EXPORT void qWarning(const char *,...)
void setPixelSize(int)
Sets the font size to pixelSize pixels.
Definition: qfont.cpp:1156

◆ setPointSize()

void QDeclarativeFontValueType::setPointSize ( qreal  size)

Definition at line 950 of file qdeclarativevaluetype.cpp.

951 {
952  if (pixelSizeSet) {
953  qWarning() << "Both point size and pixel size set. Using pixel size.";
954  return;
955  }
956 
957  if (size >= 0.0) {
958  pointSizeSet = true;
959  font.setPointSizeF(size);
960  } else {
961  pointSizeSet = false;
962  }
963 }
Q_CORE_EXPORT void qWarning(const char *,...)
void setPointSizeF(qreal)
Sets the point size to pointSize.
Definition: qfont.cpp:1121

◆ setStrikeout()

void QDeclarativeFontValueType::setStrikeout ( bool  b)

Definition at line 935 of file qdeclarativevaluetype.cpp.

936 {
937  font.setStrikeOut(b);
938 }
void setStrikeOut(bool)
If enable is true, sets strikeout on; otherwise sets strikeout off.
Definition: qfont.cpp:1378

◆ setUnderline()

void QDeclarativeFontValueType::setUnderline ( bool  b)

Definition at line 915 of file qdeclarativevaluetype.cpp.

916 {
917  font.setUnderline(b);
918 }
void setUnderline(bool)
If enable is true, sets underline on; otherwise sets underline off.
Definition: qfont.cpp:1331

◆ setValue()

void QDeclarativeFontValueType::setValue ( QVariant  value)
virtual

Implements QDeclarativeValueType.

Definition at line 864 of file qdeclarativevaluetype.cpp.

865 {
867 }
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571

◆ setWeight()

void QDeclarativeFontValueType::setWeight ( QDeclarativeFontValueType::FontWeight  w)

Definition at line 895 of file qdeclarativevaluetype.cpp.

896 {
898 }
Weight
Qt uses a weighting scale from 0 to 99 similar to, but not the same as, the scales used in Windows or...
Definition: qfont.h:103
void setWeight(int)
Sets the weight the font to weight, which should be a value from the QFont::Weight enumeration...
Definition: qfont.cpp:1278

◆ setWordSpacing()

void QDeclarativeFontValueType::setWordSpacing ( qreal  spacing)

Definition at line 1012 of file qdeclarativevaluetype.cpp.

1013 {
1014  font.setWordSpacing(size);
1015 }
void setWordSpacing(qreal spacing)
Sets the word spacing for the font to spacing.
Definition: qfont.cpp:1757

◆ strikeout()

bool QDeclarativeFontValueType::strikeout ( ) const

Referenced by setOverline().

◆ underline()

bool QDeclarativeFontValueType::underline ( ) const

Referenced by setItalic().

◆ value()

QVariant QDeclarativeFontValueType::value ( )
virtual

Implements QDeclarativeValueType.

Definition at line 859 of file qdeclarativevaluetype.cpp.

Referenced by setValue().

860 {
861  return QVariant(font);
862 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92

◆ weight()

FontWeight QDeclarativeFontValueType::weight ( ) const

Referenced by setBold().

◆ wordSpacing()

qreal QDeclarativeFontValueType::wordSpacing ( ) const

Referenced by setLetterSpacing().

◆ write()

void QDeclarativeFontValueType::write ( QObject obj,
int  idx,
QDeclarativePropertyPrivate::WriteFlags  flags 
)
virtual

Implements QDeclarativeValueType.

Definition at line 852 of file qdeclarativevaluetype.cpp.

853 {
854  int status = -1;
855  void *a[] = { &font, 0, &status, &flags };
857 }
static int metacall(QObject *, Call, int, void **)
static LibLoadStatus status
Definition: qlocale_icu.cpp:69
long ASN1_INTEGER_get ASN1_INTEGER * a

Properties

◆ bold

bool QDeclarativeFontValueType::bold
private

Definition at line 481 of file qdeclarativevaluetype_p.h.

◆ capitalization

QDeclarativeFontValueType::Capitalization QDeclarativeFontValueType::capitalization
private

Definition at line 489 of file qdeclarativevaluetype_p.h.

◆ dpi

QDeclarativeNullableValue<int> QDeclarativeFontValueType::dpi
mutableprivate

Definition at line 552 of file qdeclarativevaluetype_p.h.

Referenced by setPointSize(), and setStrikeout().

◆ family

QString QDeclarativeFontValueType::family
private

Definition at line 480 of file qdeclarativevaluetype_p.h.

◆ font

QFont QDeclarativeFontValueType::font
private

◆ italic

bool QDeclarativeFontValueType::italic
private

Definition at line 483 of file qdeclarativevaluetype_p.h.

◆ letterSpacing

qreal QDeclarativeFontValueType::letterSpacing
private

Definition at line 490 of file qdeclarativevaluetype_p.h.

◆ overline

bool QDeclarativeFontValueType::overline
private

Definition at line 485 of file qdeclarativevaluetype_p.h.

◆ pixelSize

int QDeclarativeFontValueType::pixelSize
private

Definition at line 488 of file qdeclarativevaluetype_p.h.

◆ pixelSizeSet

bool QDeclarativeFontValueType::pixelSizeSet
private

Definition at line 550 of file qdeclarativevaluetype_p.h.

Referenced by read(), setPixelSize(), and setPointSize().

◆ pointSize

qreal QDeclarativeFontValueType::pointSize
private

Definition at line 487 of file qdeclarativevaluetype_p.h.

◆ pointSizeSet

bool QDeclarativeFontValueType::pointSizeSet
private

Definition at line 551 of file qdeclarativevaluetype_p.h.

Referenced by read(), setPixelSize(), and setPointSize().

◆ strikeout

bool QDeclarativeFontValueType::strikeout
private

Definition at line 486 of file qdeclarativevaluetype_p.h.

◆ underline

bool QDeclarativeFontValueType::underline
private

Definition at line 484 of file qdeclarativevaluetype_p.h.

◆ weight

QDeclarativeFontValueType::FontWeight QDeclarativeFontValueType::weight
private

Definition at line 482 of file qdeclarativevaluetype_p.h.

◆ wordSpacing

qreal QDeclarativeFontValueType::wordSpacing
private

Definition at line 491 of file qdeclarativevaluetype_p.h.


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