Version: (using KDE 4.2.0) OS: Linux Installed from: Unspecified Linux Hi, I have written a very simple widget (http://www.kde-look.org/content/show.php/QuickUrl?action=content&content=99815) If I use it on the desktop everything work fine... but if I add it on the menu panel I start to have focus problems for the linetext. As soon as there are no application open (visible) on the desktop I can easily key in the information in the linetext but when I have visible application the focus is stolen from the linetext. Maybe is a problem in my code.. Just for your reference.. Regards ------------------------------------------------------------------- # -*- coding: utf-8 -*- from PyQt4.QtCore import * from PyQt4.QtGui import * from PyKDE4.plasma import Plasma from PyKDE4 import plasmascript from PyQt4 import QtGui import webbrowser class QuickUrl(plasmascript.Applet): def __init__(self,parent,args=None): plasmascript.Applet.__init__(self,parent) def openUrl(self): if (len(_text.text())>0): webbrowser.open_new(_text.text()) str = "" else: QMessageBox.warning(None, "Warning","Please enter the URL!") def init(self): global _text global _label global _button _text = Plasma.LineEdit(self.applet) _text.setEnabled(True) _text.setFocus() _label = Plasma.Label(self.applet) _style= "color:#000000;font-family:Arial,Verdana,Sans-serif;font-size:8pt;padding:0px;" _label.setText("Url") _label.setEnabled(True) _text.setStyleSheet(_style) _button = Plasma.PushButton(self.applet) _button.setText("Open") _button.setMaximumWidth(100) self.setHasConfigurationInterface(False) self.setAspectRatioMode(Plasma.IgnoreAspectRatio) self.theme = Plasma.Svg(self) self.theme.setImagePath("widgets/background") self.setBackgroundHints(Plasma.Applet.DefaultBackground) self.layout = QGraphicsLinearLayout(Qt.Horizontal, self.applet) self.layout.addItem(_label) self.layout.addItem(_text) self.layout.addItem(_button) self.connect(_button, SIGNAL("clicked()"), self.openUrl) self.setLayout(self.layout) self.resize(300,125) def CreateApplet(parent): return QuickUrl(parent)
this is a general problem of the panel as it doesn't take focus when a focussable widget is purposefully given focus. there's a BR around here somewhere for this issue already. btw, you can also ask devel related question on plasma-devel@kde.org .. *** This bug has been marked as a duplicate of bug 178378 ***