<br><br><div class="gmail_quote">On Sat, Jan 16, 2010 at 5:08 PM, Giulio Camuffo <span dir="ltr">&lt;<a href="mailto:giuliocamuffo@gmail.com">giuliocamuffo@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Saturday 16 January 2010 05:36:41 Shantanu Tushar Jha wrote:<br>
&gt; Hello all,<br>
&gt;     I wanted to make a simple PopupApplet which stays as an icon in the<br>
&gt; panel and when clicked shows a popup allowing to enter username and<br>
&gt; password. The techbase extenders tutorial seems a bit overkill for this<br>
&gt; because it provides more functionality than what required in my case. So,<br>
&gt; looking at the PopupApplet API, I wrote the following code -<br>
&gt;<br>
&gt; #include &quot;sifyclient.h&quot;<br>
&gt; K_EXPORT_PLASMA_APPLET(sifyclient, SifyClient)<br>
&gt;<br>
&gt; SifyClient::SifyClient(QObject *parent, const QVariantList &amp;args)<br>
&gt;<br>
&gt;     : Plasma::PopupApplet(parent, args)<br>
&gt;<br>
&gt; {<br>
&gt;     topLevelWidget = new QGraphicsWidget;<br>
&gt;     usernameLabel = new Plasma::Label(topLevelWidget);<br>
&gt;     usernameEdit = new Plasma::LineEdit(topLevelWidget);<br>
&gt;<br>
&gt;     usernameLabel-&gt;setText(&quot;Username&quot;);<br>
&gt;<br>
&gt;     QGraphicsLinearLayout *usernameLayout = new<br>
&gt; QGraphicsLinearLayout(Qt::Horizontal, topLevelWidget);<br>
&gt;     dataTransferLayout-&gt;addItem(usernameLabel);<br>
&gt;     dataTransferLayout-&gt;addItem(usernameEdit);<br>
&gt;<br>
&gt;     topLevelWidget-&gt;setLayout(dataTransferLayout);<br>
&gt; }<br>
&gt;<br>
&gt; SifyClient::~SifyClient()<br>
&gt; {<br>
&gt;     delete topLevelWidget;<br>
&gt; }<br>
&gt;<br>
&gt; void SifyClient::init()<br>
&gt; {<br>
&gt;     setPopupIcon(&quot;device-notifier&quot;);    //just for testing, will replace by<br>
&gt; appropriate one later<br>
&gt; }<br>
&gt;<br>
&gt; QGraphicsWidget *SifyClient::graphicsWidget()<br>
&gt; {<br>
&gt;     return topLevelWidget;<br>
&gt; }<br>
&gt;<br>
&gt; #include &quot;sifyclient.moc&quot;<br>
&gt;<br>
&gt;<br>
&gt; From the API, I expected this to display &#39;device-notifier&#39; icon when placed<br>
&gt; in panel and show the username label and line edit when clicked. Instead it<br>
&gt; displays the label and line edit directly inside the panel. What am I doing<br>
&gt; wrong? How to get the effect I&#39;m trying to achieve?<br>
&gt;<br>
&gt; Thanks<br>
<br>
</div></div>Try setting a a minimum size for the topLevelWidget. It should work that way.<br></blockquote><div><br>Thanks, that worked! I used &#39;topLevelWidget-&gt;setMinimumSize(250, 250);&#39; in the constructor and now it shows the icon in the panel.<br>
But now, If I click the icon, nothing pops up. Only If I move the applet from the panel to the desktop (when it shows the topLevelWidget with a label and lineEdit inside it) and then move it back into the panel, the popup shows on clicking the icon. Every time I do this, the following is output to the terminal -<br>
<br>plasma-desktop(5365)/plasma ItemSpace::resizeItem: Resizing QRectF(787,637 32x32) to QRectF(787,637 278x278)<br><br>Any idea what I&#39;m missing?<br><br>Thanks <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

_______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Shantanu Tushar    (UTC +0530)<br><a href="http://www.shantanutushar.com">http://www.shantanutushar.com</a><br>