41 #include <QApplication>
48 int main(
int argc,
char** argv)
50 QApplication app(argc, argv);
56 QString::number(i++) + QLatin1String(
" Group Property"));
95 item->
setAttribute(QLatin1String(
"echoMode"), QLineEdit::Password);
105 item = variantManager->
addProperty(QVariant::Date, QString::number(i++) + QLatin1String(
" Date Property"));
106 item->
setValue(QDate::currentDate().addDays(2));
110 item->
setValue(QTime::currentTime());
113 item = variantManager->
addProperty(QVariant::DateTime, QString::number(i++) + QLatin1String(
" DateTime Property"));
117 item = variantManager->
addProperty(QVariant::KeySequence, QString::number(i++) + QLatin1String(
" KeySequence Property"));
118 item->
setValue(QKeySequence(Qt::ControlModifier | Qt::Key_Q));
121 item = variantManager->
addProperty(QVariant::Char, QString::number(i++) + QLatin1String(
" Char Property"));
125 item = variantManager->
addProperty(QVariant::Locale, QString::number(i++) + QLatin1String(
" Locale Property"));
126 item->
setValue(QLocale(QLocale::Polish, QLocale::Poland));
133 item = variantManager->
addProperty(QVariant::PointF, QString::number(i++) + QLatin1String(
" PointF Property"));
134 item->
setValue(QPointF(1.2345, -1.23451));
138 item = variantManager->
addProperty(QVariant::Size, QString::number(i++) + QLatin1String(
" Size Property"));
140 item->
setAttribute(QLatin1String(
"minimum"), QSize(10, 10));
141 item->
setAttribute(QLatin1String(
"maximum"), QSize(30, 30));
144 item = variantManager->
addProperty(QVariant::SizeF, QString::number(i++) + QLatin1String(
" SizeF Property"));
145 item->
setValue(QSizeF(1.2345, 1.2345));
147 item->
setAttribute(QLatin1String(
"minimum"), QSizeF(0.12, 0.34));
148 item->
setAttribute(QLatin1String(
"maximum"), QSizeF(20.56, 20.78));
151 item = variantManager->
addProperty(QVariant::Rect, QString::number(i++) + QLatin1String(
" Rect Property"));
152 item->
setValue(QRect(10, 10, 20, 20));
154 item->
setAttribute(QLatin1String(
"constraint"), QRect(0, 0, 50, 50));
156 item = variantManager->
addProperty(QVariant::RectF, QString::number(i++) + QLatin1String(
" RectF Property"));
157 item->
setValue(QRectF(1.2345, 1.2345, 1.2345, 1.2345));
159 item->
setAttribute(QLatin1String(
"constraint"), QRectF(0, 0, 50, 50));
163 QString::number(i++) + QLatin1String(
" Enum Property"));
164 QStringList enumNames;
165 enumNames <<
"Enum0" <<
"Enum1" <<
"Enum2";
166 item->
setAttribute(QLatin1String(
"enumNames"), enumNames);
171 QString::number(i++) + QLatin1String(
" Flag Property"));
172 QStringList flagNames;
173 flagNames <<
"Flag0" <<
"Flag1" <<
"Flag2";
174 item->
setAttribute(QLatin1String(
"flagNames"), flagNames);
178 item = variantManager->
addProperty(QVariant::SizePolicy, QString::number(i++) + QLatin1String(
" SizePolicy Property"));
181 item = variantManager->
addProperty(QVariant::Font, QString::number(i++) + QLatin1String(
" Font Property"));
184 item = variantManager->
addProperty(QVariant::Cursor, QString::number(i++) + QLatin1String(
" Cursor Property"));
198 variantEditor->show();
200 int ret = app.exec();
202 delete variantManager;
203 delete variantFactory;
204 delete variantEditor;