Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
865 Topics 3.4k Posts
  • PyQt4: Reading binary data from Postgresql fails under Windows

    11
    0 Votes
    11 Posts
    4k 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
    2k Views
    SGaistS
    Hi and welcome to devnet, You should rather contact the River Bank Computing team since PyQt is their product
  • [solved] Moving and Resizing QGraphicsSvgItem with PyQt4

    3
    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.
  • Animation tutorial for PyQt5

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Weakly or strongly typed scripting language?

    3
    0 Votes
    3 Posts
    2k Views
    T3STYT
    I didn't know about QJSEngine, How could I miss it? Yeah, I should question potential users. But now that I found QJSEngine I will first check it. Thank you very much for your help!
  • Qt Wddx binding.

    2
    0 Votes
    2 Posts
    865 Views
    SGaistS
    Hi, AFAIK, no, but you can use Qt's xml module to generate the WDDX data
  • Drag n Drop Button and Drop-down menu PyQt/Qt designer

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • PyQt: Selectable widget items with multiple clickable icons

    2
    0 Votes
    2 Posts
    1k Views
    SGaistS
    Hi and welcome to devnet, Something like a QListView with a QStyledItemDelegate or you can also use QML which might be simpler in that case. Hope it helps
  • Impossible Python Error (garbage collection problem with slot?)

    2
    0 Votes
    2 Posts
    1k Views
    U
    I've just encountered a similar error in my code. Looks like it is similar to what is described "here":http://www.daa.com.au/pipermail/pygtk/2008-August/015767.html. I followed the suggestion there to work around it by providing the local variables as default arguments to the function, in your case: @def jsbinder(mainFrame=mainFrame):@ It looks like the general bug "was fixed a long time ago":http://www.riverbankcomputing.com/hg/sip/rev/8bf735cda5bf, but there are still corner cases where it may happen.
  • PyQt5: How to create clickable QLabel/custom button?

    9
    0 Votes
    9 Posts
    7k Views
    SGaistS
    I'd say that with QML you're on the right track.
  • PySide QThread.terminate() causing fatal python error

    5
    0 Votes
    5 Posts
    6k Views
    JKSHJ
    [quote author="nullstellensatz" date="1421370989"]The operation that is taking too long is a library function call that I have little control over.[/quote]That's unfortunate. Any chance of getting the library's author to provide a better API? [quote]I am looking to understand why I cannot terminate() QThreads in PySide.[/quote]Not sure (I don't have Python experience), but judging from your error message, I'm guessing it's related to how PySide handles the "Global Interpreter Lock":https://docs.python.org/2/c-api/init.html#thread-state-and-the-global-interpreter-lock
  • TableWidget.insertRow(1) fails inside connect() call

    3
    0 Votes
    3 Posts
    2k Views
    SGaistS
    Hi and welcome to devnet, It's rather that you are giving the slot a parameter. You also can't connect a parameterless signal to a slot with parameter. Anyway, for your purpose the use of a lambda is perfectly fine
  • [SOLVED] String Encoding problem between Python, XHTML, Javascript

    4
    0 Votes
    4 Posts
    3k Views
    C
    Now even better. I've found that calling toUtf8() turns the unicode array implicit in the QString passed by the original @pyqtSlot decorator into something which can be written to file without messing about, and which preserves special characters. I've no idea why no combination of python str() and bytearray() encode and decode operations could seem to achieve this, but it's done now... https://github.com/cefn/firmware-codesign-readinglog/blob/8c315b85c14f83539313bace54453565ba8aa9f6/ui/test/test.py
  • 0 Votes
    2 Posts
    1k Views
    C
    This was the result of two interlocking features of the tools I was using. First of all PDB breakpoints seem to be locked to the thread they were inserted from. Consequently, because the QT Eventing thread was the one triggering the update, PDB wasn't able to detect the invocation. Secondly, QXMLQuery seems to have inbuilt caching, meaning that changes to focus and query files had no impact on the second invocation of evaluateToString() Between these two features, it meant that I was unaware that update WAS in fact being called. After building a minimal test case, I was able to track down the problems.
  • User interface freezed when using concurrent.futures.ThreadPoolExecutor

    1
    0 Votes
    1 Posts
    758 Views
    No one has replied
  • 0 Votes
    7 Posts
    5k Views
    JKSHJ
    Python's None type represents null values.
  • PySide.QtOpenGL not found

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Pyqt: AttributeError: 'Object' has not attribute 'someFunction'

    2
    0 Votes
    2 Posts
    5k Views
    SGaistS
    Hi and welcome to devnet, Might be a silly question but did you indent your source correctly ? The code you posted shows that setA is not part of Window since it's at the same level as e.g. main