[Kst] branches/work/kst/portto4/kst/src/libkstapp
Adam Treat
treat at kde.org
Fri Jun 8 00:03:12 CEST 2007
SVN commit 672704 by treat:
* Makes more sense
M +15 -15 viewitem.cpp
M +17 -17 viewitem.h
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.cpp #672703:672704
@@ -48,20 +48,20 @@
}
-void ViewItem::removeItem() {
+void ViewItem::remove() {
RemoveCommand *remove = new RemoveCommand(this);
remove->redo();
}
-void ViewItem::zOrderUp() {
- ZOrderUpCommand *up = new ZOrderUpCommand(this);
+void ViewItem::raise() {
+ RaiseCommand *up = new RaiseCommand(this);
up->redo();
}
-void ViewItem::zOrderDown() {
- ZOrderDownCommand *down = new ZOrderDownCommand(this);
+void ViewItem::lower() {
+ LowerCommand *down = new LowerCommand(this);
down->redo();
}
@@ -100,14 +100,14 @@
void ViewItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) {
QMenu menu;
- QAction *removeAction = menu.addAction(tr("Remove Object"));
- connect(removeAction, SIGNAL(triggered()), this, SLOT(removeItem()));
+ QAction *removeAction = menu.addAction(tr("Remove"));
+ connect(removeAction, SIGNAL(triggered()), this, SLOT(remove()));
- QAction *zUpAction = menu.addAction(tr("Z Order Up"));
- connect(zUpAction, SIGNAL(triggered()), this, SLOT(zOrderUp()));
+ QAction *raiseAction = menu.addAction(tr("Raise"));
+ connect(raiseAction, SIGNAL(triggered()), this, SLOT(raise()));
- QAction *zDownAction = menu.addAction(tr("Z Order Down"));
- connect(zDownAction, SIGNAL(triggered()), this, SLOT(zOrderDown()));
+ QAction *lowerAction = menu.addAction(tr("Lower"));
+ connect(lowerAction, SIGNAL(triggered()), this, SLOT(lower()));
menu.exec(event->screenPos());
}
@@ -361,22 +361,22 @@
}
-void ZOrderUpCommand::undo() {
+void RaiseCommand::undo() {
_item->setZValue(_item->zValue() - 1);
}
-void ZOrderUpCommand::redo() {
+void RaiseCommand::redo() {
_item->setZValue(_item->zValue() + 1);
}
-void ZOrderDownCommand::undo() {
+void LowerCommand::undo() {
_item->setZValue(_item->zValue() +1);
}
-void ZOrderDownCommand::redo() {
+void LowerCommand::redo() {
_item->setZValue(_item->zValue() - 1);
}
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.h #672703:672704
@@ -38,9 +38,9 @@
void creationComplete();
public Q_SLOTS:
- void removeItem();
- void zOrderUp();
- void zOrderDown();
+ void remove();
+ void raise();
+ void lower();
bool transformToRect(const QRectF &newRect);
protected Q_SLOTS:
@@ -117,9 +117,9 @@
{
public:
RemoveCommand()
- : ViewItemCommand(QObject::tr("Remove Item")) {}
+ : ViewItemCommand(QObject::tr("Remove")) {}
RemoveCommand(ViewItem *item)
- : ViewItemCommand(item, QObject::tr("Remove Item")) {}
+ : ViewItemCommand(item, QObject::tr("Remove")) {}
virtual ~RemoveCommand() {}
@@ -127,29 +127,29 @@
virtual void redo();
};
-class KST_EXPORT ZOrderUpCommand : public ViewItemCommand
+class KST_EXPORT RaiseCommand : public ViewItemCommand
{
public:
- ZOrderUpCommand()
- : ViewItemCommand(QObject::tr("Z-Order Up")) {}
- ZOrderUpCommand(ViewItem *item)
- : ViewItemCommand(item, QObject::tr("Z-Order Up")) {}
+ RaiseCommand()
+ : ViewItemCommand(QObject::tr("Raise")) {}
+ RaiseCommand(ViewItem *item)
+ : ViewItemCommand(item, QObject::tr("Raise")) {}
- virtual ~ZOrderUpCommand() {}
+ virtual ~RaiseCommand() {}
virtual void undo();
virtual void redo();
};
-class KST_EXPORT ZOrderDownCommand : public ViewItemCommand
+class KST_EXPORT LowerCommand : public ViewItemCommand
{
public:
- ZOrderDownCommand()
- : ViewItemCommand(QObject::tr("Z-Order Down")) {}
- ZOrderDownCommand(ViewItem *item)
- : ViewItemCommand(item, QObject::tr("Z-Order Down")) {}
+ LowerCommand()
+ : ViewItemCommand(QObject::tr("Lower")) {}
+ LowerCommand(ViewItem *item)
+ : ViewItemCommand(item, QObject::tr("Lower")) {}
- virtual ~ZOrderDownCommand() {}
+ virtual ~LowerCommand() {}
virtual void undo();
virtual void redo();
More information about the Kst
mailing list