Re: [PyQt] VTK in PyQt

2010-03-09 Thread Matt Smith
I looked through the code and two things I see different than what I have: a. I set the size of my RenderWindow b. I keep a reference to it, which probably isn't your problem because your not getting a seg fault. I've got an example but I can't verify that it works since I don't have vtk

[PyQt] Render ps files

2010-03-05 Thread Matt Smith
Is there a way to render ps (postscript) files, to a pixmap, or QImage? Something I could display in a widget at least. thanks mbs ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Limit the height of a Layout

2010-03-03 Thread Matt Smith
You should be able to 'setMaximumHeight' you can also use the setSizePolicy and set the widgets size policy to what you want. And there is a method for QBoxLayout where you set the 'stretch factor' when you add a widget, so that certain widgets will stretch preferentially to others. Maybe you

Re: [PyQt] Segmentation fault

2010-01-17 Thread Matt Smith
Hao I don't get a segmentation fault, I get a different error: QObject::connect: Cannot queue arguments of type 'QTextCursor' (Make sure 'QTextCursor' is registered using qRegisterMetaType().) But I would suggest using a QThread instead of a Threading.thread, and then you can connect them with

Re: [PyQt] qthread and connections

2010-01-10 Thread Matt Smith
Okay I've figured out a way to make this work. For my QThread's run function I create a new object, then any connections made to that object will be evaluated in the thread that is was created in. Its taken me a bit to post this because I wrote a similar test in c++. Which I found the same

[PyQt] qthread and connections

2010-01-07 Thread Matt Smith
If I have a QThread how do I connect signals to it so that it receives signals and the slot is executed in a separate thread. My understanding is that if I call a QThread.exec_() then I start that thread's event loop. A signal that is connected to the thread should be evaluated during that

[PyQt] Small Project Proposal: file upload client

2009-12-21 Thread Matt Smith
I have a small project I am going to try involving large file uploads. I want to make a small pyqt application that would enable large file uploads via http post requests of smaller chunks. Part of the reason I am posting it here is because of releasing. I have access to windows computers so I

Re: [PyQt] Next Releases of PyQt and SIP

2009-09-08 Thread Matt Smith
if that makes a difference. mbs On Tue, 2009-09-08 at 08:15 +0100, Phil Thompson wrote: On Mon, 07 Sep 2009 20:44:13 -0400, Matt Smith mel...@orangepalantir.org wrote: The long and short, when I use a QThread at the end of my run method, I call self.deleteLater(). If I call self.deleteLater

[PyQt] List Widgets, adjustable

2009-04-11 Thread Matt Smith
Okay, I've got two QListWidgets in a frame with an HBoxLayout. I was looking for some suggestions to make the width of the two widgets adjust-able. Ideally I would like to be able to grab the space between the widgets with the mouse and move it to adjust the way that the available space is

Re: [PyQt] New Style emit without subclassing

2009-04-08 Thread Matt Smith
Thats not quite what I'm getting at. That will emit the signal, which is the 'old style' but the new style is a bit different, and after you set it up you emit the signal by using: mysignal.emit(args) My question is that the only way I know how to make a 'new style' signal emittable is

[PyQt] QSVGWidget load method, python3

2009-03-29 Thread Matt Smith
Okay I was playing around with python 3 and I found that the SVGWidget gives me a 'file not found error' when I use either the method #new data is a QString svg file serialized_data = newdata.toLocal8Bit() self.load(serialized_data) or if I use a connect statement, self.connect(self,

[PyQt] Re: dragging a QGraphicsSvgItem

2009-03-18 Thread Matt Smith
On Wed, 2009-03-18 at 09:15 +, pyqt-requ...@riverbankcomputing.com wrote: From: Wolfgang Rohdewald wolfg...@rohdewald.de Subject: [PyQt] dragging a QGraphicsSvgItem To: pyqt@riverbankcomputing.com Message-ID: 200903180430.09934.wolfg...@rohdewald.de Content-Type: text/plain;

Re: [PyQt] linking listwidget with Qgraphicsview

2009-03-11 Thread Matt Smith
Okay I wrote a short script, the code you sent is missing the connection, plus I don't know what addPixmap is, so here is a small version of what I think you are trying to do. If you aren't sublcassing the QGraphicsView, you can do the same thing I am doing via the .scene() to get the

