[Digikam-devel] [Bug 114465] Simpler entry of tags using keyboard shortcuts

Marcel Wiesweg marcel.wiesweg at gmx.de
Tue Jan 25 22:19:50 GMT 2011


https://bugs.kde.org/show_bug.cgi?id=114465





--- Comment #121 from Marcel Wiesweg <marcel wiesweg gmx de>  2011-01-25 23:19:46 ---
Yes, sounds all right.

There is QApplication::activeWindow to get the active top-level window.
There is also QApplication::focusWidget() to get the focus widget down the
hierarchy, and climb up using QWidget::parentWidget(). Sometimes focusWidget()
can be 0 though.
You could also use an interface class with a pure virtual method, and going up
the QObject hierarchy from the focusWidget use dynamic_cast to find the first
object also inheriting this interface. That would only be necessary if there
are multiple components in the same window reacting differently to the
shortcut. If the behavior is clear per-window, the activeWindow() solution will
be easier.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list