[qet] [2533] Element editor: add context menu

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2533
Author:   scorpio810
Date:     2013-09-14 15:11:32 +0200 (Sat, 14 Sep 2013)
Log Message:
-----------
Element editor: add context menu

Modified Paths:
--------------
    trunk/sources/editor/qetelementeditor.cpp
    trunk/sources/editor/qetelementeditor.h

Modified: trunk/sources/editor/qetelementeditor.cpp
===================================================================
--- trunk/sources/editor/qetelementeditor.cpp	2013-09-14 07:39:40 UTC (rev 2532)
+++ trunk/sources/editor/qetelementeditor.cpp	2013-09-14 13:11:32 UTC (rev 2533)
@@ -400,7 +400,7 @@
 	edit_menu -> addAction(edit_raise);
 	edit_menu -> addAction(edit_lower);
 	edit_menu -> addAction(edit_backward);
-	
+
 	display_menu -> addAction(zoom_in);
 	display_menu -> addAction(zoom_out);
 	display_menu -> addAction(zoom_fit);
@@ -412,6 +412,21 @@
 }
 
 /**
+ * @brief QETElementEditor::contextMenuEvent
+ * @param event
+ */
+void QETElementEditor::contextMenuEvent(QContextMenuEvent *event)
+ {
+	 QMenu menu(this);
+	 menu.addAction(cut);
+	 menu.addAction(copy);
+	 menu.addAction(paste);
+	 menu.addAction(paste_in_area);
+	 menu.exec(event->globalPos());
+ }
+
+
+/**
 	Met a jour les menus
 */
 void QETElementEditor::slot_updateMenus() {

Modified: trunk/sources/editor/qetelementeditor.h
===================================================================
--- trunk/sources/editor/qetelementeditor.h	2013-09-14 07:39:40 UTC (rev 2532)
+++ trunk/sources/editor/qetelementeditor.h	2013-09-14 13:11:32 UTC (rev 2533)
@@ -117,7 +117,8 @@
 	protected:
 	void closeEvent(QCloseEvent *);
 	virtual void firstActivation(QEvent *);
-	
+	void contextMenuEvent(QContextMenuEvent *event);
+
 	private:
 	void setupActions();
 	void setupMenus();


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/