#51 Keyboard shortcuts not working after rev 1094

closed-fixed
Mezomish
GUI (13)
5
2011-02-24
2011-01-07
No

Yesterday i updated my working copy from svn, successfully built juffed (without warning etc).
Now no keyboard shorcut is working!
I mean things like Ctrl+N, Ctrl+O, Ctrl+W, F11 and so on - none works.

I'm on gentoo linux, using fluxbox.

I looked at last changes and revision 1094 "fix for Terminal: Ctrl-C and Ctrl-\ is not supported" by subik is the one responsible for this!
/trunk/src/lib/CommandStorage.cpp#47:
a->setShortcutContext(Qt::WidgetWithChildrenShortcut);

If i commented this line out shortcuts works again.

---------

dev-libs/libdbusmenu-qt (0.6.4)
dev-python/PyQt4 (4.8.1)
dev-util/qt-creator (1.3.1-r1)
x11-libs/qt-assistant (4.6.3)
x11-libs/qt-core (4.6.3)
x11-libs/qt-dbus (4.6.3)
x11-libs/qt-demo (4.6.3)
x11-libs/qt-gui (4.6.3-r2)
x11-libs/qt-multimedia (4.6.3)
x11-libs/qt-opengl (4.6.3)
x11-libs/qt-qt3support (4.6.3)
x11-libs/qt-script (4.6.3)
x11-libs/qt-sql (4.6.3-r2)
x11-libs/qt-svg (4.6.3)
x11-libs/qt-test (4.6.3)
x11-libs/qt-webkit (4.6.3-r1)
x11-libs/qt-xmlpatterns (4.6.3)
x11-libs/qtscriptgenerator (0.1.0)

---------

$ svn info
Path: .
URL: https://juffed.svn.sourceforge.net/svnroot/juffed/trunk
Repository Root: https://juffed.svn.sourceforge.net/svnroot/juffed
Repository UUID: cab69d93-124a-0410-a35b-bdf591ef4405
Revision: 1094
Node Kind: directory
Schedule: normal
Last Changed Author: subik
Last Changed Rev: 1094
Last Changed Date: 2011-01-03 20:17:22 +0100 (Po, 03 led 2011)

---------

Discussion

  • Queria Sa-Tas

    Queria Sa-Tas - 2011-01-07

    Ouch.
    The problem is this.

    Qt::WidgetWithChildrenShortcut means:
    The shortcut is active when its parent widget, or any of its children has focus. Children which are top-level widgets, except pop-ups, are not affected by this shortcut context.

    Here see the "its parent widget".

    But these actions are created in CommandStorage::addAction(...,obj,slot) which makes qAction(parent=obj).

    And thats it - JuffEd::initActions - calls CommandStorage::addAction(obj=this) ... but JuffEd IS NOT QWidget if i didn't missed something ... at least JuffEd has mainwindow inside itself (mw_) ...

    So parent of these QActions should be this mw_ if Qt::WidgetWithChildrenShortcut needs to be used.

    But then it's not simply possible to change all these CommandStorage::addAction(obj=this) in JuffEd::initActions ... because "obj" will be used also for connect() ... and these target slots are not in mw_.

    So at first look i see two solutions:
    A) reparent all required actions after addAction
    B) create overloaded CommandStorage::addAction(key, name, parent, slotOwner, slot)
    which does "new QAction(parent=parent); connect(..., slotOwner, slot);"

    The second one is maybe better ... but still all calls of CS::addAction needs to be verified manualy, to finish what rev1094 began.

     
  • Mezomish

    Mezomish - 2011-01-08

    Thank you for your investigation, I'll see what can be done here. Indeed, there is a problem with handling hotkeys with this flag set if the receiving object is not a QWidget.
    I'll try my guesses shortly.

     
  • Mezomish

    Mezomish - 2011-01-08
    • status: open --> open-accepted
     
  • Petr Vaněk

    Petr Vaněk - 2011-01-21

    temp fix has been commited. It's only a workaround unfortunately.

     
  • Mezomish

    Mezomish - 2011-02-24

    Tried to play around with shortcut modes. Unfortunately I couldn't make it work properly without a hack introduced by Petr.
    Let it be like that right now (I was planning to change how Terminal operates anyway).

     
  • Mezomish

    Mezomish - 2011-02-24
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks