Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
865 Topics 3.4k Posts
  • Ubuntu: Failed update of PySide

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to implement mouse gesture by python or pyqt ?

    5
    0 Votes
    5 Posts
    8k Views
    jazzycamelJ
    I am aware of the existence of QGesture, QGestureRecognizer etc., the example (and my Python port) probably predates this framework, I did create it sometime ago and only refreshed it in response to your original request for an example. In response to your subsequent request I have created an example with almost equivalent functionality using the newer methods. As before, it can be found on my blog "here":http://www.gulon.co.uk/2013/01/14/pyqt4-mouse-gestures-part-deux/.
  • C++ updating data to QML

    5
    0 Votes
    5 Posts
    8k Views
    W
    Do N3Roaster said. From "http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-exposecppattributes.html":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-exposecppattributes.html For maximum interoperability with QML, any property that is writable should have an associated NOTIFY signal that is emitted whenever the property value has changed.
  • QML/C++ bindings

    5
    0 Votes
    5 Posts
    7k Views
    W
    thanks, that was it!
  • PySide translations work just partially

    2
    0 Votes
    2 Posts
    2k Views
    J
    Yay! I finally managed to find the reason for the problem. Using a python multi-line text without indentation confuses the Qt translation system so that the following translations won't work. E.g. @ def some_method(self): self.tr('This text gets translated correctly') def get_info(self): info_text = """<h1> My Program v. 1.0 </h1> <br> <br> This multi-line text is not meant to be translated, but it breaks the translations from the following tr() calls. """ return info_text def another_method(self): self.tr('This text is not translated anymore because of the mutli-line text in method get_info.') @ Should I add this issue to PySide bug tracker? (I don't have bug tracker account yet).
  • [Solved]Mysql Driver not loaded Driver not loaded

    4
    0 Votes
    4 Posts
    3k Views
    P
    @redstoneleo, Post you solution if its solved. So it may help others.
  • List/TreeWidget vs. List/TreeView?

    2
    0 Votes
    2 Posts
    9k Views
    H
    Views works on model, widget versions works on inserted items. Read "Model View programming":http://qt-project.org/doc/qt-4.8/model-view-programming.html
  • Installing pyside and python 3.x

    2
    0 Votes
    2 Posts
    4k Views
    3
    Ok, so ... I finally got it to work. I ended up using @brew install pyside@ Although there were a few things I still had to link up to make it work, overall it was not too painful. But now that I have it up and running I cant wait to try things out. :)
  • PyQT : are sprites available ?

    2
    0 Votes
    2 Posts
    2k Views
    D
    You could take a look at the Graphics View examples provided with PyQt to see if there's anything that looks like it might be useful.
  • 0 Votes
    3 Posts
    6k Views
    A
    This worked great! Thanks so much.
  • QtJambi: update Widget from a test

    2
    0 Votes
    2 Posts
    2k Views
    D
    call QApplication.processEvents(); before going to sleep() that should get you what you want, but it is not a good idea to ever wait/sleep during the startup sequence. This being the point between calling initialize() and exec(). You want to call exec() as soon as possible to perform all other behaviour in response to eventing. So this means setting up the first state but never calling Thread.sleep() but using eventing instead. One way to do this maybe to make use of QObject.startTimer(int) to get a callback to the method QObject#timerEvent(QTimerEvent). So you subclass QObject and implement the @Override method and this replaces the Thread.sleep() usage with no need to ever call it. There are other Qt ways such as using a QTimer object and connecting the slot to a callback method of your choice that cycled through the states and changes UI, sets up QTimer for the next (or stops it) and immediately returns.
  • Memory Management in Qt/C++

    8
    0 Votes
    8 Posts
    5k Views
    G
    [quote author="Gerolf" date="1355228848"]e.g. in Main, you can create the widgets on the stack. If you have top level QObjects elsewhere where the stack is not possible, use smart pointers like shared pointers or others.[/quote] Hi Gerolf, Will you please give me some example related this to study because everything which is related to memory leak is going over my head. So it would be nice to have some example to go through and then decide how to about memory leaks.
  • Linking problem with C static Library

    4
    0 Votes
    4 Posts
    2k Views
    F
    What about the C-Library header file? You may need the 'external "C" {};' declaration for the methods provided in pure C like this: @ #ifdef cplusplus external "C" { #endif void C_method1(void); #ifdef cplusplus }; #endif @
  • 0 Votes
    3 Posts
    2k Views
    N
    Stupid error in my code where I, myself, on my own, disable my own widgets by setting inhibit_edit to True. Sigh... I need a bit of a lie down :)
  • How to Fullscreen the child widget

    3
    0 Votes
    3 Posts
    6k Views
    jazzycamelJ
    The following is a basic working example of what I think you're trying to do. It also hides the lower controls (sliders and buttons) in full screen mode like a media player would (just delete line 55 to prevent this): @ from PyQt4.QtCore import * from PyQt4.QtGui import * class BlackWidget(QWidget): doubleClick=pyqtSignal() def __init__(self, parent=None, **kwargs): QWidget.__init__(self, parent, **kwargs) def paintEvent(self, e): p=QPainter(self) p.fillRect(self.rect(), Qt.black) def mouseDoubleClickEvent(self, e): self.doubleClick.emit() class Widget(QWidget): def init(self, parent=None): QWidget.init(self, parent) self.resize(640,480) self._fullScreen=False l=QGridLayout(self) blackWidget=BlackWidget(self, doubleClick=self.changeScreenSize) l.addWidget(blackWidget, 0, 0, 1, 4) self._controls=[] slider1=QSlider(Qt.Horizontal, self) self._controls.append(slider1) l.addWidget(slider1, 1, 0, 1, 4) button1=QPushButton("Button 1", self) self._controls.append(button1) l.addWidget(button1, 2, 0) button2=QPushButton("Button 2", self) self._controls.append(button2) l.addWidget(button2, 2, 1) button3=QPushButton("Button 3", self) self._controls.append(button3) l.addWidget(button3, 2, 2) slider2=QSlider(Qt.Horizontal, self) self._controls.append(slider2) l.addWidget(slider2, 2, 3) @pyqtSlot() def changeScreenSize(self): self.showNormal() if self._fullScreen else self.showFullScreen() for c in self._controls: c.setVisible(self._fullScreen) self._fullScreen^=True if name=="main": from sys import argv, exit a=QApplication(argv) w=Widget() w.show() w.raise_() exit(a.exec_()) @ Hope this helps ;o)
  • [SOLVED]Login dialog ?

    10
    0 Votes
    10 Posts
    7k Views
    Y
    c++ using qt.
  • QPalette VS stylesheet

    2
    0 Votes
    2 Posts
    3k Views
    R
    Stylesheets are usually quicker/simpler to use and offer more control than QPalette. In the future, could you please not write your questions in that SMS style but in plain old English? This will for sure help you get some answers. At first I did not even want to reply since your post was so hurtful to read.
  • PySide: How to get Back button in QWizard?

    3
    0 Votes
    3 Posts
    3k Views
    A
    There is a back button in Aero style, only it is shaped like a blue round arrow at the top left of the wizard. That is just how it is done in Aero...
  • [Solved] PySide: passing data from QML to Python

    2
    0 Votes
    2 Posts
    4k Views
    T
    I figured it out. I forgot to specify the slot's argument type. Fixed it by changing the slot's declaration to this: @@QtCore.Slot('QString') def printText(self,text): print text@
  • [PyQt] Fingerprint Reader Integration

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied