src/addObjectDialog.cpp

changeset 985
ed7b31b9f904
parent 984
a7b6f987d269
child 988
ac4a2ae54f76
equal deleted inserted replaced
984:a7b6f987d269 985:ed7b31b9f904
93 case OBJ_Subfile: 93 case OBJ_Subfile:
94 { 94 {
95 coordCount = 3; 95 coordCount = 3;
96 tw_subfileList = new QTreeWidget(); 96 tw_subfileList = new QTreeWidget();
97 tw_subfileList->setHeaderLabel (tr ("Primitives")); 97 tw_subfileList->setHeaderLabel (tr ("Primitives"));
98 PopulatePrimitives (tw_subfileList, (obj != nullptr ? static_cast<LDSubfile*> (obj)->fileInfo()->name() : "")); 98 PopulatePrimitives (tw_subfileList, (obj ? static_cast<LDSubfile*> (obj)->fileInfo()->name() : ""));
99 99
100 connect (tw_subfileList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_subfileTypeChanged())); 100 connect (tw_subfileList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_subfileTypeChanged()));
101 lb_subfileName = new QLabel ("File:"); 101 lb_subfileName = new QLabel ("File:");
102 le_subfileName = new QLineEdit; 102 le_subfileName = new QLineEdit;
103 le_subfileName->setFocus(); 103 le_subfileName->setFocus();
122 lb_typeIcon->setPixmap (icon); 122 lb_typeIcon->setPixmap (icon);
123 123
124 // Show a color edit dialog for the types that actually use the color 124 // Show a color edit dialog for the types that actually use the color
125 if (defaults->isColored()) 125 if (defaults->isColored())
126 { 126 {
127 if (obj != nullptr) 127 if (obj)
128 m_color = obj->color(); 128 m_color = obj->color();
129 else 129 else
130 m_color = (type == OBJ_CondLine or type == OBJ_Line) ? EdgeColor : MainColor; 130 m_color = (type == OBJ_CondLine or type == OBJ_Line) ? EdgeColor : MainColor;
131 131
132 pb_color = new QPushButton; 132 pb_color = new QPushButton;
150 case OBJ_Line: 150 case OBJ_Line:
151 case OBJ_CondLine: 151 case OBJ_CondLine:
152 case OBJ_Triangle: 152 case OBJ_Triangle:
153 case OBJ_Quad: 153 case OBJ_Quad:
154 // Apply coordinates 154 // Apply coordinates
155 if (obj != nullptr) 155 if (obj)
156 { 156 {
157 for (int i = 0; i < coordCount / 3; ++i) 157 for (int i = 0; i < coordCount / 3; ++i)
158 { 158 {
159 obj->vertex (i).apply ([&](Axis ax, double value) 159 obj->vertex (i).apply ([&](Axis ax, double value)
160 { 160 {
188 QLabel* lb_matrix = new QLabel ("Matrix:"); 188 QLabel* lb_matrix = new QLabel ("Matrix:");
189 le_matrix = new QLineEdit; 189 le_matrix = new QLineEdit;
190 // le_matrix->setValidator (new QDoubleValidator); 190 // le_matrix->setValidator (new QDoubleValidator);
191 Matrix defaultMatrix = IdentityMatrix; 191 Matrix defaultMatrix = IdentityMatrix;
192 192
193 if (mo != nullptr) 193 if (mo)
194 { 194 {
195 mo->position().apply ([&](Axis ax, double value) 195 mo->position().apply ([&](Axis ax, double value)
196 { 196 {
197 dsb_coords[ax]->setValue (value); 197 dsb_coords[ax]->setValue (value);
198 }); 198 });

mercurial