return NULL;
}
+QPainterPath AbstractGroupItem::clipGroupSpacerShape(QPointF offset) const
+{
+ return spacerGroupShape(AVWIDGET, offset);
+}
+
QPainterPath AbstractGroupItem::clipGroupShape(QPointF offset) const
{
return groupShape(AVWIDGET, offset);
return path;
}
+QPainterPath AbstractGroupItem::spacerGroupShape(GRAPHICSRECTITEM type, QPointF offset) const
+{
+ QPainterPath path;
+ QList<QGraphicsItem *> children = childItems();
+ for (int i = 0; i < children.count(); i++) {
+ if (children.at(i)->type() == (int)type) {
+ QRectF r(children.at(i)->sceneBoundingRect());
+ r.translate(offset);
+ r.setRight(scene()->width());
+ path.addRect(r);
+ } else if (children.at(i)->type() == GROUPWIDGET) {
+ QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
+ for (int j = 0; j < subchildren.count(); j++) {
+ if (subchildren.at(j)->type() == (int)type) {
+ QRectF r(subchildren.at(j)->sceneBoundingRect());
+ r.translate(offset);
+ r.setRight(scene()->width());
+ path.addRect(r);
+ }
+ }
+ }
+ }
+ return path;
+}
+
void AbstractGroupItem::addItem(QGraphicsItem * item)
{
addToGroup(item);
void removeItem(QGraphicsItem * item);
int track() const;
QPainterPath clipGroupShape(QPointF offset) const;
+ QPainterPath clipGroupSpacerShape(QPointF offset) const;
QPainterPath transitionGroupShape(QPointF offset) const;
void setItemLocked(bool locked);
bool isItemLocked() const;
private:
void fixItemRect();
QPainterPath groupShape(GRAPHICSRECTITEM type, QPointF offset) const;
+ QPainterPath spacerGroupShape(GRAPHICSRECTITEM type, QPointF offset) const;
/** Stores the original info of the items beeing resized. */
QList <ItemInfo> m_resizeInfos;
};
// Make sure there is no collision
QList<QGraphicsItem *> children = m_selectionGroup->childItems();
- QPainterPath shape = m_selectionGroup->clipGroupShape(QPointF(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0));
+ QPainterPath shape = m_selectionGroup->clipGroupSpacerShape(QPointF(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0));
QList<QGraphicsItem*> collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(m_selectionGroup);
for (int i = 0; i < children.count(); i++) {
}
snappedPos += offset;
// make sure we have no collision
- shape = m_selectionGroup->clipGroupShape(QPointF(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0));
+ shape = m_selectionGroup->clipGroupSpacerShape(QPointF(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0));
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(m_selectionGroup);
for (int i = 0; i < children.count(); i++) {
if (newpath.isEmpty()) return;
int ix = 0;
bool fixed = false;
- m_ui.recursiveSearch->setEnabled(false);
+ m_ui.recursiveSearch->setChecked(true);
+ qApp->processEvents();
QTreeWidgetItem *child = m_ui.treeWidget->topLevelItem(ix);
QDir searchDir(newpath);
while (child) {
ix++;
child = m_ui.treeWidget->topLevelItem(ix);
}
+ m_ui.recursiveSearch->setChecked(false);
m_ui.recursiveSearch->setEnabled(true);
if (fixed) {
// original doc was modified