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

The QDeclarativeDomValueLiteral class represents a literal value. More...

#include <qdeclarativedom_p.h>

Public Functions

QString literal () const
 Return the literal value. More...
 
QDeclarativeDomValueLiteraloperator= (const QDeclarativeDomValueLiteral &)
 Assign other to this QDeclarativeDomValueLiteral. More...
 
 QDeclarativeDomValueLiteral ()
 Construct an empty QDeclarativeDomValueLiteral. More...
 
 QDeclarativeDomValueLiteral (const QDeclarativeDomValueLiteral &)
 Create a copy of other QDeclarativeDomValueLiteral. More...
 
 ~QDeclarativeDomValueLiteral ()
 Destroy the QDeclarativeDomValueLiteral. More...
 

Properties

QSharedDataPointer< QDeclarativeDomBasicValuePrivated
 

Friends

class QDeclarativeDomValue
 

Detailed Description

The QDeclarativeDomValueLiteral class represents a literal value.

Warning
This function is not part of the public interface.
A literal value is a simple value, written inline with the QML.  In the
example below, the "x", "y" and "color" properties are being assigned
literal values.
x: 10
y: 10
color: "red"
}

Definition at line 201 of file qdeclarativedom_p.h.

Constructors and Destructors

◆ QDeclarativeDomValueLiteral() [1/2]

QDeclarativeDomValueLiteral::QDeclarativeDomValueLiteral ( )

Construct an empty QDeclarativeDomValueLiteral.

Definition at line 994 of file qdeclarativedom.cpp.

994  :
996 {
997 }
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d

◆ QDeclarativeDomValueLiteral() [2/2]

QDeclarativeDomValueLiteral::QDeclarativeDomValueLiteral ( const QDeclarativeDomValueLiteral other)

Create a copy of other QDeclarativeDomValueLiteral.

Definition at line 1002 of file qdeclarativedom.cpp.

1003 : d(other.d)
1004 {
1005 }
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d

◆ ~QDeclarativeDomValueLiteral()

QDeclarativeDomValueLiteral::~QDeclarativeDomValueLiteral ( )

Destroy the QDeclarativeDomValueLiteral.

Definition at line 1010 of file qdeclarativedom.cpp.

1011 {
1012 }

Functions

◆ literal()

QString QDeclarativeDomValueLiteral::literal ( ) const

Return the literal value.

In the example below, the literal value will be the string "10".

Rectangle { x: 10 }

Definition at line 1031 of file qdeclarativedom.cpp.

1032 {
1033  if (d->value) return d->value->primitive();
1034  else return QString();
1035 }
QDeclarativeParser::Value * value
The QString class provides a Unicode character string.
Definition: qstring.h:83
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d

◆ operator=()

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

Assign other to this QDeclarativeDomValueLiteral.

Definition at line 1017 of file qdeclarativedom.cpp.

1018 {
1019  d = other.d;
1020  return *this;
1021 }
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d

Friends and Related Functions

◆ QDeclarativeDomValue

friend class QDeclarativeDomValue
friend

Definition at line 212 of file qdeclarativedom_p.h.

Properties

◆ d

QSharedDataPointer<QDeclarativeDomBasicValuePrivate> QDeclarativeDomValueLiteral::d
private

Definition at line 213 of file qdeclarativedom_p.h.

Referenced by literal(), operator=(), and QDeclarativeDomValue::toLiteral().


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