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

List:       pykde
Subject:    [PyKDE] Windows not working when embedded.
From:       "Hihn, Jason" <Jason.Hihn () verint ! com>
Date:       2004-11-22 14:58:32
Message-ID: BE7EC6C7A6F0E74AAB1E7E36BF5E9EB70AE390 () colms1 ! co ! corp ! verintsys
[Download RAW message or body]

--===============0536756523==
content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C4D0A3.BBFAC2D9"

This is a multi-part message in MIME format.


Ok, I gave up on the idea of making monolithic binary. So I have
everything compiled and installed as usual. I can doubple click the
script, and it works as it should.



I embedded python into my app. Python works. But when I try to run any
pyqt code, nothing happens. The imports seem to work, (having debugged
into python and such) but my app window does not come up.



Here's my code:



char statements[][80]={

"import sys\n",

"sys.path.append('C:\\Python23\\Lib\\site-packages')\n",

"from qt import *\n",

"from qtui import *\n",



"a=QApplication(sys.argv)\n",

"a.connect(a, SIGNAL(\"lastWindowClosed()\"), a, SLOT(\"quit()\"))\n",

"x=QDialog()\n",

"x.show()\n",

"a.exec_loop()\n"};

PyObject *err;



for (int i=0; i<sizeof(statements)/80; i++){

            PyRun_SimpleString(statements[i]);

            err=PyErr_Occurred();

            if (err)

                        PyErr_Print();



}



At no time is PyErr_Print() reached. Yet nothing happens.



Does anyone have an idea? I'm trying to get a window fro python in a
MSVC 6 app.



Thanks!



__________________________________________________________________________________________
 This electronic message may contain proprietary and confidential information of \
Verint Systems Inc., its affiliates and/or subsidiaries. The information is intended \
to be for the use of the individual(s) or entity(ies) named above.  If you are not \
the intended recipient (or authorized to receive this e-mail for the intended \
recipient), you may not use, copy, disclose or distribute to anyone this message or \
any information contained in this message.  If you have received this electronic \
message in error, please notify us by replying to this e-mail. (1)


[Attachment #3 (text/html)]

<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Ok, I gave up on the idea of making monolithic binary. So I
have everything compiled and installed as usual. I can doubple click the
script, and it works as it should.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I embedded python into my app. Python works. But when I try
to run any pyqt code, nothing happens. The imports seem to work, (having
debugged into python and such) but my app window does not come \
up.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Here&#8217;s my code:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>char statements[][80]={<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;import \
sys\n&quot;,<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;sys.path.append('C:\\Python23\\Lib\\site-packages')\n&quot;,<o:p></o:p></span></font></p>


<p class=MsoNormal style='text-indent:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;from qt import \
*\n&quot;,<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;from qtui import \
*\n&quot;,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;a=QApplication(sys.argv)\n&quot;,<o:p></o:p></span></font></p>


<p class=MsoNormal style='text-indent:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;a.connect(a,
SIGNAL(\&quot;lastWindowClosed()\&quot;), a, \
SLOT(\&quot;quit()\&quot;))\n&quot;,<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;x=QDialog()\n&quot;,<o:p></o:p></span></font></p>


<p class=MsoNormal style='text-indent:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;x.show()\n&quot;,<o:p></o:p></span></font></p>


<p class=MsoNormal style='text-indent:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;a.exec_loop()\n&quot;};<o:p></o:p></span></font></p>


<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>PyObject *err;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>for (int i=0; i&lt;sizeof(statements)/80; \
i++){<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
PyRun_SimpleString(statements[i]);<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
err=PyErr_Occurred();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
if (err)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
PyErr_Print();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>}<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>At no time is PyErr_Print() reached. Yet nothing happens. \
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Does anyone have an idea? I&#8217;m trying to get a window
fro python in a MSVC 6 app.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks!<o:p></o:p></span></font></p>

</div>

</body>

</html>

<table><tr><td bgcolor=#ffffff><font \
color=#000000>__________________________________________________________________________________________<br>
 This electronic message may contain proprietary and confidential information of \
Verint Systems Inc., its affiliates and/or subsidiaries.<br> The information is \
intended to be for the use of the individual(s) or<br> entity(ies) named above.  If \
you are not the intended recipient (or authorized to receive this e-mail for the \
intended recipient), you may not use, copy, disclose or distribute to anyone this \
message or any information contained in this message.  If you have received this \
electronic message in error, please notify us by replying to this e-mail. (1)<br> \
</font></td></tr></table>



_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

--===============0536756523==--


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

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