Skip to content

Language Bindings

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

  • 0 Votes
    1 Posts
    3k Views
    No one has replied
  • Using vendor-supplied JAR file with Necessitas

    1
    0 Votes
    1 Posts
    880 Views
    No one has replied
  • 0 Votes
    2 Posts
    2k Views
    O

    I have found the cause. The highlighter instance is destroyed when initUI() terminates. This line fixes the problem on line 52:

    @ self.myHighlighter = highlighter.Highlighter(codeTextEdit.document())@

  • 0 Votes
    7 Posts
    3k Views
    R

    thanks for your tips !!!
    [quote author="bootchk" date="1365163715"]Expounding on SGaist's reply.... Usually a project such as PySide has an IRC channel. Some of the key developers usually hang out on (monitor) that channel. (Although it can get clogged with hanger's on, who don't contribute much.) Usually the channel is for people who are willing to attempt to fix a bug, or otherwise contribute documentation or source code. You shouldn't report bugs on the IRC channel. You must be polite. Don't ask trivial questions that you could answer yourself by browsing the source code (although you can ask where to begin looking.) If you do ask a question, just come right out and ask it as simply and briefly as you can. No need to explain why you want to know, or to introduce yourself. In this case, it MIGHT be fair to ask "Where should I report a bug in the PySide documentation." At this point I think it is already clear that it is a bug (and since it is in the documentation, relatively low priority for most developers, except for the one developer who might be in charge of the documentation.) If you ask, "Isn't this a bug?", it might be received as a complaint. It might be better if you are willing to attempt to fix the bug and ask "Where is the code that generates PySide documentation." I could be wrong, I am speaking from my limited experience with the Gimp project. I have no experience with the PySide project or channel. "But isn't this where you should report the bug?":https://bugreports.qt-project.org/browse/PYSIDE[/quote]

  • 0 Votes
    10 Posts
    7k Views
    R

    [quote author="jazzycamel" date="1364483680"]When you say "other process" do you mean an application other than your own? For example, a web browser window has been opened on top of your application? If this is the case, the simple answer to your question is that AFAIK you can't and if even if you could, you shouldn't as this would be incredibly annoying from a user perspective. What will happen is that the task bar will signal to the user via the task bar (usually by changing the colour of or flashing you apps entry) that something requires attention (your message box in this case).[/quote]
    yes,that's what I mean.thanks 4 your tips

  • Qt 5 & Python integration

    8
    0 Votes
    8 Posts
    21k Views
    M

    Maybe "this":http://stackoverflow.com/questions/261638/how-do-i-protect-python-code will help you

  • Read a qt dll from a c# gui

    5
    0 Votes
    5 Posts
    2k Views
    R

    I installed in VS2010 the "VS Add-in with Qt5". In my vs2010 solution i have the project of the qt dll ("Qt Library" created inside VS2010), correctly compiled and linked.

    so i have done right.

    I post i piece of the interface:

    #ifdef COMMQT_LIB

    define EXAMPLEUNMANAGEDDLL_API Q_DECL_EXPORT

    #else

    define COMMQT_EXPORT Q_DECL_IMPORT

    #endif

    #ifdef __cplusplus

    extern "C" {
    #endif

    extern EXAMPLEUNMANAGEDDLL_API Comm* CreateCommClass();
    extern EXAMPLEUNMANAGEDDLL_API void DisposeCommClass(Comm * pObject);
    extern EXAMPLEUNMANAGEDDLL_API int CommGetNumEvents(Comm * pObject);

    #ifdef __cplusplus
    }
    #endif

    Thankyou for your reply

  • Compiling pyside for python3.3 (linux)

    2
    0 Votes
    2 Posts
    2k Views
    B

    What step is "-- Found...." an output of? It seems to me that it is just a comment of a "configure" step, where it searches for presence of dependencies. It may be that the other changes you made are accomplishing what you want, to build with libpython3.3, and that you can ignore the comment.

    (I have no experience in building PySide, I could be wrong.)

  • Missing Pyside Documentation page

    3
    0 Votes
    3 Posts
    1k Views
    R

    Note:All the lines that start with line numbers in Qt documentation for C++ are missing in The PySide class reference documentation.

    here is an example :
    https://deptinfo-ensip.univ-poitiers.fr/ENS/pyside-docs/PySide/QtGui/QMessageBox.html?highlight=qmessagebox.about#PySide.QtGui.PySide.QtGui.QMessageBox.about

    where is the four locations ???

  • PySide Python3 Properties problem

    6
    0 Votes
    6 Posts
    3k Views
    L

    You can also call the parent QObject with the super() method.

    @
    from PySide.QtCore import QObject, Property

    class MyObject(QObject):
    def init(self,startval=42):
    super().init()
    self.ppval = startval

    def readPP(self): return self.ppval def setPP(self,val): self.ppval = val pp = Property(int, readPP, setPP)

    obj = MyObject()
    obj.pp = 47
    print (obj.pp)
    @

  • Visual Development of GUI possible with pyside

    5
    0 Votes
    5 Posts
    21k Views
    L

    @ericparent, your post seems to be unrelated to the OP's discussion, but have you tried to install the windows binaries?

    Go here and click on "Get PySide": http://qt-project.org/wiki/PySide

  • 0 Votes
    2 Posts
    20k Views
    L

    I found tutorials that show you 2 different ways to do this:

    Using Python, Import PySide
    You can create the GUIs directly from a python script, just import PySide and follow the tutorials on this page: http://qt-project.org/wiki/PySideDocumentation

    Using QtCreator, PySide and PySide Tools
    You can also create the GUI in QtCreator and convert it to a python script. Follow this tutorial:
    http://qt-project.org/wiki/QtCreator_and_PySide

  • The Extension Example With PyQt4

    2
    0 Votes
    2 Posts
    2k Views
    jazzycamelJ

    In this case it does very little because the of the size of the widgets, the use of a QGridLayout() as the main layout and the fact that the dialog cannot be resized (on Mac anyway). addStretch() puts a QSpacerItem() in the layout with initial size 0 which will then expand to fill any excess space in the layout not required by the widgets (depending on QSizePolicy()'s).

    Consider (and run ;o) the following example:

    @
    from PyQt4.QtCore import *
    from PyQt4.QtGui import *

    class Widget(QWidget):
    def init(self, parent=None, **kwargs):
    QWidget.init(self, parent, **kwargs)

    l=QVBoxLayout(self) hl1=QHBoxLayout() hl1.addWidget(QPushButton("Button 1", self)) hl1.addWidget(QPushButton("Button 2", self)) hl1.addStretch() hl2=QHBoxLayout() hl2.addWidget(QPushButton("Button 1", self)) hl2.addWidget(QPushButton("Button 2", self)) l.addLayout(hl1) l.addLayout(hl2)

    if name=="main":
    from sys import argv, exit
    a=QApplication(argv)
    w=Widget()
    w.show()
    w.raise_()
    exit(a.exec_())
    @

    When the window is resized (by the user) the buttons in the first layout retain there original size position, whereas the buttons in the second layout expand to fill extra space.

    Hope this answers your question ;o)

  • Link C# DLL to Qt Project

    2
    0 Votes
    2 Posts
    2k Views
    ?

    Hi,

    Check Gerolf's post here, http://qt-project.org/forums/viewthread/6154

    Regards

  • QTJambi

    2
    0 Votes
    2 Posts
    1k Views
    T

    You seem to have a problem... what exactly is it? Why don't you contact the people listed on sourceforge as project admins directly?

  • 0 Votes
    1 Posts
    795 Views
    No one has replied
  • PySide pickle support

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied