[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt]  Custom widgets don't appear unless inside a layout
From:       "Lais P. Carmo" <lais.carmo () lnls ! br>
Date:       2016-12-09 11:08:42
Message-ID: CP1PR80MB112852020BE9A73C447C337B92870 () CP1PR80MB1128 ! lamprd80 ! prod ! outlook ! com
[Download RAW message or body]

Hi everyone.

I have a little issue with layouts. It seems to be simple thing but I didn'=
t find a solution yet.

I am loading PyQt4 interfaces using the "standard way" (from .ui with loadU=
i method OR from .py with setupUi method). However custom widgets (derived =
from QWieget, QLabel etc.) don't appear on the screen unless I put them ins=
ide a QLayout objetc. Other qt basic widgets display normally.

Also when I read their size it is always different from what I set, and the=
ir x,y coordinates are always turned to zero. It seems that the custom widg=
et loose the main window reference. I explictly set the main window as thei=
r parent but the problem remains.


Putting custom widgets inside layout may not seem to be hard, but it is bor=
ing to work like this in large interfaces. Iam building a simple app to loa=
d interfaces made by users, so I would like the users not to have this need=
.


Thank you for any help!


'''

La=EDs Pessine do Carmo

Computer Engineering Trainee at Beamline Software Group

Brazilian Synchrotron Light Laboratory - LNLS
Center of Research in Energy and Materials - CNPEM
+ 55 (11) 94233-7721   /   Ramal 1226
http://lnls.cnpem.br                     lais.carmo@lnls.br
'''

