Qt 4.8
Public Functions | Public Variables | List of all members
QWizardField Class Reference

Public Functions

void findProperty (const QWizardDefaultProperty *properties, int propertyCount)
 
 QWizardField ()
 
 QWizardField (QWizardPage *page, const QString &spec, QObject *object, const char *property, const char *changedSignal)
 
void resolve (const QVector< QWizardDefaultProperty > &defaultPropertyTable)
 

Public Variables

QByteArray changedSignal
 
QVariant initialValue
 
bool mandatory
 
QString name
 
QObjectobject
 
QWizardPagepage
 
QByteArray property
 

Detailed Description

Definition at line 164 of file qwizard.cpp.

Constructors and Destructors

◆ QWizardField() [1/2]

QWizardField::QWizardField ( )
inline

Definition at line 167 of file qwizard.cpp.

167 {}

◆ QWizardField() [2/2]

QWizardField::QWizardField ( QWizardPage page,
const QString spec,
QObject object,
const char *  property,
const char *  changedSignal 
)

Definition at line 183 of file qwizard.cpp.

185  : page(page), name(spec), mandatory(false), object(object), property(property),
187 {
188  if (name.endsWith(QLatin1Char('*'))) {
189  name.chop(1);
190  mandatory = true;
191  }
192 }
QByteArray changedSignal
Definition: qwizard.cpp:179
QWizardPage * page
Definition: qwizard.cpp:174
void chop(int n)
Removes n characters from the end of the string.
Definition: qstring.cpp:4623
QByteArray property
Definition: qwizard.cpp:178
QString name
Definition: qwizard.cpp:175
bool mandatory
Definition: qwizard.cpp:176
QObject * object
Definition: qwizard.cpp:177
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
Definition: qstring.cpp:3796
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

Functions

◆ findProperty()

void QWizardField::findProperty ( const QWizardDefaultProperty properties,
int  propertyCount 
)

Definition at line 201 of file qwizard.cpp.

Referenced by resolve().

202 {
204 
205  for (int i = 0; i < propertyCount; ++i) {
206  if (objectInheritsXAndXIsCloserThanY(object, properties[i].className, className)) {
207  className = properties[i].className;
208  property = properties[i].property;
209  changedSignal = properties[i].changedSignal;
210  }
211  }
212 }
QByteArray changedSignal
Definition: qwizard.cpp:179
QByteArray changedSignal
Definition: qwizard.cpp:156
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
const char * className
Definition: qwizard.cpp:137
QByteArray className
Definition: qwizard.cpp:154
static bool objectInheritsXAndXIsCloserThanY(const QObject *object, const QByteArray &classX, const QByteArray &classY)
Definition: qwizard.cpp:120

◆ resolve()

void QWizardField::resolve ( const QVector< QWizardDefaultProperty > &  defaultPropertyTable)

Definition at line 194 of file qwizard.cpp.

Referenced by QWizardPrivate::addField().

195 {
196  if (property.isEmpty())
197  findProperty(defaultPropertyTable.constData(), defaultPropertyTable.count());
198  initialValue = object->property(property);
199 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QByteArray property
Definition: qwizard.cpp:178
QVariant initialValue
Definition: qwizard.cpp:180
void findProperty(const QWizardDefaultProperty *properties, int propertyCount)
Definition: qwizard.cpp:201
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
const T * constData() const
Returns a const pointer to the data stored in the vector.
Definition: qvector.h:154

Properties

◆ changedSignal

QByteArray QWizardField::changedSignal

◆ initialValue

QVariant QWizardField::initialValue

Definition at line 180 of file qwizard.cpp.

Referenced by QWizardPage::cleanupPage(), QWizardPage::isComplete(), and resolve().

◆ mandatory

bool QWizardField::mandatory

◆ name

QString QWizardField::name

◆ object

QObject* QWizardField::object

◆ page

QWizardPage* QWizardField::page

◆ property

QByteArray QWizardField::property

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