| 165 } |
165 } |
| 166 } |
166 } |
| 167 |
167 |
| 168 // ============================================================================= |
168 // ============================================================================= |
| 169 // ----------------------------------------------------------------------------- |
169 // ----------------------------------------------------------------------------- |
| 170 List<LDQuickColor> quickColorsFromConfig() |
170 QList<LDQuickColor> quickColorsFromConfig() |
| 171 { List<LDQuickColor> colors; |
171 { QList<LDQuickColor> colors; |
| 172 |
172 |
| 173 for (str colorname : gui_colortoolbar.value.split (":")) |
173 for (str colorname : gui_colortoolbar.value.split (":")) |
| 174 { if (colorname == "|") |
174 { if (colorname == "|") |
| 175 colors << LDQuickColor::getSeparator(); |
175 colors << LDQuickColor::getSeparator(); |
| 176 else |
176 else |
| 249 // ----------------------------------------------------------------------------- |
249 // ----------------------------------------------------------------------------- |
| 250 int ForgeWindow::deleteSelection() |
250 int ForgeWindow::deleteSelection() |
| 251 { if (m_sel.size() == 0) |
251 { if (m_sel.size() == 0) |
| 252 return 0; |
252 return 0; |
| 253 |
253 |
| 254 List<LDObject*> selCopy = m_sel; |
254 QList<LDObject*> selCopy = m_sel; |
| 255 int num = 0; |
255 int num = 0; |
| 256 |
256 |
| 257 // Delete the objects that were being selected |
257 // Delete the objects that were being selected |
| 258 for (LDObject * obj : selCopy) |
258 for (LDObject * obj : selCopy) |
| 259 { LDFile::current()->forgetObject (obj); |
259 { LDFile::current()->forgetObject (obj); |
| 400 // called during GL picking, in which case the GL renderer takes care |
400 // called during GL picking, in which case the GL renderer takes care |
| 401 // of the selection. |
401 // of the selection. |
| 402 if (m_renderer->picking()) |
402 if (m_renderer->picking()) |
| 403 return; |
403 return; |
| 404 |
404 |
| 405 List<LDObject*> priorSelection = m_sel; |
405 QList<LDObject*> priorSelection = m_sel; |
| 406 |
406 |
| 407 // Get the objects from the object list selection |
407 // Get the objects from the object list selection |
| 408 m_sel.clear(); |
408 m_sel.clear(); |
| 409 const QList<QListWidgetItem*> items = ui->objectList->selectedItems(); |
409 const QList<QListWidgetItem*> items = ui->objectList->selectedItems(); |
| 410 |
410 |
| 615 contextMenu->exec (pos); |
615 contextMenu->exec (pos); |
| 616 } |
616 } |
| 617 |
617 |
| 618 // ============================================================================= |
618 // ============================================================================= |
| 619 // ----------------------------------------------------------------------------- |
619 // ----------------------------------------------------------------------------- |
| 620 void ForgeWindow::deleteObjVector (List<LDObject*> objs) |
620 void ForgeWindow::deleteObjVector (QList<LDObject*> objs) |
| 621 { for (LDObject * obj : objs) |
621 { for (LDObject * obj : objs) |
| 622 { LDFile::current()->forgetObject (obj); |
622 { LDFile::current()->forgetObject (obj); |
| 623 delete obj; |
623 delete obj; |
| 624 } |
624 } |
| 625 } |
625 } |
| 626 |
626 |
| 627 // ============================================================================= |
627 // ============================================================================= |
| 628 // ----------------------------------------------------------------------------- |
628 // ----------------------------------------------------------------------------- |
| 629 void ForgeWindow::deleteByColor (const short colnum) |
629 void ForgeWindow::deleteByColor (const short colnum) |
| 630 { List<LDObject*> objs; |
630 { QList<LDObject*> objs; |
| 631 |
631 |
| 632 for (LDObject * obj : LDFile::current()->objects()) |
632 for (LDObject * obj : LDFile::current()->objects()) |
| 633 { if (!obj->isColored() || obj->color() != colnum) |
633 { if (!obj->isColored() || obj->color() != colnum) |
| 634 continue; |
634 continue; |
| 635 |
635 |