[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} \
--></style> </head>
<body dir="ltr">
<div id="divtagdefaultwrapper" \
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" \
dir="ltr"> <p>Hi everyone.</p>
<p>I have a little issue with layouts. It seems to be simple thing but I didn't find \
a solution yet.</p> <p>I am loading PyQt4 interfaces using the &quot;standard \
way&quot; (from <b>.ui</b> with <b> loadUi</b> method OR from <b>.py</b> with \
<b>setupUi</b> method). However custom widgets (derived from QWieget, QLabel etc.) \
don't appear on the screen unless I put them inside a QLayout objetc. Other qt basic \
widgets display normally.</p> <p>Also when I read their size it is always different \
from what I set, and their x,y coordinates are always turned to zero. It seems that \
the custom widget loose the main window reference. I explictly set the main window as \
their parent but the problem remains.</p> <p><br>
</p>
<p>Putting custom widgets inside layout may not seem to be hard, but it is boring to \
work like this in large interfaces. Iam building a simple app to load interfaces made \
by users, so I would like the users not to have this need.</p> <p><br>
</p>
<p>Thank you for any help!<br>
</p>
<p><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; \
background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif"> <p><span \
dir="ltr"><font face="Calibri,Arial,Helvetica,sans-serif" color="#3366FF" \
size="2"><span style="font-size:10pt; \
background-color:white"></span></font></span><span style="color:rgb(117,123,128); \
font-family:Consolas,monospace">'''</span></p> <p><span \
style="color:rgb(117,123,128); font-family:Consolas,monospace"><b><u></u><span \
style="color:rgb(0,111,201)">Laís Pessine do Carmo</span></b><br> </span></p>
<p><span style="color:rgb(117,123,128); font-family:Consolas,monospace"></span><font \
color="#006FC9" size="2"><span style="font-size:11pt; color:rgb(0,0,0)"><span \
style="font-family:Consolas,monospace; font-size:12pt; \
color:rgb(117,123,128)">Computer Engineering </span><span \
style="font-family:Consolas,monospace; font-size:12pt; \
color:rgb(117,123,128)">T</span><span style="font-family:Consolas,monospace; \
font-size:12pt; color:rgb(117,123,128)">rainee at Beamline Software \
Group</span></span></font><br> </p>
<font face="Calibri,Arial,Helvetica,sans-serif" color="#3366FF" size="2"><font \
face="Calibri,Arial,Helvetica,sans-serif"><font \
face="Calibri,Arial,Helvetica,sans-serif"> <div style="margin-top:0; \
margin-bottom:0"><font face="Calibri,Arial,Helvetica,sans-serif" color="black" \
size="3"><span style="font-size:12pt"><font color="#006FC9" size="2"><span \
style="font-size:11pt"><span style="color:rgb(0,0,0); \
font-family:Consolas,monospace"><span style="font-family:Consolas,monospace; \
font-size:12pt; color:rgb(117,123,128)"></span><b><span \
style="font-family:Consolas,monospace; font-size:12pt; \
color:rgb(0,111,201)">Brazilian  Synchrotron Light Laboratory - \
</span></b></span><b><span style="color:rgb(0,111,201); \
font-family:Consolas,monospace; font-size:12pt">L</span><span \
style="color:rgb(0,111,201); font-family:Consolas,monospace; \
font-size:12pt">NLS</span></b></span></font><b><font color="#006FC9" size="2"><span \
style="font-size:12pt; color:rgb(0,111,201); font-family:Consolas,monospace"><br> \
Center of Research in Energy and Materials - CNPEM</span></font></b><font \
color="#006FC9" size="2"><span style="font-size:12pt; color:rgb(117,123,128); \
font-family:Consolas,monospace"><br> &#43; 55 (11) 94233-772<font \
color="#006FC9"><font face="Calibri,Arial,Helvetica,sans-serif"></font></font>1 \
&nbsp;&nbsp;<font color="#006FC9" size="2"><span style="font-size:11pt; \
color:rgb(0,0,0)"><span style="font-family:Consolas,monospace; font-size:12pt; \
color:rgb(117,123,128)">/</span></span></font>&nbsp;&nbsp; <font \
face="Calibri,Arial,Helvetica,sans-serif" color="#3366FF" size="2"><font \
face="Calibri,Arial,Helvetica,sans-serif"><font \
face="Calibri,Arial,Helvetica,sans-serif"><font \
face="Calibri,Arial,Helvetica,sans-serif" color="black" size="3"><span \
style="font-size:12pt"><font color="#006FC9" size="2"><span style="font-size:12pt; \
color:rgb(117,123,128); font-family:Consolas,monospace">Ramal  \
1226</span></font></span></font></font></font></font></span></font><font \
color="#006FC9" size="2"><span style="font-size:11pt"><span \
style="color:rgb(117,123,128); font-family:Consolas,monospace; \
font-size:12pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span \
style="background-color:rgb(255,255,255)"> </span></span></span></font><font \
color="#006FC9" size="2"><span style="font-size:11pt; color:rgb(0,0,0)"><br> <font \
color="#006FC9"><a id="LPNoLP" href="http://lnls.cnpem.br"><span \
style="font-size:14pt; background-color:rgb(255,255,255); \
color:rgb(0,111,201)"><b>http:/</b></span><b><font color="#006FC9"><span \
style="font-size:14pt; background-color:rgb(255,255,255); \
color:rgb(0,111,201)">/</span></font><span style="font-size:14pt; \
background-color:rgb(255,255,255); \
color:rgb(0,111,201)">lnls.cnpem.br</span></b></a></font><b><span \
style="background-color:rgb(255,255,255); \
color:rgb(0,111,201)"></span></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <font face="Calibri,Arial,Helvetica,sans-serif" color="#3366FF" size="2"><font \
face="Calibri,Arial,Helvetica,sans-serif"><font \
face="Calibri,Arial,Helvetica,sans-serif"><font \
face="Calibri,Arial,Helvetica,sans-serif" color="black" size="3"><span \
style="font-size:12pt"><font color="#006FC9" size="2"><span \
style="font-size:11pt"><span style="color:rgb(117,123,128); \
font-family:Consolas,monospace; font-size:12pt"><span \
style="background-color:rgb(255,255,255)"></span></span><b><span \
name="searchHitInReadingPane" id="0.768250062297091" class="highlight" \
style="color:rgb(0,111,201); font-family:Consolas,monospace; font-size:12pt; \
background-color:rgb(255,255,255)">lais.carmo</span><span \
name="searchHitInReadingPane" id="0.5587804111142429" class="highlight"></span><span \
style="color:rgb(117,123,128); font-family:Consolas,monospace; font-size:12pt"><span \
style="background-color:rgb(255,255,255); color:rgb(0,111,201)">@lnls.b</span><span \
style="color:rgb(0,111,201)">r</span></span></b></span></font><font color="#006FC9" \
size="2"><span style="font-size:11pt; \
color:rgb(0,0,0)"></span></font></span></font></font></font></font><br> <span \
style="font-family:Consolas,monospace; font-size:12pt; \
color:rgb(117,123,128)"></span></span></font></span></font></div> \
</font></font></font><span style="color:rgb(117,123,128); \
font-family:Consolas,monospace; font-size:12pt">'''</span><br> <p></p>
</div>
</div>
</div>
</body>
</html>


[Attachment #4 (unknown)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic