[PyQt] debugging symbols

2010-07-28 Thread Luke Campagnola
Howdy,

Can anyone tell me how to get debugging symbols for the pyqt windows
binaries? I have a few crashes occurring somewhere in QtCore, and so far my
current strategy of "hope the bug exists in Linux too" is not working. My
searches have turned up very little..

Luke
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] connect problem on windows xp

2010-07-28 Thread Sybren A. Stüvel
On 27-7-2010 10:30, Fabio Mauri wrote:
> the whole file is quite big, but I think that the following is the
> interesting part (if you need something more, ask me and I'll post
> it):

I think we need less, not more. This code won't run anyway, since you
didn't provide the Ui_Wdw class. Try to create an example that's minimal.

> QObject.connect(self.refresh, SIGNAL("clicked()"), self.refreshList)
...
> self.objList.itemDoubleClicked.connect(self.showItem)

Is there a reason that you use one style of connecting in one part of
your code, and the other a few lines further down?



Sybren
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] question about dip plugins

2010-07-28 Thread Phil Thompson
On Tue, 27 Jul 2010 15:20:12 -0400, Darren Dale 
wrote:
> The dip documentation at
> http://www.riverbankcomputing.com/static/Docs/dip/plugins_tutorial.html
> mentions:
> 
> "... When a plugin requests a service the plugin manager will choose
> which service is actually used. The plugin does not care about the
> particular service, its only concern is that it has an object that
> implements the interface. ..."
> 
> I am starting work on a project that will simulate spectra based on
> physical reference data. There are several databases to choose from,
> so in a sense the task is similar to the recipe chooser example in the
> plugins tutorial. I would like to be able to compare the results of
> one "recipe" with the next. Is it possible for the client to request a
> particular service or plugin, rather than simply accept whatever the
> plugin manager decides to provide?

Not with the current implementation but, of course, you can replace the
current implementation with your own (probably a sub-class) that does what
you want. However, providing an alternative plugin manager is probably not
a good idea as it makes it more difficult to re-use code later on - you
might want to re-use code that depends on different plugin managers.

A better approach would be to define a spectra database manager plugin.
This would itself be a service. It would define an extension point that
accepts contributions from individual database plugins. You could then
design the API of the manager to allow you to compare the results from one
database with another. Defining the behaviour of the database manager in
terms of an interface will allow you to replace it with another
implementation at a later date without changing any of the database plugins
or any code that calls the database manager API.

> Also, from the same tutorial:
> 
> @implements(IPlugin)
> class RecipeChooserPlugin(Plugin):
> 
> Why is it necessary to decorate subclasses of Plugin with
> @implements(IPlugin)? Are there cases when subclasses of Plugin would
> not implement the IPlugin interface?

Good point, it should probably be...

@implements(IPlugin)
class Plugin(Model):

...so that the decorator is not needed by anything that sub-classes
Plugin.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] connect problem on windows xp

2010-07-28 Thread Fabio Mauri
Bump. Could someone help me about this issue?

