No subject


Sat Jan 16 00:47:07 CET 2010


in panel and show the username label and line edit when clicked. Instead it
displays the label and line edit directly inside the panel. What am I doing
wrong? How to get the effect I'm trying to achieve?

Thanks
-- 
Shantanu Tushar    (UTC +0530)
http://www.shantanutushar.com

--0016e6d99cd741d67b047d41818a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello all,<br>=A0=A0=A0 I wanted to make a simple PopupApplet which stays a=
s an icon in the panel and when clicked shows a popup allowing to enter use=
rname and password. The techbase extenders tutorial seems a bit overkill fo=
r this because it provides more functionality than what required in my case=
. So, looking at the PopupApplet API, I wrote the following code -<br>
<br>#include &quot;sifyclient.h&quot;<br>K_EXPORT_PLASMA_APPLET(sifyclient,=
 SifyClient)<br>=A0<br>SifyClient::SifyClient(QObject *parent, const QVaria=
ntList &amp;args)<br>=A0=A0=A0 : Plasma::PopupApplet(parent, args)<br>{<br>=
=A0=A0=A0 topLevelWidget =3D new QGraphicsWidget;<br>
=A0=A0=A0 usernameLabel =3D new Plasma::Label(topLevelWidget);<br>=A0=A0=A0=
 usernameEdit =3D new Plasma::LineEdit(topLevelWidget);<br>=A0=A0=A0 <br>=
=A0=A0=A0 usernameLabel-&gt;setText(&quot;Username&quot;);<br>=A0=A0=A0 <br=
>=A0=A0=A0 QGraphicsLinearLayout *usernameLayout =3D new QGraphicsLinearLay=
out(Qt::Horizontal, topLevelWidget);<br>
=A0=A0=A0 dataTransferLayout-&gt;addItem(usernameLabel);<br>=A0=A0=A0 dataT=
ransferLayout-&gt;addItem(usernameEdit);<br>=A0=A0=A0 <br>=A0=A0=A0 topLeve=
lWidget-&gt;setLayout(dataTransferLayout);<br>}<br><br>SifyClient::~SifyCli=
ent()<br>{<br>=A0=A0=A0 delete topLevelWidget;<br>
}<br><br>void SifyClient::init()<br>{<br>=A0=A0=A0 setPopupIcon(&quot;devic=
e-notifier&quot;);=A0=A0=A0 //just for testing, will replace by appropriate=
 one later<br>}<br><br>QGraphicsWidget *SifyClient::graphicsWidget()<br>{<b=
r>=A0=A0=A0 return topLevelWidget;<br>
}<br><br>#include &quot;sifyclient.moc&quot;<br><br clear=3D"all"><br>From =
the API, I expected this to display &#39;device-notifier&#39; icon when pla=
ced in panel and show the username label and line edit when clicked. Instea=
d it displays the label and line edit directly inside the panel. What am I =
doing wrong? How to get the effect I&#39;m trying to achieve?<br>
<br>Thanks<br>-- <br>Shantanu Tushar =A0 =A0(UTC +0530)<br><a href=3D"http:=
//www.shantanutushar.com">http://www.shantanutushar.com</a><br>

--0016e6d99cd741d67b047d41818a--


More information about the Plasma-devel mailing list