Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
853 Topics 3.3k Posts
  • 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
  • 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
    1k Views
    A

    Can someone tell what to do after cloning? How to build the documentation?

  • 0 Votes
    6 Posts
    4k Views
    SGaistS

    Then maybe layoutChanged would be more appropriated

  • 0 Votes
    8 Posts
    8k Views
    SGaistS

    It's not on the model, it's on the QTableView.

    You have to code the connection yourself e.g. in your widget constructor

  • 0 Votes
    1 Posts
    684 Views
    No one has replied
  • 0 Votes
    1 Posts
    630 Views
    No one has replied
  • 0 Votes
    3 Posts
    2k Views
    JKSHJ

    Hi,

    I've never combined .NET with Qt before, but have a look at http://qt-project.org/doc/qt-5.1/activeqt/activeqt-index.html -- all the ActiveQt documentation can be reached through there.

    In particular, try:
    http://qt-project.org/doc/qt-5.1/activeqt/qaxwidget.html
    http://qt-project.org/doc/qt-5.1/activeqt/activeqt-dotnet.html

  • 0 Votes
    2 Posts
    2k Views
    S

    For what is worth this issue seems to be solved after upgrading to PySide 1.2.1.

  • 0 Votes
    1 Posts
    972 Views
    No one has replied
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    2 Posts
    1k Views
    T

    Just for future reference to anyone who runs across this I ended up going with my current solution. QGraphicsScene is very optimized and seems to do a good job of not bothering with redrawing obscured objects. This approach also allowed me to do some other things visually that would have been much more difficult to implement otherwise.

  • 'QtCore4.dll' not found

    2
    0 Votes
    2 Posts
    1k Views
    SGaistS

    Hi,

    Did you follow the "deployment documentation":http://qt-project.org/doc/qt-4.8/deployment-windows.html ?

  • Fail to import icons_rc with Python 3.3

    2
    0 Votes
    2 Posts
    2k Views
    R

    you'd better not move it.Each time when you run your program ,the current folder is always the one that the start file lives in.

  • I've translated QT Creator in Italian

    9
    0 Votes
    9 Posts
    2k Views
    O

    ok, SGaits thanks for your explanation

    I followed the "UncleZio" suggestions

    ciaooo

  • Automatic Wrapper using Qt

    2
    0 Votes
    2 Posts
    889 Views
    sierdzioS

    What do you want to wrap?