On Tue, Jul 27, 2010 at 10:30 AM, Fabio Mauri  wrote:
> Hi,
>
>    the whole file is quite big, but I think that the following is the
> interesting part (if you need something more, ask me and I'll post
> it):
>
> class UPnPgui(QtCore.QObject, Ui_Wdw):
>
>     def __init__(self, sear):
>     self.version = "0.5b"
>     self.s = sear
>     self.serva = [] # services list
>     self.timeout = 0
>     self.val = QRegExpValidator(QRegExp("[0-9]{1,7}"), None)
>     self.refreshing = False
>     self.INTERNAL = 0
>     self.EXTERNAL = 1
>     self.MIN = 2
>     self.MAX = 3
>     self.t = None
>     self.upSer = None
>     self.unlock_t = None
>     return
>
>     def doConnections(self):
>     self.updateThread = myUpdate()
>     QObject.connect(self.refresh, SIGNAL("clicked()"), self.refreshList)
>     QObject.connect(self.clearSel, SIGNAL("clicked()"), self.noneSelected)
>     QObject.connect(self.auto_2, SIGNAL("stateChanged(int)"),
> self.manageAuto)
>     QObject.connect(self.time, SIGNAL("editingFinished()"), 
> self.manageTime)
>     self.objList.itemDoubleClicked.connect(self.showItem)
>     self.updateThread.update.connect(self.autoRefresh)
>     self.updateThread.newTimeout.connect(self.updateThread.updateTimeout)
>     self.manageTime()
>     self.manageAuto(Qt.Checked)
>     # refreshing thread starts..
>     self.updateThread.start()
>     return
>
> ---
>
> if __name__ == "__main__":
>        s = Searcher()
>        searchThread = Thread(target=runSearcher, args=(s,))
>        searchThread.start()
>        app = QtGui.QApplication(sys.argv)
>        window = QtGui.QWidget()
>        ui = UPnPgui(s)
>        ui.setupUi(window)
>        ui.doConnections()
>        window.show()
>        window.geometry()
>        window.setWindowTitle(window.windowTitle() + " version " + ui.version)
>        sys.exit(runApp(app))
>
>
>
> On Tue, Jul 27, 2010 at 10:20 AM, makhamisa senekane
>  wrote:
>>
>> Hi,
>> could you please provide us with your code, because I run most of my 
>> applications on windows XP, and they work very well(using signal/slot 
>> connections).
>> Makhamisa
>>
>> On Tue, Jul 27, 2010 at 10:15 AM, Fabio Mauri  wrote:
>>>
>>> Hi all, I'm trying to get an application run on both windows xp and ubuntu 
>>> 10.04 platforms.
>>> My app imports twisted, coherence and PyQt.
>>> The problem is that under windows XP the signals seems not to be connected 
>>> to slots, even if the QObject.connect() returns True.
>>> Clicking on buttons have no effect.
>>> Any idea?
>>>
>>> Thanks in advance.
>>>
>>> --
>>> Fabio Mauri
>>>
>>> ___
>>> PyQt mailing list    p...@riverbankcomputing.com
>>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>>
>>
>> --
>> "No trees were killed in the sending of this message. However a large number
>> of electrons were terribly inconvenienced. "
>
>
>
> --
> Fabio Mauri
>



-- 
Fabio Mauri
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] using xembed with pyqt/pykde

2010-07-28 Thread Henning Schröder
On Wed, Jul 28, 2010 at 4:17 PM, Aljoša Mohorović
 wrote:
> anybody using xembed with pyqt?
>
> Aljosa
>
I used QX11EmbedContainer to embed a terminal in PyQt. I don't know if
gvim could be used in a similar way.

Henning

# 
# -*- coding: utf-8 -*-
import atexit

from PyQt4.QtCore import *
from PyQt4.QtGui import *



class XTerm(QX11EmbedContainer):

   def __init__(self, parent, xterm_cmd="xterm"):
   QX11EmbedContainer.__init__(self, parent)
   self.xterm_cmd = xterm_cmd
   self.process = QProcess(self)
   self.connect(self.process,
SIGNAL("finished(int, QProcess::ExitStatus)"),
self.on_term_close)
   atexit.register(self.kill)


   def kill(self):
   self.process.kill()
   self.process.waitForFinished()


   def sizeHint(self):
   size = QSize(400, 300)
   return size.expandedTo(QApplication.globalStrut())


   def show_term(self):
   args = [
   "-into",
   str(self.winId()),
   "-bg",
   "#00", # self.palette().color(QPalette.Background).name(),
   "-fg",
   "#f0f0f0", #self.palette().color(QPalette.Foreground).name(),
   # border
   "-b", "0",
   "-w", "0",
   # blink cursor
   "-bc",
   ]
   self.process.start(self.xterm_cmd, args)
   if self.process.error() == QProcess.FailedToStart:
   print "xterm not installed"


   def on_term_close(self, exit_code, exit_status):
   print "close", exit_code, exit_status
   self.close()
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] using xembed with pyqt/pykde

2010-07-28 Thread Aljoša Mohorović
anybody using xembed with pyqt?

Aljosa

On Mon, Jul 26, 2010 at 3:30 PM, Aljoša Mohorović
 wrote:
