Sun, 29 Jan 2017 15:05:14 +0200
Major overhaul of object→document relationship: added the Model class which models the object buffer. Each object is to be included in a model (an invariant that currently does not hold). A document is a subclass of a model. The LDObject is also now agnostic about selection, and the selection is now a set. A lot of things are probably broken now but it's a major step forward.
The LDObject::destroy method is also now gone. The model decides when objects are destroyed and calls the destructor directly. The end result removes a lot of cruft and adds structure to LDObject relations.
Notes:
- Inlining does not currently work (nothing simply gets inlined in)
- More work is required to ensure that each object actually goes into a model
491
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | <?xml version="1.0" encoding="UTF-8"?> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | <ui version="4.0"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
3 | <class>EditRawUI</class> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | <widget class="QDialog" name="EditRawUI"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | <property name="geometry"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | <rect> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | <x>0</x> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | <y>0</y> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | <width>400</width> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | <height>87</height> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | </rect> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | <property name="windowTitle"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | <string>Edit LDraw Code</string> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | <layout class="QVBoxLayout" name="verticalLayout"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | <item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | <widget class="QLabel" name="label"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | <property name="text"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | <string>LDraw code:</string> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | </widget> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | </item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | <item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
25 | <widget class="QLineEdit" name="code"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
26 | <property name="whatsThis"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | <string><html><head/><body><p>The LDraw code of this object. The code written here is expected to be valid LDraw code, invalid code here results the object being turned into an error object. Please do refer to the <a href="http://www.ldraw.org/article/218.html"><span style=" text-decoration: underline; color:#0057ae;">official file format standard</span></a> for further information.</p></body></html></string> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
28 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | </widget> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
30 | </item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
31 | <item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
32 | <layout class="QHBoxLayout" name="horizontalLayout"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | <item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | <widget class="QLabel" name="errorIcon"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | <property name="maximumSize"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | <size> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | <width>16</width> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | <height>16</height> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
39 | </size> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | <property name="text"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | <string/> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
43 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
44 | <property name="pixmap"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | <pixmap resource="../../ldforge.qrc">:/icons/error.png</pixmap> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
47 | <property name="scaledContents"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
48 | <bool>true</bool> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
49 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
50 | </widget> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | </item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
52 | <item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
53 | <widget class="QLabel" name="errorDescription"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
54 | <property name="enabled"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
55 | <bool>true</bool> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
56 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | <property name="styleSheet"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
58 | <string notr="true">color: #900</string> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
59 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
60 | <property name="text"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
61 | <string>Error description</string> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
62 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
63 | </widget> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
64 | </item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
65 | <item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
66 | <widget class="QDialogButtonBox" name="buttonBox"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
67 | <property name="orientation"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
68 | <enum>Qt::Horizontal</enum> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
69 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
70 | <property name="standardButtons"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
71 | <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
72 | </property> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
73 | </widget> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
74 | </item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
75 | </layout> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
76 | </item> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
77 | </layout> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
78 | </widget> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
79 | <resources> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
80 | <include location="../../ldforge.qrc"/> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
81 | </resources> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
82 | <connections> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
83 | <connection> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
84 | <sender>buttonBox</sender> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
85 | <signal>accepted()</signal> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
86 | <receiver>EditRawUI</receiver> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
87 | <slot>accept()</slot> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
88 | <hints> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
89 | <hint type="sourcelabel"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
90 | <x>248</x> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
91 | <y>254</y> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
92 | </hint> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
93 | <hint type="destinationlabel"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
94 | <x>157</x> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
95 | <y>274</y> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
96 | </hint> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
97 | </hints> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
98 | </connection> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
99 | <connection> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
100 | <sender>buttonBox</sender> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
101 | <signal>rejected()</signal> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
102 | <receiver>EditRawUI</receiver> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
103 | <slot>reject()</slot> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
104 | <hints> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
105 | <hint type="sourcelabel"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
106 | <x>316</x> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
107 | <y>260</y> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
108 | </hint> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
109 | <hint type="destinationlabel"> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
110 | <x>286</x> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
111 | <y>274</y> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
112 | </hint> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
113 | </hints> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
114 | </connection> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
115 | </connections> |
7d1b5ecd76c0
it's LDForge's 1st birthday!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
116 | </ui> |