Re: [PyQt] linking listwidget with Qgraphicsview

2009-03-10 Thread Matt Smith
From the looks of it your list widget has the name of the file you want to open and display so what you can do is connect the signal being emitted, itemClicked(QListWidgetItem *), and then get the text from the item passed with say my_list_item.text(). From that you should be able to make a

Re: [PyQt] PyQt SIP Release Plans

2009-03-10 Thread Matt Smith
I wonder what you mean by crash I had a similar problem passing a QMouseEvent, when I upgraded I needed to use QMouseEvent with the ampersand. When it didn't work I would get the last event, so sometimes I would get a QTimer instead of a mouse event, but once I put the '' in it worked ok. mbs

Re: [PyQt] PyQt SIP Release Plans

2009-03-10 Thread Matt Smith
Okay, I've got the latest PyQt, and I built it using the latest Qt4.5 so now I wanna know, how do I put plugins into a webview? is that supported yet? thanks mbs ___ PyQt mailing listPyQt@riverbankcomputing.com

[PyQt] Change in QMouseEvent passed through a signal

2009-03-08 Thread Matt Smith
Okay this is probably more of me getting bit by not using the correct signatures, but the behavior has changed from my 4.4 installation to my 4.5 (PyQt-x11-gpl-4.5-snapshot-20090304, Ill probably recompile it today) when I would pass a mouse event as an emitted signal this worked,

[PyQt] QSpacerItem causes seg fault

2009-03-07 Thread Matt Smith
while using: PyQt-x11-gpl-4.5-snapshot-20090304 on: Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 If I don't keep a persistent reference to a spacer Item I get a segfault. This is a new event since upgrading from 4.4 to

[PyQt] Re: Qt 4.5 and PyQt 4.5 for Ubuntu Hardy

2009-03-05 Thread Matt Smith
Have you tried to build them, I am using hardy, I downloaded sip 4.8 and pyqt 4.5 snapshots, it built find without any errors. I'm not sure what dependencies I have previously installed but it is quite trouble free process. If you are doing it for the first time you might want to use the 4.4

RE: [PyQt] QMainWindow: adding dock widgets

2009-02-27 Thread Matt Smith
in the way to do this if one exists. Rui -Message d'origine- De : pyqt-boun...@riverbankcomputing.com [mailto:pyqt-boun...@riverbankcomputing.com]de la part de Matt Smith Envoyé : mardi 24 février 2009 00:04 À : pyqt@riverbankcomputing.com Objet : [PyQt] QMainWindow: adding dock

[PyQt] QMainWindow: adding dock widgets

2009-02-23 Thread Matt Smith
When I add dock widgets to my main window if they become to large it pushes the bottom of my screen too low. Is there a way to make them, add as tabs when there isn't room? thanks mbs ___ PyQt mailing listPyQt@riverbankcomputing.com

[PyQt] QSvgRenderer, setCurrentFrame

2009-02-19 Thread Matt Smith
I was playing around with the SvgRenderer and I found if I did setCurrentFrame(some_numer) I was immediately put on the last frame, and the frame wouldn't change. The repaintNeeded() signal was still being emitted. I am merely curious I probably will work with graphics scene in the end but svg

Re: [PyQt] set qlineedit red, easy??

2009-02-05 Thread Matt Smith
You could use the palette. MyLineEdit.palette().setColor(QtGui.QPalette.Base,QtGui.QColor('red')) mbs On Thu, 2009-02-05 at 12:00 +, pyqt-requ...@riverbankcomputing.com Le 5/2/2009, Knapp magick.c...@gmail.com a crit: I have a qlineedit that I want to turn the background red when the

Re: [PyQt] set qlineedit red, easy??

