Question

I'm trying to create a dialog that uses two GUI elements: KDEUI KActionSelector and QTExtEdit. I want to have an ability to populate some additional information about the objects in any of the two windows of ActionSelector upon the mouse click. Under the hood: i have a python dictionary. The keys of the dictionary are the entries presented in the ActionSelector. When any of the entries on either side is clicked, i want to be able to catch that signal, understand which key was clicked and show corresponding value in the QTextEdit. That should help user to make a decision about moving or not moving the selected item.

If this is not easy than the alternative solution is probably to use two list widgets instead of kActionSelector and reimplement the whole management shebang, but I of course would like to avoid that;)

I'm also worried if the usage of KDE element is safe to be used on different machines that might have different versions of Linux running...

Thanks!

Was it helpful?

Solution

Unfortunately the API of KActionSelector is a bit cumbersome to use, so I have resorted to implementing the functionality I needed via the use of two QListWidgets and two QPushButtons, marked ">>" and "<<" correspondingly.

Upon the button click I'm removing selected element from current list and add it to the list on the other side.

Click on any element in either list causes the selected item to be checked against the dictionary, where element is supposed to be a dictionary key. If the element is not present in the dictionary, the KeyError thrown is catched in try:except block.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top