Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
865 Topics 3.4k Posts
  • Free Python document styling/stylesheet classes for Qt QGraphicsView

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • QtWebKit and QHttpThreadDelegate

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [Solved] PyQt4 - Passing data between widget instances

    2
    0 Votes
    2 Posts
    7k Views
    P
    the solution is: @ def BtnClick(self): #on self.Btn Click create: '''Widget B''' inputDlg = WidgetB(self) inputDlg.show() if inputDlg.exec_(): self.editor.acceptUserInput(inputDlg.userInput())@ userInput being a getter in WidgetB acceptUserInput being a setter in WidgetA Other possible solution would be using global variable but you still need .exec_() to make it work.
  • How get handle of Qwidget Child with vb.net ?

    9
    0 Votes
    9 Posts
    6k Views
    G
    Hi, ther very first HIT from google: http://en.wikipedia.org/wiki/Microsoft_Active_Accessibility that describes what MS Accessibility is. I don't know what you want to do. I don't know why you want to do that. You can't send windows messages to Qt widgets. You wanted to access the widgets, that is possible via MSAA, the only way I know on windows (if you do not have Qt for that).
  • Beginner Question about QCalendarWidget

    2
    0 Votes
    2 Posts
    2k Views
    T
    https://qt-project.org/forums/viewthread/19738/ is a german thread from dino about this issue with a bit more feedback.
  • Pyside - Moving data between two list views

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [Solved] Python/Pyqt - QtCore.Qt.RightButton not responding

    4
    0 Votes
    4 Posts
    7k Views
    N
    Thanks so much, jazzycamel! :) That worked great!!!
  • Put C++ class into QML window

    4
    0 Votes
    4 Posts
    3k Views
    S
    I try to achieve ability of dynamic qml object's creation from C++ code. I need create some objects from C++ code and then show them as part of main.qml I tried to replace QDeclarativeView on @ QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl::fromLocalFile("qml/PlanetWars/BaseObject.qml")); QObject *object = component.create();@ but observe only RuntimeError.
  • QtCore.QAbstractItemModel

    3
    0 Votes
    3 Posts
    2k Views
    D
    Hi! Can you post your index() method's realization, please? Right now I have issues with this. I try to pass COM object to createIndex() as ptr parameter, but Python interpreter just crashes. Here is my index() method: @ def index(self, row, column, parent=QtCore.QModelIndex()): if parent.isValid(): parent_item = parent.internalPointer() try: child = parent_item.ChildRows[row] except: return QtCore.QModelIndex() else: try: child = self.card.Sections(self.card.Type.AllSections. GetByAlias('Main').ID).Rows[row] except: return QtCore.QModelIndex() return self.createIndex(row, column, child)@ self.card - is the COM object. I use win32com library for working with COM. Interpreter crashes when trying to execute this: @return self.createIndex(row, column, child)@ Thanks!
  • Inconvenient Behaviour: QSqlTableModel.removeRow()

    3
    0 Votes
    3 Posts
    2k Views
    E
    sorry Andre, i will try to explain better now. the problem is: Why calling QSqlTableModel.removeRow() erase the row content in the view and model. (so, calling record.field().value().toString() for the removed row --without calling submitAll()-- returns empty string for all fields.!!) doing so with PyQt v4.8.5 will keep the row contents untouched until i call submitAll() for actual deletion. Thanks for your patience.
  • Strict knowledge of subset of properties involved in a userdefined script

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Error related to QConnection

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    K
    welcome to devnet There is no need for "double posting":http://qt-project.org/forums/viewthread/19247/ on devnet. Threads may be moved by moderators if required. I am closing this thread because of double posting.
  • [Solved] PyQt Dialog Window Not Popping up in Function

    8
    0 Votes
    8 Posts
    9k Views
    N
    Solved. See this "post":http://forums.cgsociety.org/showthread.php?p=7378920#post7378920.
  • PySide newbie question

    7
    0 Votes
    7 Posts
    5k Views
    F
    Yes, that was it, thanks a lot. I am still confused, and start on the tutorial again.
  • PySide compile from source on Windows 7 64-bit

    3
    0 Votes
    3 Posts
    3k Views
    R
    Maybe this "recipe":http://pypi.python.org/pypi/PySide/1.1.1qt474#installing-pyside-from-source-on-a-windows-system is what is needed. Owen
  • Fortran and Qt

    1
    0 Votes
    1 Posts
    5k Views
    No one has replied
  • 0 Votes
    3 Posts
    4k Views
    R
    Hello all, The problem has morphed again. Question: Where should I look for generatorrunner on Win7? Should a pointer to it come back from PySideConfig.cmake? Details: From the Qt SDK I had both 4.8.0 and 4.8.1 libs installed and this was causing an issue, so I now have just the 4.8.0 MSVC 2008 environment. Now the error relates to @CMake Error at CMakeLists.txt:14 (message): You need to specify GENERATOR variable (-DGENERATOR=value)@ It seems that generatorrunner is a command that you can run in a linux terminal, but I have no path to it on Win7. I think it should be part of pyside distribution, but I have found no files named generatorrunner on my whole Win7 drive. The message arises here in the CMakeLists.txt provided with the tutorial. @ find_program(GENERATOR generatorrunner REQUIRED) if (NOT GENERATOR) message(FATAL_ERROR "You need to specify GENERATOR variable (-DGENERATOR=value)") endif() @ apt-file search generatorrunner on linux gives shiboken: /usr/lib/i386-linux-gnu/generatorrunner/shiboken.so My Win7 build strategy for the binding tutorial is to launch a bare console then run: @ CALL "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 set QTDIR=C:\QtSDK\Desktop\Qt\4.8.0\msvc2008 set PATH=%QTDIR%\bin;C:\QtSDK\QtCreator\bin;%PATH% set QMAKESPEC=win32-msvc2008 set BINDFOO=C:\binding-tutorial\ set Shiboken_DIR=. set PySide_DIR=. cd %BINDFOO%\libfoo qmake nmake cd %BINDFOO%\foobinding-cmake\build C:\CMake28\bin\cmake.exe .. @ Thanks for any suggestions. Owen
  • [SOLVED]QAbstractProxyModel and mapToSource

    2
    0 Votes
    2 Posts
    2k Views
    I
    This function correctly fetches row and column numbers from the model, through a proxy: @def clickedSlot(self, modelIndex): model = modelIndex.model() if hasattr(model, 'mapToSource'): # We are a proxy model modelIndex = model.mapToSource(modelIndex) print modelIndex.row(), modelIndex.column()@
  • [PySide] QGraphicsItemGroup not visible

    3
    0 Votes
    3 Posts
    3k Views
    T
    Hi, I can confirm it :) . Your code does not work here with PySide. Shame. I'll contact the PySide guys. Thanks for your efforts :)
  • [PyQt4] -- Visual display of a register

    2
    0 Votes
    2 Posts
    3k Views
    jazzycamelJ
    Hi Olivier, I don't know if you managed to solve this already but if not I think the following example should do what you need. I wrote it for a project of my own with similar requirements and uses a custom QWidget with mouse events rather than a table or checkboxes. You can use the value() and setValue() functions to get and set the value programatically or click on the individual bits to toggle there values. Hope you find it useful, here goes: @ from PyQt4.QtCore import * from PyQt4.QtGui import * class BitWidget(QWidget): def init(self, num_of_bits, parent=None): QWidget.init(self, parent) self.num_of_bits=num_of_bits self.data=[0 for b in range(num_of_bits)] self.data[1]=1 self.box_size=30 self.font=QFont('Serif', 12, QFont.Light) def setBoxSize(self, size): self.box_size=size def setFont(self, font): self.font=font def sizeHint(self): return QSize(self.num_of_bits*self.box_size, self.box_size) def paintEvent(self, event): painter=QPainter() painter.begin(self) painter.setFont(self.font) size=self.size() width=size.width()-1 height=size.height()-1 for i,v in enumerate(self.data): painter.fillRect(i*self.box_size, 0, self.box_size, self.box_size, Qt.green if self.data[i] else Qt.red) painter.drawLine(i*self.box_size, 0, i*self.box_size, height) valueString="%d" % i fontWidth=painter.fontMetrics().width(valueString) fontHeight=painter.fontMetrics().height() painter.drawText((i*self.box_size)-(fontWidth/2)+(self.box_size/2), (self.box_size/2)+(fontHeight/2), valueString) painter.setPen(Qt.black) painter.drawRect(0, 0, width, height) painter.end() def mousePressEvent(self, event): b=event.pos().x()//self.box_size self.data[b]^=1 self.repaint() event.accept() def value(self): value=0 mask=1 for i,v in enumerate(self.data): if v: value|=mask mask<<=1 return value def setValue(self, value): mask=1 for i,v in enumerate(self.data): self.data[i]=(value&mask)>>i mask<<=1 self.repaint() class Widget(QWidget): def init(self, parent=None): QWidget.init(self, parent) QVBoxLayout(self) self.bitWidget=BitWidget(16, self) self.layout().addWidget(self.bitWidget) valueButton=QPushButton("Value", self) valueButton.clicked.connect(self.printValue) self.layout().addWidget(valueButton) self.valueSpinBox=QSpinBox(self) self.valueSpinBox.setRange(0, 2**16) self.layout().addWidget(self.valueSpinBox) setValueButton=QPushButton("Set Value", self) setValueButton.clicked.connect(self.setValue) self.layout().addWidget(setValueButton) def printValue(self): print "Value:", self.bitWidget.value() def setValue(self): self.bitWidget.setValue(self.valueSpinBox.value()) if name=="main": from sys import argv, exit a=QApplication(argv) w=Widget() w.show() exit(a.exec_()) @ It should look something like this: !http://s15.postimage.org/r3nwtauor/bitwidget.png(BitWidget Screenshot)! Feel free to ask any questions, hope it helps. Rob