I think this is solution of your problem:
from PySide.QtGui import *
ImportError: /usr/local/lib/python2.7/site-packages/PySide/QtGui.so: Undefined symbol "_ZN9QGtkStyle11qt_metacastEPKc"
The current solution is to rebuild py-gui after changing your /etc/make.conf to include:
QT4_OPTIONS += QGTKSTYLE
The (partial) solution was this:
This ensures that individual items handle their own events, it seems that before the group was capturing them.
I still have a problem in that my GraphicsView overrides the mouseMoveEvent, and when enabled, no events get propagated to scene items.
Woops, I found the reason by myself...
@class myClass(anotherLib.originalClass, QtCore.QObject):
Adding the QObject parent class and calling it during the init
[quote author="pmcfrack" date="1300306178"]I know this is a rather old post, however, this is the exact problem I am trying to work around. Here is a link to my question: http://developer.qt.nokia.com/forums/viewthread/4402/#26159
Does anyone have a work around for this?
Perhaps you should start responding in that thread then again? It is not like you did not get any reactions there...
This QtWui looks like stuff you build on server and then you use it with normal browser? I don’t really get the benefit of this framework... Or is it something like Rails? Its website doesn’t really tell.
OTOH Jambi is Qt bindings for Java. But because it is Java, it should be possible to use Jambi in applets and JNLP stuff. If you are just wanting to write something for web server, you’re most likely better off with Qt/cpp, since you already know it.
[quote]That's why editing headers is difficult :-)[/quote]
Oey, In the back of my mind I was thinking the same thing.
Aside from a custom widget (have yet to figure out painting),
editing works if passing header information into an external dialog.
Not exactly what I intended for the user, but it works :)
Thank you for your kind help.
Great work! I'm looking forward for the final release!
However, as the project is sponsored by Nokia, to provide Python support for mobile phones (I read it somewhere on the project's website), will there be any repercussion on the project? (Reference to http://blog.qt.nokia.com/2011/02/14/update-on-qt/, for example.) I didn't read anything about it...
The last release was at January 21th, this new yesterday juts 13 days after, because our "sprint " is in the end and we fixed the planned bugs faster than we thought, and all task as done 2 days earlier. :D
Working hard to get 1.0.0 ASAP. :D
Thanks, it worked! I was using img.tostring() (from OpenCV), that is why I didn't think that it is going to be garbage collected and I didn't suspect that Qt is so smart to use the same memory instead of allocating and copying. Thanks again!
Thanks for your help.
I managed to find my problem. I actually need to accept dragMoveEvent which is the type of Drag action that emit a TextBrowser when you drag and drop a file from your desktop onto your QTextBrowser.
For information (action 2)
Just by adding the following code it work well.
def dragMoveEvent(self, inEvent):
Need to accept DragMove to catch drop for TextBrowser
a nice blind guess!
if someone else wants to do the same, or is searching for an example:
imagen64 = open('call.base64','r').read()
imagen = QtGui.QImage()
bytearr = QtCore.QByteArray.fromBase64( imagen64 )
imagen.loadFromData( bytearr, 'PNG' )
self.label.setPixmap( QtGui.QPixmap.fromImage(imagen) )
call.base64 is a file containing the base64 string with no CR nor LF, with a string of length:1888
encoded using php:
$imgfile = "call.png";
$handle = fopen($imgfile, "r");
$imgbinary = fread(fopen($imgfile, "r"), filesize($imgfile));
$fw = fopen('call.base64', 'w');
from PySide import QtCore, QtGui
I think i don't use it properly because with PyQt and the following code :
from PyQt4 import QtGui
fid = open('/tmp/buffer.out','r')
stringBuffer = fid.read()
img1 = QtGui.QImage(640,440, QtGui.QImage.Format_ARGB32)
--> this make an empty png file*
img2 = QtGui.QImage(stringBuffer,640,440, QtGui.QImage.Format_ARGB32)
--> this make a good png file with my figure
Any idea how to use loadFromData in the good way so that i can reproduce with pyside??
Hmm, the preview worked ok but evidently something decided to trash half of that line of code. Anyway, I've tried the new form for slots. This does indeed look better in that at least it is a real type that you need to specify for the arguments rather than a string. So I have a subclass of QTableView, and in that I now have:
from PySide import QtCore # well, this is at the top of the module
And now I am getting the error (which does not look good!):
TypeError: 'PySide.QtGui.QTableView.currentChanged' called with wrong argument types:
You should follow the Tobias suggestion, having a solid C++ background is pretty useful when learning Qt.
Probably you already know it but, the "Thinking in C++":http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html is a great book that you can get download for free.
Anyway the Qt Object Model is a subject on its own, that needs its own explanation, a nice one (with pretty figures :D), is in the L2 "Presentation with notes" of the "Qt Learning material":http://qt.nokia.com/services-partners/qt-in-education/qt-in-education-course-material, altough this material is intended to be used for teaching Qt I think it's clear enough even for the beginners.
And if you're looking for more detailed explanations check the "Qt eLearning videos":http://qt.nokia.com/developer/learning/elearning, specially the "Qt Training modules":http://qt.nokia.com/developer/learning/online/training/modules your question is answered in the "Objects int Qt" ones.
The fact that QCoreApplication behaves somewhat like a Singleton is bugging me. Although it is obviously sensible to have only one instance of a QCoreApplication around, I can't help but feel that there would be a much more reasonable way to make this work. I mean, if I want to try and drive two cars at the same time, it's the police who will try to stop me, not the car.