2009-02-05 Thread Matt Smith
I not use .parent() to make connections? thanks mbs On Thu, 2009-02-05 at 13:11 +, Phil Thompson wrote: On Thu, 05 Feb 2009 07:50:57 -0500, Matt Smith mel...@orangepalantir.org wrote: You could use the palette. MyLineEdit.palette().setColor(QtGui.QPalette.Base,QtGui.QColor('red

[PyQt] Worker Thread

2009-02-04 Thread Matt Smith
It seems like your worker thread should start, I don't really like how you've set it up, but I think it should start, so I am going to suggest that pow is too much for it. Ie it is taking all of the resources your application gets. Really what you should do in that case is use multiprocessing.

[PyQt] Newbie with a circular problem calling problem

2009-02-04 Thread Matt Smith
Have you noticed that QLineEdit emits a signal textEdited which is not emitted when the text is changed with setText. http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qlineedit.html#textEdited and spin boxes emit the following

Re: [PyQt] Newbie with a circular problem calling problem

2009-02-04 Thread Matt Smith
other suggestions.) As a final option you could change the event handlers. mbs On Wed, 2009-02-04 at 21:11 +0100, Knapp wrote: On Wed, Feb 4, 2009 at 5:40 PM, Matt Smith mel...@orangepalantir.org wrote: Have you noticed that QLineEdit emits a signal textEdited which is not emitted when

Re: [PyQt] Two base classed inherit QWidget

2009-02-02 Thread Matt Smith
Could someone explain to me, how is that possible and why it works: class A(QWidget): def __init__(self): QWidget.__init__(self) class B(QWidget): def __init__(self): QWidget.__init__(self) class C(A, B): def __init__(self): A.__init__(self)

Re: [PyQt] QSpinBox and setLineEdit

2009-01-30 Thread Matt Smith
On Fri, 2009-01-30 at 14:55 +0100, Mads Ipsen wrote: import sys from PyQt4 import QtCore, QtGui def foo(text): print 'valueChanged():', text if __name__ == __main__: app = QtGui.QApplication(sys.argv) spin_box = QtGui.QSpinBox() line_edit = spin_box.lineEdit()

Re: [PyQt] QSpinBox and setLineEdit

2009-01-30 Thread Matt Smith
On Fri, 2009-01-30 at 16:00 +0100, Mads Ipsen wrote: Yes, this will do the trick provided that the function you connect to does not take to long to update. In that case the spin box jams or locks and does several increments of its value. This is exactly why I want to connect to the lineedit

Re: [PyQt] QSpinBox and setLineEdit

2009-01-30 Thread Matt Smith
Yes, this will do the trick provided that the function you connect to does not take to long to update. In that case the spin box jams or locks and does several increments of its value. This is exactly why I want to connect to the lineedit since this is first updated once the function you

Re: [PyQt] QThread, suggestions.

2009-01-29 Thread Matt Smith
in a separate process, there is no global interpreter lock. Way, way, way better than threading for a lot of cases. If it crashes, the main program doesn’t go down. Brian On 1/27/09 2:01 PM, Matt Smith mel...@orangepalantir.org wrote: In java they have the SwingWorker class

[PyQt] Odd QImage behavior

2009-01-28 Thread Matt Smith
I am constructing QImages from numpy arrays and I use the lines: nimage = QtGui.QImage(total.data,w,h,QtGui.QImage.Format_Indexed8) nimage.ndarray = total nimage.setColorTable(COLORTABLE) If the shape of total is (h,w) this occasionally works. This will fail if the shape of the image is an odd

[PyQt] QThread, suggestions.

2009-01-27 Thread Matt Smith
In java they have the SwingWorker class and I thought of a way to implement something similar in python. Here is the code: http://paste.pocoo.org/show/101578/ I use this for starting long running processes. Here is an example of how I have used it.

Re: [PyQt] QImage, transparent.

2009-01-20 Thread Matt Smith
El 19/01/2009, a las 21:20, Matt Smith escribi: I want to be able to draw lines on an image, without modifying the image. More specifically I want two images one with the lines and then the original image below it. Can somebody recommend some classes, preferable I would like

[PyQt] QImage, transparent.

2009-01-19 Thread Matt Smith
I want to be able to draw lines on an image, without modifying the image. More specifically I want two images one with the lines and then the original image below it. Can somebody recommend some classes, preferable I would like to use 2 QImages, but I don't know if I can display one on top of

[PyQt] PyQt: colorTable, grayscale

2009-01-18 Thread Matt Smith
I'm working on some image analysis, and displaying the result. One of the problems I have is grayScale. I don't mind using 8bit for display, but is there a default grayScale color table? I suppose I could make one, but it would be nice to import one. Also I loaded a tiff image with 16 bit gray

[PyQt] PyQt: Internet rendering

2009-01-12 Thread Matt Smith
Recently I've become exposed to Silverlight or the moonlight version for linux. I was curious if there is any plans on supporting it with QWebKit. The main idea that I like is the possiblity of writing the code in python to develop flash/java applet type programs, but as of now that is not

[PyQt] Re: [newb] simple example of file selection (Neal Becker)

2008-12-20 Thread Matt Smith
Is there a simple example of a form including a file selection widget? Would this be pure qt, or a kde thing? I'm not sure what you mean by 'form' but if you want to select a file you can use a QFileDialogue. http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qfiledialog.html

Re: [PyQt] QThread problem

2008-12-08 Thread Matt Smith
I'm going to throw this out there, you should exchange information via signals/slots. When you get a cancel use terminate() slot. That will stop it from freezing you program from the looks of it. ___ PyQt mailing listPyQt@riverbankcomputing.com

[PyQt] QProcess

2008-12-02 Thread Matt Smith
Hello i have a little problem. If i start the process like the sample all work: pr = QtCore.QProcess() pr.start('python /my_dir/pippo.py') but if i compile the pippo.py and i obtain an executable that i run with ./pippo how i have to do fur run it with qprocess? I have try with

[PyQt] connecting signals

2008-11-27 Thread Matt Smith
There is a lot of leeway in connecting signals, so I was curious about how other people are doing it. I have a widget layout similar to this. MainWindow Menu CentralWidget TabBar StackedWidget Graph Calculator InputWidget Everything above is a widget, and the menu

[PyQt] Signals, QStrings

2008-11-26 Thread Matt Smith
Here is a basic question because I am not so familiar with cpp. Whats the difference between: emit(SIGNAL(mySignal( QString )),myQstring) emit(SIGNAL(mySignal( const QString)),myQstring) and more importantly, which one should I use? thanks mbs ___

[PyQt] PyQt unexpected behavior

2008-11-09 Thread Matt Smith
I initiated a widget twice, by accident, and it caused some cpu issues in windows when I close the program. I was wondering if there could be an error/warning, because otherwise the program ran perfectly fine. class MyWidget(QWidget): def __init__(self, parent=None):

Re: [PyQt] PyQt, QSVGWidget background color

2008-11-05 Thread Matt Smith
Ammendium, The suggested: pal.setColor(QPalette.Window,QColor('white')) Has the desired effect on a TabWidget, so I think what is happening is that a widget doesn't paint its own background if it is in another widget. By setting widget.window(), it will go find the widget that does paint the

[PyQt] PyQt, QSVGWidget background color

2008-11-04 Thread Matt Smith
Okay, I made a graphing tool. Works great, somebody suggested that the background should be white. No problem...I took the widget, widget.palette().background().setColor(QColor('white')) and it turned white. But that turned the background of every widget in the main window white too. Is

Re: [PyQt] Key return

2008-11-02 Thread Matt Smith
Date: Sat, 1 Nov 2008 18:46:29 +0100 From: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: [PyQt] Key return To: pyqt pyqt@riverbankcomputing.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 Hello i need that when i press the Return key, one button intercept

[PyQt] PyQt4 QComboBox, open upwards by default

2008-10-30 Thread Matt Smith
I've worked for awhile without anything conclussive. I want a QComboBox that opens upwards by default. Right now if I open the list it will drop down, below its parent widget, but if I place the whole application near the bottom of the screen it will pop upwards. I want it to pop upwards by

Re: [PyQt] Waiting on non-QT events.

2008-10-08 Thread Matt Smith
Okay I looked at the example: http://pastebin.com/f16019559 and it appears that Bridge is a little bit unnecessary when you could just emit the signal from your QThread as it is?. So I tried to make an example following what you did; http://pastebin.com/m192d4d3f That brings me to a

[PyQt] Waiting on non-QT events.

2008-10-06 Thread Matt Smith
I have written an app for checking my email, and it laggs when I am downloading from the server and I am curious how to avoid this. The general layout is EmailWidget (Qwidget with a layout) .ImapTool .MessageList(QlistView) .MailBoxList(QlistView) def

[PyQt] QtWebKit .... printing

2008-09-29 Thread Matt Smith
Hello I am having some trouble printing. As this is my first post I will omit the code, but the problem is this, when I print from a QWebView the printer crashes, if I have it write a pdf file, the pdf file looks great, but the printer crashes when I print that file with lpr. On the other