Skip to content

Qt for Python

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

3.4k Topics 14.9k Posts
Qt 6.11 is out! See what's new in the release blog
  • Suggestion: Add [tool.pyside6-deploy] in pyproject.toml for pyside6-project

    Unsolved pyside
    2
    0 Votes
    2 Posts
    32 Views
    SGaistS
    Hi and welcome to devnet, You should open a feature request on the bug report system. That will be the right place to discuss this kind o things. This forum is more user oriented.
  • PyQt6 QWebEngineView unintended content replacement with index of location

    Unsolved qt for python
    1
    0 Votes
    1 Posts
    30 Views
    No one has replied
  • QtQuick3D point/line size

    Unsolved
    3
    1 Votes
    3 Posts
    678 Views
    X
    Now I'm working on drawing a vertices cloud for a model imported from polygon, and I was puzzled about this issue as well. I've tried changing point size in .vert file, but no effect actually. Anyway, shader files in Qt are seriously hard to compile successfully.
  • Drawing LaTeX image in pyside6 using TextObject

    Unsolved
    3
    0 Votes
    3 Posts
    116 Views
    JonBJ
    @pasmon90 said in Drawing LaTeX image in pyside6 using TextObject: I need python equal or greater than .12 for gemini api feature So i cannot use pyqt6 as it does not get install. I know nothing about your situation. But if you are saying that PyQt6 would work, or is at least worth trying to compare against PySide behaviour, have you tried running PyQt6 with whatever 3.12/3.13 version of Python, regardless of whether PyQt6 is supplied with an older version of Python?
  • Combobox no dropdown under Debian

    Unsolved
    3
    1 Votes
    3 Posts
    186 Views
    S
    Thank you for the warm welcome! I use this QT-version: Name: PySide6 Version: 6.7.2 Summary: Python bindings for the Qt cross-platform application and UI framework Home-page: Author: Author-email: Qt for Python Team <pyside@qt-project.org> License: LGPL Location: /home/pi/.local/lib/python3.11/site-packages Requires: PySide6-Addons, PySide6-Essentials, shiboken6 Required-by:
  • PyQt

    Unsolved
    6
    0 Votes
    6 Posts
    277 Views
    JonBJ
    @J.Hilk said in PyQt: I know I don't like that as well, but at least it reduced the confusion between Qt and QtCreator versions by an order of magnitude in posts here on the platform Not sure what you mean. I started at Qt5 a few years ago. We are now at Qt6. Meanwhile Creator went from something like major version 4 to major version 19, or thereabouts. I can't really see much has even changed in it (at least for my usage; and for me it has about the same number of major bugs/annoyances as it did at version 4, no improvements in lots of those). Certainly not enough to justify ~15 major version increments. If this were any other product than Qt, which I do love, I would not touch it with a bargepole if it need to undergo so many, frequent major version numbers.
  • Failing to build PySide 6.9.2 in debug

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    SGaistS
    Thank you ! :-)
  • Do I need to add qmldir for python objects exposed as singleton instances?

    Unsolved
    5
    0 Votes
    5 Posts
    303 Views
    M
    @JKSH I am trying to go through your answer step by step going from the simplest case and adding complexity. I am trying to use the decorators as you mentioned but I still cant get the qmllint or the language server to recognize my python types. The code works but in my qml file I will get a warning that the module can not be imported. @JKSH said in Do I need to add qmldir for python objects exposed as singleton instances?: In addition to QML instantiation, these decorators automatically generate the qmldir + *.qmltypes files. These files are read by qmllint and the QML Language Server (qmlls) to understand your Python types. I am not sure how adding a decorator to my class can generate these files so the language server can recognize the types. I feel like I am missing something here related to the qt tools provided for python but I cant see what. Going through the documentation I have tried to use pyside6-project build but nothing really happens even if I dont get any errors. I tried using pyside6-project qmllint and get the same warnings. My qml file and the .py file where the @QmlElement decorated class lives have been added to the pyproject.toml. Still not *.qmltypes are generated in this process. Information about these tools seems scarce so I am wondering if I am missing something.
  • Play multiple mp3 files with QMediaPlayer

    Solved
    3
    0 Votes
    3 Posts
    197 Views
    M
    I found a solution, it involves in connecting the signal "playingChanged" of QMediaPlayer to a function that plays the next track. self.player=QMediaPlayer() self.audioOutput = QAudioOutput() self.player.setAudioOutput(self.audioOutput) self.player.playingChanged.connect(self.play_next) def play_next(self): if self.player.playbackState()!=QMediaPlayer.PlaybackState.PlayingState: self.player.setSource(QUrl.fromLocalFile("next_track.mp3")) self.player.play()
  • I found an error on the PySide6 documentation website.

    Unsolved
    3
    1 Votes
    3 Posts
    190 Views
    F
    Yes, https://codereview.qt-project.org/c/pyside/pyside-setup/+/718662
  • Organization of QML tests

    Unsolved
    1
    0 Votes
    1 Posts
    75 Views
    No one has replied
  • 0 Votes
    2 Posts
    134 Views
    JKSHJ
    Hi, and welcome! @Sneako said in Qt Creator Designer "Line: 0: The Design Mode requires a valid Qt kit." with Kit installed and code buildable.: Yet designer complains about missing Qt a valid QtKit? Maybe the Qt Quick Designer only recognizes C++ kits. Does the warning disappear if you create a C++ project?
  • Suggestions for viewing 3D tool paths

    Unsolved qt for python
    2
    0 Votes
    2 Posts
    178 Views
    SGaistS
    Hi and welcome to devnet, Something like that likely exists but it's not part of the default set of Qt components. One thing you could do is explore KDE's extensive set of applications. There might be something there that you could leverage for your project.
  • How to optimize dlls when compiling using Nuitka for PySide6?

    Solved
    6
    0 Votes
    6 Posts
    649 Views
    SGaistS
    You might also want to check for the plugins you don't use. That said, it might be worth checking with the nuitka folks about supporting the exclusion of Qt modules rather than having to list all the dlls.
  • Qt Creator Design Mode for QML

    Unsolved
    6
    1 Votes
    6 Posts
    5k Views
    S
    I know this is an old post, but as I have searched the forums for this problem and could not find any solution i will post my findings here. As the code suggests it could not found a qt kit. In the kit menu, after a fresh install it has a qt kit and a python kit. Now the python kit does not contains the qt, and the qt kit does not contains the python env. The solution is easy, create a new kit that has both python and qt set. But simply creating a new one will not show the python option. In the default settings filter you need to tick python to visible, then in your new kit you can select both. After using this new kit you can use the designer.
  • 0 Votes
    4 Posts
    314 Views
    GrecKoG
    in QML it would have been: ScrollView { TextArea { TextField { anchors { right: parent.right bottom: parent.bottom margins: 16 } } } } As said by JonB in widgets you could override the parent resizeEvent or install an eventFilter handling QEvent::Resize on it and call your QTextField move function.
  • This topic is deleted!

    Solved
    3
    0 Votes
    3 Posts
    21 Views
  • Parent-child closing windows in pyside6

    Unsolved
    2
    0 Votes
    2 Posts
    631 Views
    SGaistS
    Hi, From the top of my head: opening widgets upon opening widgets within a constructor is usually bad design. Even more when the window variable is local to the function. I would recommend properly building your widgets and only after that start your business logic and have proper functions that will create and further show these widgets.
  • OS-independent colour scheme with PySide6

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    H
    @SimonSchroeder said in OS-independent colour scheme with PySide6: @SGaist said in OS-independent colour scheme with PySide6: I am wondering whether the red should be a bit darker in the the dark mode. This could certainly help. In the same way, it could help to make the white lines a light gray instead. I'd love to do that, but there lies my "Qt rookie" problem again, I see many ways but don't know best practice. I have presently used roles everywhere, and the lines have the "text" role which makes them white in Win 11 dark mode. When a light/dark switch happens while the app is open, QT6 does everything for me, except the green background of the "Weight" input field, which signifies a valid SymPy expression. I made that with style sheets, so it updates only when the field redraws. Right after a dark-to-light switch the field will still be a darker green with white text. Would the proper way be to do the gray line with style sheets, detect a mode change, and redraw, or can I add roles that then update automatically at light/dark switch? Or should I work with two palettes?
  • close bottom window of QMainWindow

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    JonBJ
    @C.J.-Mejias Given that you say: self.setWindowFlags(self.windowFlags() & ~Qt.WindowMinMaxButtonsHint) # does not work self.setWindowFlags( flags = Qt.Window | Qt.WindowCloseButtonHint) # does work I would check before executing the first statement what self.windowFlags() had in it --- did it include Qt.Window and Qt.WindowCloseButtonHint to start with? And for that matter also what it returns after that statement, so that we know what the flags have actually been changed to. All it should be doing is switching off whatever is in Qt.WindowMinMaxButtonsHint, which should not be anything to do with Qt.Window or Qt.WindowCloseButtonHint. You have not yet discovered whether this change in behaviour is to do with Qt, PySide or Python.