Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
860 Topics 3.4k Posts
  • This topic is deleted!

    Locked
    2
    0 Votes
    2 Posts
    18 Views
  • 0 Votes
    2 Posts
    2k Views
    SGaistS

    Hi,

    PyQt is a library providing python Qt bindings for python, that means you can write python application with e.g. Qt GUI.

    QtScript is a (now deprecated) official module from Qt providing javascript style scripting capabilities that is replaced by the QtQml module.

    QtLua is a external Qt module written to provide Lua scripting capabilities to Qt applications.

    Hope it helps

  • 0 Votes
    2 Posts
    1k Views
    M

    It appears that at least one person is trying to resurrect PySide in a new github repo.

  • QML Button & ListModel

    5
    0 Votes
    5 Posts
    2k Views
    p3c0P

    @Marine93 Well then you need a SortFilterProxyModel. It is based upon C++ QSortFilterProxyModel class. About the working you can find in this blog post. It shows for TableView but it will work for ListView too. Basically it will for those views which uses ListModel. You can find examples in Qt installed directory on your system too under quick directory.

  • ActionScript 3.0 to Qt

    1
    0 Votes
    1 Posts
    779 Views
    No one has replied
  • 0 Votes
    2 Posts
    2k Views
    SGaistS

    Hi and welcome to devnet,

    For licensing related question, you should contact The Qt Company directly. You should find the licensing texts directly in the sources

  • 0 Votes
    1 Posts
    744 Views
    No one has replied
  • PyQt slot return value

    3
    0 Votes
    3 Posts
    9k Views
    M

    @pyqtSlot( result = str ) is only for the C++ declaration.
    you can not use the return value with an emit Event. ;-(

    see http://stackoverflow.com/questions/11272951/pyqt4-pyqtslot-what-is-the-result-kwarg-for

  • PyQt5.4. No window shown

    2
    0 Votes
    2 Posts
    1k Views
    jazzycamelJ

    Did you get any errors when you try to run it?

    The following works perfectly for me on Mac OSX 10.8, Python3.4, Qt5.4:

    test.qml

    import QtQuick 2.2 import QtQuick.Controls 1.1 ApplicationWindow{ width: 400 height: 300 visible: true title: qsTr("Hello") Label{ text: qsTr("Hello") anchors.centerIn: parent } }

    run.py

    from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtQml import * from sys import argv, exit def createApplication(): app=QGuiApplication(argv) engine=QQmlApplicationEngine(app) engine.load(QUrl("test.qml")) return app if __name__=="__main__": app=createApplication() exit(app.exec_())

    To execute:

    $ python run.py
  • question about OPENGL and QT

    5
    0 Votes
    5 Posts
    1k Views
    ?

    @alex111 Yes, that's right.

  • Scripting in Qt

    5
    0 Votes
    5 Posts
    2k Views
    A

    If you want make application with drag-and-drop, operating with DB, scripting to operate with widgets on the forms, store and load widgets in UI files, change forms without recompile of the project, take a look at QtRptDocumentDemo

  • self.sender() always None

    3
    0 Votes
    3 Posts
    3k Views
    E

    What's weird is I tried the same code again today, but I'm getting the sender this time. Something is not right with how PySide passes the sender, but I can tell this is one of those bugs that will be really hard to track down since it's really inconsistent. Here's a simplified version of what I'm working with:

    import sys from PySide.QtCore import * from PySide.QtGui import * class CustomDialog(QDialog): def __init__(self, parent=None): super(CustomDialog, self).__init__(parent) self.setLayout(QVBoxLayout()) self.table = QTableWidget() self.table.setColumnCount(2) self.layout().addWidget(self.table) self.table.setRowCount(10) for row in xrange(self.table.rowCount()): item = QTableWidgetItem(str(row)) self.table.setItem(row, 0, item) combo = QComboBox() combo.addItems(['one', 'two', 'three']) combo.currentIndexChanged.connect(self.onIndexChanged) self.table.setCellWidget(row, 1, combo) @Slot(int) def onIndexChanged(self, index): print self.sender() def main(): app = QApplication(sys.argv) dialog = CustomDialog() dialog.show() app.exec_() if __name__ == '__main__': main()

    If you don't get the bug, I wouldn't spend too much time looking into it, but I appreciate the help.

  • Android apps built using Qt

    2
    0 Votes
    2 Posts
    4k Views
    M

    Bump it on new forums... oh yeh

  • 0 Votes
    2 Posts
    2k Views
    A

    Is it really numpy.dot or could it also be numpy.zeros?

    I am allocating a huge 3d matrix via numpy.zeros and I seem to have a deadlock in some cases there too.

  • GIL deadlocks with PySide

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    11 Posts
    3k Views
    L

    How is it explained that the code works under Linux?
    With the same code I can write pdf and zip.
    Thanks for your patience!

  • Extending pyqtSlot

    2
    0 Votes
    2 Posts
    1k Views
    SGaistS

    Hi and welcome to devnet,

    You should rather contact the River Bank Computing team since PyQt is their product

  • 0 Votes
    3 Posts
    4k Views
    T

    And think I got him! Is something like this:

    @def moveCard(self, card, targetPoint, timeLine = 5000, rotation = 0):

    """Move the card from one position to one other.""" cardTimer=QtCore.QTimeLine(timeLine) cardAnimation=QtGui.QGraphicsItemAnimation(self) cardAnimation.setItem(card) cardAnimation.setTimeLine(cardTimer) cardAnimation.setPosAt(1, targetPoint) cardAnimation.setRotationAt(1, rotation) cardTimer.start()@

    ... improve speed with svg card items?

    Edited:
    I've noted improved speed adding @card.setCacheMode(QtGui.QGraphicsItem.NoCache)@

  • Pyside-uic, destroying layout

    2
    0 Votes
    2 Posts
    1k Views
    J

    I've found something that helps this program to look better. It isn't perfectly what I wanted but It will work for now. This textedit at the bottom of my program can't be under left tablewidget. Here is picture how it looks like now:

    !http://i.stack.imgur.com/XslZf.jpg(My program)!

    But still I don't know why this is happening? And why I can't see that in qtdesigner preview.

  • I18n how to?

    3
    0 Votes
    3 Posts
    2k Views
    O

    Many Thanks, I've solved putting them in the init part of the class so they are translated properly and refer to these messages in a derived QMessageBox, some QmessageBox fails About seems to work but Question (i didn't remember well fails to translate properly the messages).

    @ self.toolcyl = self.tr("Cylindrical") self.toolsph = self.tr("Spherical (Ball)") self.tooltor = self.tr("Toroidal (Bull)") self.toolcon = self.tr("Conical") glb.shape[0] = self.toolcyl glb.shape[1] = self.toolsph glb.shape[2] = self.tooltor glb.shape[3] = self.toolcon # End of the tool shapes definition # ###################################################################### EC_L.readTooltable(self) EC_UA.populateUI(self) ###################################################################### # # Translatable string goes here i didn't find a method to make it # work flawlessy in some QMessageBox # ###################################################################### # Exit Dialog self.msg_01t = self.tr("<b>Exit Dialog</b>") self.msg_01m = self.tr("Are You sure you want to exit?") # About EuroCAM Box self.msg_02t = self.tr("About ") self.msg_02m = self.tr("<b>SomeProgram</b> is a program. <br> \ <br> It generates some output to help you in \ figuring out the life, the universe and all other things.") # @

    I'm using them in the About widget without too many problem like this:

    @QMessageBox.about(self,self.msg_02t,self.msg_02m) @

    For the others MessageBox i have written a def like this:

    @
    def closeEvent(self, event):
    msgBox = QMessageBox()
    msgBox.setText(self.msg_01t)
    msgBox.setInformativeText(self.msg_01m)
    msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.Cancel)
    msgBox.setDefaultButton(QMessageBox.Yes)
    msgBox.setIcon(QMessageBox.Question)
    ret = msgBox.exec_()
    event.ignore()
    if ret == QMessageBox.Yes:
    # Do Something
    event.accept()
    elif ret == QMessageBox.Cancel:
    event.ignore()@

    In this manner it works as expected and if you note in the first lines of the examples i have translate some messages that are referenced in another module of the program. After struggling with this behavior I have found this solution that isn't too bad and not too unelegant, but the readability of the code suffers a little.

    Regards
    Carlo D.