1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/***************************************************************************
* Copyright (C) 2004 by SourceXtreme, Inc *
* oss@sourcextreme.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Library General Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <tqapplication.h>
#include "propertyeditor.h"
#include "propertylist.h"
#include "multiproperty.h"
using namespace PropertyLib;
int main( int argc, char **argv )
{
TQApplication app( argc, argv );
PropertyEditor *editor = new PropertyEditor( 0 );
PropertyList *currentList = new PropertyList();
currentList->addProperty(
new Property(Property::String, "Sample string",
"Sample description", "value" ) );
currentList->addProperty(
new Property(Property::Color, "Color",
"Sample color description", Qt::red ) );
currentList->addProperty(
new Property( Property::Pixmap, "Pixmap",
"sample pixmap description" ) );
currentList->addProperty(
new Property( Property::Rect, "Rectangle",
"sample rectangle", TQRect( 10, 11, 30, 40 ) ) );
currentList->addProperty(
new Property( Property::Point, "Point",
"sample point", TQPoint( 20, 30 ) ) );
currentList->addProperty(
new Property( Property::Boolean, "Boolean",
"sample bool", false ) );
currentList->addProperty(
new Property( Property::Integer, "Integer",
"sample integer", 7 ) );
currentList->addProperty(
new Property( Property::Double, "Double",
"sample double", 7.0 ) );
TQStringList things;
things += "Thing 1";
things += "Thing 2";
currentList->addProperty(
new Property( Property::StringList, "StringList",
"sample stringlist", things ) );
currentList->addProperty(
new Property( Property::DirectoryURL, "Directory",
"sample dir", "C:/" ) );
currentList->addProperty(
new Property( Property::FileURL, "File",
"sample file", "C:/" ) );
editor->populateProperties( currentList );
app.setMainWidget( editor );
editor->show();
return app.exec();
}
|