6.5.3 clean

This commit is contained in:
kleuter
2023-11-01 18:02:52 +01:00
parent bbe896803b
commit 7018d9e6c8
2170 changed files with 57471 additions and 43550 deletions

View File

@ -9,10 +9,10 @@
QList<CustomGroup*> CustomScene::selectedCustomGroups() const
{
QList<QGraphicsItem*> all = selectedItems();
const QList<QGraphicsItem*> all = selectedItems();
QList<CustomGroup*> groups;
foreach (QGraphicsItem *item, all) {
for (QGraphicsItem *item : all) {
CustomGroup* group = qgraphicsitem_cast<CustomGroup*>(item);
if (group)
groups.append(group);
@ -23,10 +23,10 @@ QList<CustomGroup*> CustomScene::selectedCustomGroups() const
QList<CustomItem*> CustomScene::selectedCustomItems() const
{
QList<QGraphicsItem*> all = selectedItems();
const QList<QGraphicsItem*> all = selectedItems();
QList<CustomItem*> items;
foreach (QGraphicsItem *item, all) {
for (QGraphicsItem *item : all) {
CustomItem* citem = qgraphicsitem_cast<CustomItem*>(item);
if (citem)
items.append(citem);

View File

@ -95,15 +95,15 @@ void Widget::on_scaleItem_valueChanged(int value)
void Widget::on_group_clicked()
{
QList<QGraphicsItem*> all = scene->selectedItems();
const QList<QGraphicsItem*> all = scene->selectedItems();
if (all.size() < 2)
return;
QList<CustomItem*> items = scene->selectedCustomItems();
const QList<CustomItem*> items = scene->selectedCustomItems();
QList<CustomGroup*> groups = scene->selectedCustomGroups();
if (groups.size() == 1) {
foreach (CustomItem *item, items) {
for (CustomItem *item : items) {
item->setSelected(false);
groups[0]->addToGroup(item);
}
@ -113,7 +113,7 @@ void Widget::on_group_clicked()
CustomGroup* group = new CustomGroup;
scene->addItem(group);
foreach (QGraphicsItem *item, all) {
for (QGraphicsItem *item : all) {
item->setSelected(false);
group->addToGroup(item);
}
@ -124,9 +124,9 @@ void Widget::on_group_clicked()
void Widget::on_dismantle_clicked()
{
QList<CustomGroup*> groups = scene->selectedCustomGroups();
const QList<CustomGroup*> groups = scene->selectedCustomGroups();
foreach (CustomGroup *group, groups) {
for (CustomGroup *group : groups) {
foreach (QGraphicsItem *item, group->childItems())
group->removeFromGroup(item);