Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
850 Topics 3.3k Posts
  • How to create a simple class in QT ?

    13
    0 Votes
    13 Posts
    5k Views
    A

    It would be appropriate for you to create another forum thread for this different issue. This way, the moderators will live longer and anyone with similar issues might find such a thread easier. I am not sure about the scope of this forums, though - the question you ask is isolated and has no ties to Qt.

    Basically, if you want to execute a SELECT query for a given value, you compare this value with the name of the table's column:
    @SELECT * FROM evoting WHERE v_id = found_id;@

    Please also do use "@ for code wrapping":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 whenever you want to paste a block of code into your post. :-)

  • QNetworkReply doesn't abort/close

    2
    0 Votes
    2 Posts
    2k Views
    J

    what about sleep do you process when you sleep ?
    try :
    @while reply.isReadable () :

    ans = ans + reply.read()

    print (ans)@

  • 0 Votes
    1 Posts
    3k Views
    No one has replied
  • QUiLoader not loading layouts from .ui file

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • I need some help with Jambi

    2
    0 Votes
    2 Posts
    1k Views
    A

    This normally happens when the wrong library is loaded. Include only the library for the platformyou use.

  • QtWebkit bridge in Qt Jambi

    2
    0 Votes
    2 Posts
    1k Views
    A

    Yes, it's possible to use qt webkit with jambi.

    You can use something like:

    QWebView expendiosWebView = new QWebView();
    expendiosWebView.setUrl(new QUrl("classpath:com/nettrace/lotecarng/gui/resources/html/map2.html"));

  • 0 Votes
    3 Posts
    2k Views
    SGaistS

    Hi,

    AFAIK, when you use the constructor variant with the buffer, you must ensure the buffer exists through all the lifetime of the QImage. Check the QImage documentation.

  • [Solved] QTableView reflected in every tab PyQt

    12
    0 Votes
    12 Posts
    7k Views
    D

    Hey, I am sorry to bother you, but I tried to give everyone a parent, and I think they do?
    (from my src code)
    @def init(self, parent=None , **kwargs):
    QWidget.init(self, parent, **kwargs)
    layout = QVBoxLayout(self)
    self.lv = snifferView.view()
    layout.addWidget(self.lv)
    self.setLayout(layout)

    headers = ['No','Source','Destination','Protocol'] self.model = snifferModel.tableModel(headers=headers) self.lv.tableView.setModel(self.model) self.resultList = [] self.hexDump = '' self.count = 0 self.lv.tableView.selectionModel().selectionChanged.connect(self.rowSelected) @
  • PyQt4: DirectX window

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    3 Posts
    4k Views
    S

    Thank you for you question, I found that you used the wrong column index in your code.

    I try the code below is worked.

    parent= QStandardItem("parent1")
    model.setItem(parent)
    for index in range(10):
    myobj=MyClass()
    child= QStandardItem(myobj.name)
    parent.setChild(index,0,myobj)

    child= QStandardItem(myobj.lName) parent.setChild(index,1,myobj)
  • Pyside won't install on WidoZe

    1
    0 Votes
    1 Posts
    784 Views
    No one has replied
  • 0 Votes
    7 Posts
    3k Views
    R

    I am using Python 3 ,I use type() to test the return type of filePath() ,and the result is that filePath() returns str rath2than QString

  • 0 Votes
    3 Posts
    3k Views
    R

    thanks jazzycamel ,you always help me a lot !

  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • How to use plugins written in C++ from C#

    4
    0 Votes
    4 Posts
    2k Views
    H

    Uh, didn't remember this 8)

  • Setting up Qyoto on Windows

    3
    0 Votes
    3 Posts
    3k Views
    N

    Thanks, I'll go try asking on the KDE forum.

  • Qt Components

    1
    0 Votes
    1 Posts
    724 Views
    No one has replied
  • Pyside 2.7 installation for windows vista

    6
    0 Votes
    6 Posts
    4k Views
    S

    Interesting. I forgot to post that I was able to run some of the example programs and I did see the pop-up windows. I've included that my installation is working, but I couldn't find anything in the PySide package that has a QtCore object. Weird. I guess I won't worry about it unless I see more problems as I continue to use it.

  • 0 Votes
    4 Posts
    4k Views
    raven-worxR

    [quote author="redstoneleo" date="1366007227"]why does reply.rawHeaderPairs () ==[] here ?
    is there something wrong ?
    [/quote]
    Because you setting the raw header on the request and checking the reply for the raw header afterwards? :)

    Or in case you are wondering why the reply doesn't contain anything at all:
    You don't give the reply a chance to receive any data. You need to listen to the finished signal of the reply. The Headers are coming (mostly) with the first chunk of data from the server.

  • 0 Votes
    6 Posts
    7k Views
    jazzycamelJ

    You kinda got it: you only need to lambda the slot if you want to pass an argument, otherwise you just pass a reference to the slot. The following is your example corrected as necessary:

    @
    from PyQt4 import QtGui, QtCore

    class Window(QtGui.QMainWindow):
    def init(self):
    super(Window, self).init()

    self.initUI() def center(self): qr = self.frameGeometry() cp = QtGui.QDesktopWidget().availableGeometry().center() qr.moveCenter(cp) self.move(qr.topLeft()) def initUI(self): edit = QtGui.QTextEdit(self) edit.setStatusTip('Input Text Here') edit.setToolTip('Input Text Here') self.setCentralWidget(edit) exitAction = QtGui.QAction(QtGui.QIcon('exit.png'), '&Exit', self) exitAction.setShortcut('Ctrl+Q') exitAction.setStatusTip('Exit Application') exitAction.triggered.connect(QtGui.qApp.quit) copyAction = QtGui.QAction(QtGui.QIcon('copy.png'), '&Copy', self) copyAction.setShortcut('Ctrl+C') copyAction.setStatusTip('Copy to the Clipboard') copyAction.triggered.connect(edit.copy) pasteAction = QtGui.QAction(QtGui.QIcon('paste.png'), '&Paste', self) pasteAction.setShortcut('Ctrl+V') pasteAction.setStatusTip('Paste from the Clipboard') pasteAction.triggered.connect(edit.paste) cutAction = QtGui.QAction(QtGui.QIcon('cut.png'), '&Cut', self) cutAction.setShortcut('Ctrl+X') cutAction.setStatusTip('Copy text to the clipboard and delet from editor') cutAction.triggered.connect(edit.cut) self.statusBar() menubar = self.menuBar() fileMenu = menubar.addMenu('&File') fileMenu.addAction(exitAction) editMenu = menubar.addMenu('&Edit') editMenu.addAction(copyAction) editMenu.addAction(pasteAction) editMenu.addAction(cutAction) toolbar = self.addToolBar('Exit') toolbar.addAction(exitAction) toolbar.addAction(copyAction) toolbar.addAction(pasteAction) toolbar.addAction(cutAction) self.setGeometry(10, 10, 500, 500) self.setWindowTitle('Text Editor') self.setWindowIcon(QtGui.QIcon('favicon.png')) self.center() def closeEvent(self, event): reply = QtGui.QMessageBox.question( self, 'Message', "Are you sure you would like to quit?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No ) if reply == QtGui.QMessageBox.Yes: event.accept() else: event.ignore()

    if name == 'main':
    import sys
    app = QtGui.QApplication(sys.argv)
    ex = Window()
    ex.show()
    ex.raise_()
    sys.exit(app.exec_())
    @