Skip to content

Qt for Python

For discussion and questions about Qt for Python (PySide & Shiboken)

3.2k Topics 14.3k Posts
  • using qt designer to connect a widget to a method

    Unsolved
    2
    0 Votes
    2 Posts
    41 Views
    SGaistS

    Hi and welcome to devnet,

    You can the auto connect feature but it has proven a bit fragile over time. So yes, better do it in code.

  • readyRead signal not activating while using QSerialProt

    Solved
    5
    0 Votes
    5 Posts
    132 Views
    jsulmJ

    @Adar70 said in readyRead signal not activating while using QSerialProt:

    I don't know how to make it more robust

    Don't rely on the number of times readyRead is emitted. Instead accumulate the received data until you received all you expect to receive.

  • Using Signals in QGraphicsItem

    Solved
    25
    0 Votes
    25 Posts
    566 Views
    SGaistS

    @JonB I misread the code !

    We are in the territory where your solution (using __init__) is the way to go. Multiple inheritance in Python is quite tricky...

    QObject expects an optional parent parameter which is not given here but it's not expecting the parameters for the QGraphicsLineItem constructor hence the failure. You can try to use the kwargs trick however it won't work either as it's not part of any of the method signature and thus can't work either.

  • How to structure this project?

    Solved
    8
    0 Votes
    8 Posts
    240 Views
    D

    That is great. Thank you very much for your time and help.

    Would you have any (open source) pyqt projects you would recommend to look at and learn from?

    I've got a couple of good books but they usually have small examples focused on specific topics, not complete projects. I'm currently mostly looking at how https://github.com/dietervansteenwegen/serial-tool is set up and try to understand and copy (if it makes sense) that.

  • 0 Votes
    6 Posts
    142 Views
    N

    Hmmm... actually, I finally made it : and the solution was... to remove margins from theQHBoxLayout of the QWidget !
    Jesus ! I'll have to carefully remember that one 😅

  • 0 Votes
    3 Posts
    136 Views
    C

    It looks like your signal-slot connection is stacking each time you open the child window. Try disconnecting the signal before reconnecting it in handlePlot() using window.signal.disconnect(self.handleData). This should prevent multiple calls to handleData(). My cousin, who is a professional photographer, was always struggling with sending full-resolution images to clients. After trying various platforms, he finally settled on Filemail, and it has been a game-changer for him. No compression, no sign-ups for recipients, and super-fast uploads—everything he needed for hassle-free file transfers.

  • Connecting C++ Qt widgets and PySide2 ones

    Unsolved
    13
    0 Votes
    13 Posts
    3k Views
    SGaistS

    Sorry, I can't as I don't have access to the archives that might contain this article.

    However, you will likely be interested by the example linked by @tellien .

  • printing issue in a qt app pyqt5

    Unsolved
    6
    0 Votes
    6 Posts
    193 Views
    SGaistS

    AFAIK, both packages can coexist in the same environment as they come each with their own build of Qt.
    However, to get better help, as @jsulm suggested, you should bring that issue to the Salome forum.

  • PyQt5 show hide is not working when shortcut is used

    Unsolved
    1
    0 Votes
    1 Posts
    50 Views
    No one has replied
  • how to include page1.ui file in mainwindow.ui file

    Solved
    6
    0 Votes
    6 Posts
    195 Views
    JonBJ

    @abiabi
    Because Qt Designer/Creator is not particularly Python-oriented.
    The accepted solution from @eyllanesc is the way to go, as with his other Python posts.

  • shiboken6/pyside6 with poetry under msys2

    Unsolved
    3
    0 Votes
    3 Posts
    103 Views
    R

    Hello @Jaime02 ,

    Hum I am using poetry and as it is showed in the project, there is no specified version (so it takes the latest if available). It works perfectly out of the poetry world yes for sure, but not in poetry one...

  • How to develop python qwidget for c++ QMainWindow?

    Unsolved
    4
    0 Votes
    4 Posts
    140 Views
    Pl45m4P

    @MonkeyBusiness said in How to develop python qwidget for c++ QMainWindow?:

    I would like a c++ pointer to the created python QWidget

    But why?
    Either write the rest of the GUI also in Python or rewrite the widget in C++.

  • 0 Votes
    2 Posts
    84 Views
    JonBJ

    @BGrimaud
    If you delete the ui_...py file and resave does that recreate it, and reflect new changes?
    Do you have the option to try a newer version of Creator?

  • trying to create a python binding for a C++ Qwidget

    Unsolved
    7
    0 Votes
    7 Posts
    520 Views
    M

    @friedemannkleint hi fried, I have question, does the example's python qwidget able to dock onto a c++ qmainwindow?

  • 0 Votes
    3 Posts
    98 Views
    K

    Please run your app in debugger to see where that happens

    Dear @jsulm,
    Thank you for your suggestion. I did execute the application using the debugger; however, it encountered an issue at the first line of the init_gl function, displaying a message indicating "disconnected unexpectedly." Unfortunately, no further information was provided.

  • 0 Votes
    2 Posts
    76 Views
    M

    Found solution for this problem!

    By default, QCompleter object is set to CaseInsensitive and that is what was setting it to the previous entry. With an addition of line like this:

    self.combo_box.completer().setCaseSensitivity(Qt.CaseSensitivity.CaseSensitive)

    things are working correctly!

  • 0 Votes
    1 Posts
    72 Views
    No one has replied
  • 0 Votes
    9 Posts
    228 Views
    F

    We actually provide a tool,
    pyside6-project , which defines a simple project file format and can do these steps automatically and can also be opened in Qt Creator.

  • 0 Votes
    3 Posts
    170 Views
    D

    Thanks for your information. I'm not getting any kind of resource too regarding the packaging.

  • 0 Votes
    14 Posts
    481 Views
    JonBJ

    @RemDup
    The alternative way which should work is not to load the stacked widget initially. Show the main window and set off a 0 duration singleshot timer before entering the main event loop. In the slot, which will be run just after the main window (or whatever) is shown, create and load the other widgets.