Changing a shortcut

Sven Langkamp sven.langkamp at gmail.com
Thu Oct 21 19:33:15 CEST 2010


Hi,

I'm trying to solve bug 251616 ( 'Ctrl+I' is ambiguous.) I'm trying to
change the italics shortcut when the view is created.

Code looks like this:
Index: kis_view2.cpp
===================================================================
--- kis_view2.cpp       (Revision 1187127)
+++ kis_view2.cpp       (Arbeitskopie)
@@ -325,6 +325,13 @@
     connect(m_d->canvas, SIGNAL(scrollAreaSizeChanged()), m_d->zoomManager,
SLOT(slotScrollAreaSizeChanged()));

     setAcceptDrops(true);
+
+    QAction* selectionInvert = actionCollection()->action("invert");
+    QAction* textToolItalics = actionCollection()->action("format_italic");
+    if(selectionInvert && textToolItalics && selectionInvert->shortcut() ==
textToolItalics->shortcut()) {
+        textToolItalics->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_I);
+        kDebug() << "shortcut is " << textToolItalics->shortcut();
+    }
 }

The debug code indicates that the shortcut is changed, but the problem
persists.
Any ideas what I have to do?


Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20101021/6afe30a1/attachment.htm 


More information about the kimageshop mailing list