mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-03 15:55:27 +08:00
6.5.3 clean
This commit is contained in:
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user