r19277 by craig - #11568: Allow item deletion from the outline palette. PageItems only right now
scribus-commit
scribus-commit at lists.scribus.net
Tue Jun 24 20:18:39 UTC 2014
Author: craig
Date: Tue Jun 24 20:18:39 2014
New Revision: 19277
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19277
Log:
#11568: Allow item deletion from the outline palette. PageItems only right now
Modified:
trunk/Scribus/scribus/ui/outlinepalette.cpp
trunk/Scribus/scribus/ui/outlinepalette.h
Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19277&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Tue Jun 24 20:18:39 2014
@@ -229,6 +229,49 @@
QList<QTreeWidgetItem*> selList;
selList.append(it);
selectItems(selList);
+ }
+ }
+ }
+}
+
+void OutlineWidget::keyPressEvent(QKeyEvent *e)
+{
+ if (e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete)
+ {
+ foreach (QTreeWidgetItem * twItem, selectedItems())
+ {
+ if (twItem != 0)
+ {
+ OutlineTreeItem *item = (OutlineTreeItem*)twItem;
+ if (item)
+ {
+ switch (item->type)
+ {
+ case 1: //PageItem on master page
+ {
+ PageItem* pageItem = item->PageItemObject;
+ Selection s(this, false);
+ s.addItem(pageItem);
+ ScribusDoc* d=item->DocObject;
+ d->itemSelection_DeleteItem(&s);
+ }
+ break;
+ case 3: //PageItem on normal page
+ {
+ PageItem* pageItem = item->PageItemObject;
+ Selection s(this, false);
+ s.addItem(pageItem);
+ ScribusDoc* d=item->DocObject;
+ d->itemSelection_DeleteItem(&s);
+ }
+ break;
+ default:
+ {
+ //qDebug()<<item->type;
+ }
+ break;
+ }
+ }
}
}
}
Modified: trunk/Scribus/scribus/ui/outlinepalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19277&path=/trunk/Scribus/scribus/ui/outlinepalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.h (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.h Tue Jun 24 20:18:39 2014
@@ -34,7 +34,7 @@
ScPage *PageObject;
ScribusDoc *DocObject;
int LayerID;
- int type;
+ int type; //1=PageItem on Master Page,2=,3=PageItem,4=,5=,...
};
class SCRIBUS_API OutlineWidget : public QTreeWidget
@@ -47,6 +47,7 @@
protected:
void dropEvent(QDropEvent *e);
+ void keyPressEvent(QKeyEvent *e);
bool viewportEvent(QEvent *event);
};
More information about the scribus-commit
mailing list