> i'm trying to find a working example of a pyqt/pykde application that uses
> xembed to embed a gtk/gnome based app.
> don't know if it's important but i'm embedding gvim into a pykde app.
>
> any docs or examples are appreciated.
>
> Aljosa Mohorovic
>
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Subclassing QTableView

2010-07-28 Thread Zoltan Szalai

 Hey dom,

I think u should provide a minimal example that demonstrates the problem.

bests
Zoltan


On 7/27/2010 8:52 PM, Dom wrote:

Hi-

I've been having a problem the last few days retaining the visibility 
of selection highlighting on a table cell when the window containing a 
qtableview loses focus, I assume that to disable this I'll need to 
subclass the qtableview widget, once I've done that what attributes do 
I need to change?


Thanks

dom

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] PyQwt with PyInstaller

2010-07-28 Thread Matti Lyra
Hello.

Does someone have experience on OS X on creating an app bundle with PyInstaller 
of a project that contains a PyQwt plot. I've installed PyQt, Qt and PyQwt from 
MacPorts and it seems that there is some linker error related to 
libLAPACK.dylib. When I run the application from the command line everything is 
fine but when I make an app bundle with PyInstaller the app fails with an error 
saying that PyQt4.QtCore.so can't load library libLAPACK.dylib (referenced from 
vecLib) because an incompatible libarary version - libLAPACK provides version 
0.0.0 (this would be the libLAPACK that comes with Atlas and is installed by 
MacPorts).

Here is the script that I'm using

import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.Qwt5 import *

class MyApp (QMainWindow):

   def __init__(self, parent = None):
   QMainWindow.__init__(self, parent)
   self.setGeometry(300, 300, 250, 150)

app = QApplication(sys.argv)
ui = MyApp()
ui.show()
ui.raise_()
sys.exit(app.exec_())

The error message is as follows:

.Mactestdlopen(/path/to/Mactest.app/Contents/MacOS/PyQt4.QtCore.so, 2): 
Library not loaded: 
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib

.Mactest  Referenced from: 
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib

.Mactest  Reason: Incompatible library version: vecLib requires version 
1.0.0 or later, but libLAPACK.dylib provides version 0.0.0
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] monospaced fonts in qgraphicsscene

2010-07-28 Thread Peter Schmidtke
Hello,

I am drawing qgraphicscenes using pyqt and different elements in it. One of 
these elements is a qgrapchissimpletextitem, where I use a monospaced font 
(Courier, size 12) printing a long string with capital letters.
Below this string I'd like to show a histogram, building a qgraphicsrectitem 
for each letter of the string above. For doing this I need to well position my 
rectangles below each letter. This was possible in Linux systems, where I could 
set a exact width to each rectangle.

Now I open the whole thing in Mac OSX Snow Leopard and the monospaced font is 
not shown the same way, So I had a look into fontmetrics for this font, I used 
the charWidth function, which returns me 8 pixels for one char of Courier, 12. 
Still my rectangles below don't fit. I tried to use the width function, without 
success (returns 0). 

Basically I cannot manage to fit the width of my rectangles to the width of my 
characters of my stringdid somebody experienced the same issues. It worked 
fine on openSuse, but is a headache in Mac. 

I know that instead of using a String for the sequence I could print every 
character as seperate object, however this would overload the scene and I don't 
see the point if monospaced fonts are available. 

Thanks in advance.

Peter


On 31/05/2010, at 18:19,   wrote:

> 
> Hello,
> 
> I wonder if any standard Qt widget exists for filtering and sorting data in a 
> table view.
> 
> There are hundreds of rows in a QSqlTableModel displayed in a QTableView 
> which supposed to be interactively filtered. It would be great if there was 
> some sophisticated component for this, similar to the ones in TOAD or Pgadmin.
> 
> Thanks in advance for any suggestion.
> 
> 
> Cheers,
> Balazs  
> _
> Hotmail: Trusted email with powerful SPAM protection.
> https://signup.live.com/signup.aspx?id=60969
> ___
> PyQt mailing listPyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Peter Schmidtke

-
PhD Student
Department of Physical Chemistry
School of Pharmacy
University of Barcelona
Barcelona, Spain


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt