Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
865 Topics 3.4k Posts
  • How can I bind a functor WITH a receiver?

    2
    0 Votes
    2 Posts
    943 Views
    T
    I read source code, and I think there is a way if I can modify Qt header files. But is there any solution without header files modified? I use this feature for my Lua-binding project at : https://github.com/tdzl2003/luaqt
  • 0 Votes
    2 Posts
    1k Views
    R
    Hello people, my first question: is a good solution the creation of the QList class like a wrapper of the Python list? @class QList: def init(self): self.l = [] def append(self, e): self.l.append(e) def at(self, i): return self.l[i] def prepend(self, e): self.l.insert(0, e) def size(self): return len(self.l) @
  • Is deleteLater() necessary in PyQt/PySide ?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Pyside + Requests + Multiprocessing ... strange behavior

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • PyQt connect works on Windows but not on Linux

    1
    0 Votes
    1 Posts
    927 Views
    No one has replied
  • PySide 1.2.1 compilation problem in samplebinding

    3
    0 Votes
    3 Posts
    2k Views
    R
    I found it. @__STDC__@ should be #defined as "1", not empty. I posted a bug report at https://bugreports.qt-project.org/browse/PYSIDE-206 .
  • PySide QGLWidget returned as QWidget, grabFrameBuffer() alternative ?

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    3 Posts
    2k Views
    K
    Closed for duplication
  • How to use .net or Java api within Qt windows application?

    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    Great ! You're welcome ! Please also update the thread title prepending [solved] so other forum users may know a solution has been found :)
  • Embedded code in C, harness in Qt C++ delivering QTimer

    2
    0 Votes
    2 Posts
    2k Views
    A
    If I use this in the C library's .pro: @TARGET = main_AutroKeeper_Qt_PlainC # LIB TEMPLATE = lib # LIB CONFIG += staticlib # LIB@ and in the lib header file: @#ifdef __cplusplus extern "C" { #endif extern void main_AutroKeeper_Qt_PlainC (void); #ifdef __cplusplus } #endif@ and this in the C++ system's .pro that would use the lib above: @INCLUDEPATH += D:...\build-autrokeeper_Qt_plainC-AutroKeeper-Debug\debug DEPENDPATH += D:...\build-autrokeeper_Qt_plainC-AutroKeeper-Debug\debug LIBS += -LD:...\build-autrokeeper_Qt_plainC-AutroKeeper-Debug\debug -lmain_AutroKeeper_Qt_PlainC TEMPLATE = app@ then C++ compiles and links and runs my C library. This included help from "http://stackoverflow.com/questions/10870145/qt-creator-using-external-libraries-within-my-own-library" plus a collegue. Obs no end '' in the paths to dirs. Was this ok? Now Q3 and QTimer are left. Since I have posted these questions, I feel obliged to tell if I solve it here? Is this etiquette here?
  • Load .UI files in PySide

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • PyQt QDialog.show() doesn't work because of thread suspension

    2
    0 Votes
    2 Posts
    8k Views
    jazzycamelJ
    The following example should do what you want: @ from PyQt4.QtCore import * from PyQt4.QtGui import * class Dialog(QDialog): def init(self, parent=None, **kwargs): QDialog.init(self, parent, **kwargs) l=QVBoxLayout(self) l.addWidget(QLabel("Waiting...", self)) l.addWidget(QProgressBar(self, minimum=0, maximum=0)) class MainWin(QDialog): def init(self, parent=None, **kwargs): QDialog.init(self, parent, **kwargs) l=QVBoxLayout(self) l.addWidget(QLabel("Ready!", self)) class WasteCPUTime(QObject): finished=pyqtSignal() @pyqtSlot() def waste(self): self._timer=self.startTimer(10000) def timerEvent(self, event): self.finished.emit() if name=="main": from sys import argv, exit a=QApplication(argv) d=Dialog() d.show() m=MainWin() w=WasteCPUTime() t=QThread(started=w.waste) w.finished.connect(t.quit) t.finished.connect(m.show) t.finished.connect(d.hide) w.moveToThread(t) t.start() exit(a.exec_()) @ Generally speaking, its better to create an object with the functionality you require and move it to a QThread than it is to sub-class QThread directly. Also, this example uses signals and slots to communicate between threads rather than referencing the objects directly which I think is the cause of your issues. Also, you may want to look at "QSplashScreen":http://pyqt.sourceforge.net/Docs/PyQt4/qsplashscreen.html. Hope this helps ;o)
  • QPainter in PyQt

    6
    0 Votes
    6 Posts
    8k Views
    SGaistS
    Hi, My PyQt is a bit rusted but IIRC you need something like: @ paint = QPainter(self) @ Otherwise you are trying to paint on nothing so it won't work. Hope it helps
  • PySide QEvent post crash

    2
    0 Votes
    2 Posts
    2k Views
    I
    I initially ran into the same ugly crash when I was converting the 'Events, Transitions, and Guards' example from Qt Project's excellent State Machine Framework doc to PySide. Your global reference to the registered QEvent Type fixes the crash problem because it prevents python's automatic garbage collection from kicking in before you want it to. In my final code, rather than using a global reference which is inelegant, I wrap all the functionality into a QWidget which is used as the main window of the app. That allows me to save the registered QEvent as an instance variable in the QWidget's class constructor. The idea being that python knows not to garbage collect instance variables as long as the class instance itself is being used.
  • PyQt5, Qt5.1.1, ASSERT failure in QVector

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Need help QTreeWidget in Pyside

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • App without main window - with many widgets showing one by one

    5
    0 Votes
    5 Posts
    4k Views
    H
    Thank you guys for your answers! I solved this by adding two lines (for sure it works, but is it OK?:): @# -- coding: utf-8 -- from PyQt4 import QtCore, QtGui from start_window import Ui_Form from second_window import Ui_Form as Ui_Form_Second class StartForm(QtGui.QWidget): def init(self, parent=None): QtGui.QWidget.init(self, parent) self.ui = Ui_Form() self.ui.setupUi(self) self.child_windows = None # this one self.ui.pushButton.clicked.connect(self.button) def button(self): secondWindow = SecondForm() secondWindow.show() self.child_windows = secondWindow # this one self.hide() class SecondForm(QtGui.QWidget): def init(self, parent=None): QtGui.QWidget.init(self, parent) self.ui = Ui_Form_Second() self.ui.setupUi(self) if name == "main": app = QtGui.QApplication(sys.argv) myapp = StartForm() myapp.show() sys.exit(app.exec_())@ I am just wondering if this approach doesn't leave any garbages in memory, like closed forms? I ma not using QWizard because this is going to be something more than widget with "Next" and "Previous" buttons. Nor QStackedWidget since, at some point, I want to have more than one visible widget at a time.
  • From where to download LibQxt for Python/PyQt4

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Where is the current API of PySide

    4
    0 Votes
    4 Posts
    2k Views
    A
    Can someone tell what to do after cloning? How to build the documentation?
  • QTreeView, QAbstractItemModel and refreshing view

    6
    0 Votes
    6 Posts
    4k Views
    SGaistS
    Then maybe layoutChanged would be more appropriated