[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] call method doesn't work if it has QScintilla instance
From: Detlev Offenbach <detlev () die-offenbachs ! de>
Date: 2012-10-14 13:50:45
Message-ID: 1527324.T7ihV7LH1U () saturn
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Still cannot run it because sciPythonEditor.py includes this import statement
from qgis.utils import iface
Further more, the code you sent doesn have a prefChanged() method anywhere.
On Sunday 14 October 2012, 15:14:19 Salvatore Larosa wrote:
Hi,
very odd, you should be able to run it also without qgis package!
I attached a new package, Could you give a try at it ? (run
sciPythonEditor.py)
Thank you very much!
Regards,
-SL
PS: can I clone the repository to install trunk version of eric like to github
repository ? Where/How do it ?
2012/10/14 Detlev Offenbach <detlev@die-offenbachs.de>
Hello,
I don't know why it doesn't work. The code looks right (although a bit
strange). Unfortunately I am not able to debug it because it imports QGis
stuff, which I don't have, and missing files in the archive.
Regards,
Detlev
Am 14.10.2012 um 13:03 schrieb Salvatore Larosa <lrssvtml@gmail.com>:
Hi Detlev,
At the moment I'm using Aptana as IDE, but I will pass to Eric ;-)
If you are so kind to check out the attached code, you will notice the
problem. The interpreter is console.py!
the method is prefChanged() in console_sci.py which is called in
console_settings.py (accept event)
I do not understand why does not work, I make a simple call!
Thanks a lot!
-SL
2012/10/14 Detlev Offenbach <detlev@die-offenbachs.de>
Is the second method called at all? Maybe it would be a good idea to do your
coding with eric and use the eric debugger to check what's going on ;-)
Detlev
Am 14.10.2012 um 11:33 schrieb Salvatore Larosa <lrssvtml@gmail.com>:
I have a small problem in defining/calling an external method in my
application.
I have 3 files, mainapp.py, qscintilla.py and settings.py
in mainapp.py:
from qscintilla import sciEditor
from settings import dialog
in setting.py (settings dialog):
from qscintilla import sciEditor
in qscintilla.py:
scintilla instances stuff
the strange thing is that I can not call a method of sciEditor from setting
dialog which has Qscintilla instance!!
I try to be clearer:
For example, in my sciEditor class I have these methods:
def method1 (self):
print "Hello"
def method2 (self):
self.SendScintilla (QsciScintilla.SCI_CLEARALL)
self.setText ("Hello")
calling the first method from settings dialog works, the latter not!
maybe I'm missing something!!!
Any suggest is appreciate !
All the best!
-SL
--
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Detlev Offenbach
detlev@die-offenbachs.de
--
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
<consolePython.zip>
Detlev Offenbach
detlev@die-offenbachs.de
--
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
--
Detlev Offenbach
detlev@die-offenbachs.de
[Attachment #5 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" \
content="1" /><style type="text/css"> p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; \
font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">Still cannot run it because sciPythonEditor.py includes this \
import statement</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; "> </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">from qgis.utils import iface</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Further more, the code you \
sent doesn have a prefChanged() method anywhere.</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br />On Sunday 14 \
October 2012, 15:14:19 Salvatore Larosa wrote:<br /></p> <p style=" margin-top:12px; \
margin-bottom:12px; margin-left:40px; margin-right:40px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">Hi,<br />very odd, you should be able to run it \
also without qgis package!<br />I attached a new package, Could you give a try at it \
? (run sciPythonEditor.py)<br /><br />Thank you very much!<br /><br />Regards,<br \
/><br />-SL<br /><br />PS: can I clone the repository to install trunk version of \
eric like to github repository ? Where/How do it ?<br /><br /><br /></p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">2012/10/14 Detlev Offenbach \
<<a href="mailto:detlev@die-offenbachs.de"><span style=" text-decoration: \
underline; color:#0057ae;">detlev@die-offenbachs.de</span></a>><br /></p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hello,</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I don't know why it doesn't \
work. The code looks right (although a bit strange). Unfortunately I am not able to \
debug it because it imports QGis stuff, which I don't have, and missing files in the \
archive. </p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:44px; \
margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Regards,</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Detlev</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Am 14.10.2012 um 13:03 \
schrieb Salvatore Larosa <<a href="mailto:lrssvtml@gmail.com"><span style=" \
text-decoration: underline; color:#0057ae;">lrssvtml@gmail.com</span></a>>:</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" \
margin-top:12px; margin-bottom:0px; margin-left:84px; margin-right:80px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hi Detlev,<br /></p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:84px; margin-right:80px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">At the moment I'm using \
Aptana as IDE, but I will pass to Eric ;-)<br /><br /></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:84px; margin-right:80px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">If you are so kind to check out the attached \
code, you will notice the problem. The interpreter is console.py!<br />the method is \
prefChanged() in console_sci.py which is called in console_settings.py (accept \
event)<br /><br />I do not understand why does not work, I make a simple call!<br \
/><br />Thanks a lot!<br /><br />-SL<br /></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br /><br /></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:84px; margin-right:80px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">2012/10/14 Detlev Offenbach <<a \
href="mailto:detlev@die-offenbachs.de"><span style=" text-decoration: underline; \
color:#0057ae;">detlev@die-offenbachs.de</span></a>><br /></p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:88px; margin-right:80px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Is the second method called \
at all? Maybe it would be a good idea to do your coding with eric and use the eric \
debugger to check what's going on ;-)</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:88px; margin-right:80px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:88px; margin-right:80px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">Detlev</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:88px; margin-right:80px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:88px; margin-right:80px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">Am 14.10.2012 um 11:33 schrieb Salvatore Larosa \
<<a href="mailto:lrssvtml@gmail.com"><span style=" text-decoration: underline; \
color:#0057ae;">lrssvtml@gmail.com</span></a>>:</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" margin-top:12px; \
margin-bottom:0px; margin-left:128px; margin-right:120px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">I have a small problem in defining/calling an \
external method in my application.<br /></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:128px; margin-right:120px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">I have 3 files, mainapp.py, qscintilla.py and \
settings.py<br /><br />in mainapp.py:<br /><br />from qscintilla import sciEditor<br \
/>from settings import dialog<br /><br />in setting.py (settings dialog):<br /><br \
/>from qscintilla import sciEditor<br /><br />in qscintilla.py:<br /><br />scintilla \
instances stuff<br /><br />the strange thing is that I can not call a method of \
sciEditor from setting dialog which has Qscintilla instance!!<br /><br />I try to be \
clearer:<br /><br />For example, in my sciEditor class I have these methods:<br \
/><br />def method1 (self):<br /> print "Hello"<br /><br />def method2 \
(self):<br /> self.SendScintilla (QsciScintilla.SCI_CLEARALL)<br /> \
self.setText ("Hello")<br /><br />calling the first method from settings \
dialog works, the latter not!<br /><br />maybe I'm missing something!!!<br /><br \
/>Any suggest is appreciate !<br /><br /><br />All the best!<br /><br />-SL<br /></p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br />-- <br \
/>Salvatore Larosa<br />linkedIn: <a \
href="http://linkedin.com/in/larosasalvatore"><span style=" text-decoration: \
underline; color:#0057ae;">http://linkedin.com/in/larosasalvatore</span></a><br \
/>twitter: @lrssvt<br />skype: s.larosa<br />IRC: lrssvt on freenode<br /><br /></p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">_______________________________________________<br />PyQt mailing \
list <a href="mailto:PyQt@riverbankcomputing.com"><span style=" text-decoration: \
underline; color:#0057ae;">PyQt@riverbankcomputing.com</span></a><br /><a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt"><span style=" \
text-decoration: underline; \
color:#0057ae;">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</span></a> \
</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" \
color:#888888;"><br /></span></p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><span style=" font-family:'Helvetica'; font-size:medium; \
color:#888888;">Detlev Offenbach</span></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><a href="mailto:detlev@die-offenbachs.de"><span \
style=" font-family:'Helvetica'; font-size:medium; text-decoration: underline; \
color:#0057ae;">detlev@die-offenbachs.de</span></a></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Helvetica'; \
font-size:medium; color:#888888;"><br /></span></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><span style=" color:#888888;"><br /></span></p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" \
color:#888888;"><br /></span></p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br /><br /><br />-- <br />Salvatore Larosa<br />linkedIn: <a \
href="http://linkedin.com/in/larosasalvatore"><span style=" text-decoration: \
underline; color:#0057ae;">http://linkedin.com/in/larosasalvatore</span></a><br \
/>twitter: @lrssvt<br />skype: s.larosa<br />IRC: lrssvt on freenode<br /><br /></p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><consolePython.zip></p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" \
color:#888888;"><br /></span></p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><span style=" font-family:'Helvetica'; font-size:medium; \
color:#888888;">Detlev Offenbach</span></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><a href="mailto:detlev@die-offenbachs.de"><span \
style=" font-family:'Helvetica'; font-size:medium; text-decoration: underline; \
color:#0057ae;">detlev@die-offenbachs.de</span></a></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Helvetica'; \
font-size:medium; color:#888888;"><br /></span></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><span style=" color:#888888;"><br /></span></p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" \
color:#888888;"><br /></span></p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br /><br /><br />-- <br />Salvatore Larosa<br />linkedIn: <a \
href="http://linkedin.com/in/larosasalvatore"><span style=" text-decoration: \
underline; color:#0057ae;">http://linkedin.com/in/larosasalvatore</span></a><br \
/>twitter: @lrssvt<br />skype: s.larosa<br />IRC: lrssvt on freenode<br /><br /></p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br />-- </p> <p \
style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-size:11pt; \
font-weight:600;">Detlev Offenbach</span></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">detlev@die-offenbachs.de</p></body></html>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://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