Skip to content

Qt for Python

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

3.3k Topics 14.5k Posts
  • Basic Python "import" question

    Unsolved
    2
    0 Votes
    2 Posts
    264 Views
    S
    @AnneRanch, this is for sure not Qt but pure python question so first of all you need to go to relevant community. Im not a python expert but in general import statement defines a scope that you import. I.e. if you have Module1 with ClassA, ClassB withing then: If you have import Module1 you get access to all its content with dot-notation. You may use Module1.ClassA and Module1.ClassB in your code. if you have from Module1 import ClassB Then you limit your import scope and can use ClassB only while ClassA won't be available for you. How to do it depends on your project and architecture.
  • Multiple objects with same material

    Unsolved
    1
    0 Votes
    1 Posts
    168 Views
    No one has replied
  • 0 Votes
    8 Posts
    1k Views
    E
    Using QTimer it works, what a nice functionality. Thank you everyone for your input!
  • 0 Votes
    6 Posts
    2k Views
    B
    @PratikTayshete I'm too new to this to suggest a proper solution... but this seems to work for my for pyside6 to correctly import the _rc.py file pyside6-uic appUI.ui -o appUI.py --absolute-imports --python-paths ./icons/ Note: When I run pyside6-uic --help I see the following --rc-prefix Python: Generate "rc_file" instead of "file_rc" import This suggest to me that you are expected to name of your compiled resource python files to either prefix or suffix with rc_ or _rc respectively. [image: 34dd53a6-d861-4c7c-9512-86c962e54b2b.png]
  • Syntax - passing "x.ui" file to uic ?

    Locked Moved Unsolved
    16
    0 Votes
    16 Posts
    1k Views
    Christian EhrlicherC
    @AnneRanch: Please stop deleting your posts just because others trying to help you (I really wonder that there are some people left here) and then tell you what you don't want to hear...
  • PySide6 typing stubs available

    Unsolved
    1
    2 Votes
    1 Posts
    737 Views
    No one has replied
  • Only be able to add one action in a menu

    Moved Solved
    14
    0 Votes
    14 Posts
    2k Views
    S
    @JonB said in Only be able to add one action in a menu: That must be QAction::QAction(const QIcon &icon, const QString &text, QObject *parent = nullptr). So label must be label text not QLabel?? This is exactly the problem. For this particular case Qt allows to constract QAction either with QLabel or with simple text. Similar situation was in my case that led to multiple seg-faults - Qt allows objects to be constructed with None parent but such an object may be lost occasionally and then access to it causes segmentation violation. Would Qt be more strict with such things these problem won't exist. But... we are with Python here - who cases about strict typization and other strict things?... I don't know the right answer... most probably tools should evolve. I like Python for its flexibility but at the same time hate it for the lack of strict types. So... next version should be better, shoudn't it? :)
  • Debugging "qt5-tools designer" - was (Looking for Python tool)

    Unsolved qt for python
    3
    0 Votes
    3 Posts
    435 Views
    S
    @AnneRanch it is quite hard to notice that you edited source post and spot what you changed. It would be more productive it you simply continue the thread. It is a public comunity, and with due respect - nobody is obliged to fulfil your demands in such a tone you use. You don't give information (for example why you want to use qt5-tools that is pretty outdated and why you bother about "too many dependencies" of PySide6) but demand a right first time answer. It doesn't work this way. Problem investigation is a step-by-step process. So, please explain a bit more about your setup - platform, OS, how python was installed, how you installed PySide, why you have limitations on dependencies... Then people will be able to give you advices, opinions and comments. Maybe even solution. But with tone you used up until now and a way how you make communication I believe noone here will wish to wipe their crystal ball to look deeper in your problems...
  • 0 Votes
    4 Posts
    662 Views
    S
    @guillermollopis these charts and class names rang a bell for me. I looked into requirements.txt of the project and see it uses pyqtgraph and I think charts are created with help of this library. So I would propose you to look into pyqtgraph manuals and especially into examples (you may find how to run them here). I think it may give you hints of how to address your problem. Maybe you will have more preciese questions (some guys here and on stackoverflow may answer it with regards to pyqtgraph usage...)
  • pip install pyside fails

    Locked Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    S
    @AnneRanch, which system do you use? (is it traditional Intel x86 or something else?) Which OS do you use? (I suspect it is Linux but which one?) How you installed python? Have you checked your access rights to site-packages directory? (as it complains it is not writable) And if you afraid to break your system - have you tried to use python vitrual environment? what is the result of pip install in this case? Why you try to use first version of pyside instead of pip install PySide6?
  • Yocto Build copying file from somewhere unknown

    Unsolved
    1
    0 Votes
    1 Posts
    146 Views
    No one has replied
  • PySide6 for Android:'Distribution' object has no attribute 'exclude_package_data'

    Solved
    1
    0 Votes
    1 Posts
    179 Views
    No one has replied
  • how to use PyQT5 without /dev/galcore?

    Unsolved
    4
    0 Votes
    4 Posts
    596 Views
    SGaistS
    Hi and welcome to devnet, What are you using ? Widgets or QtQuick ? Are you executing it with your compositor active ? How did you install PyQt ?
  • setPixmap called with wrong arguments, but arent they the right arguments?

    Unsolved
    3
    0 Votes
    3 Posts
    737 Views
    CristianMaureiraC
    Which version of PySide6 are you using? we recently enable PathLike objects to the QClipboard.setPixmap and setImage https://codereview.qt-project.org/c/pyside/pyside-setup/+/491315 but QLabel.setPixmap should get a Pixmap, not an QImage. There might be a bug on the signature, so I encourage you to file a report https://wiki.qt.io/Qt_for_Python/Reporting_Bugs
  • 0 Votes
    4 Posts
    618 Views
    jsulmJ
    @teh That should be OK. You can also try to set this flag each time you change the text of the label. Otherwise I have no other ideas.
  • Unable to run the app, PermissionError: [Errno 1] Operation not permitted

    Unsolved
    2
    0 Votes
    2 Posts
    734 Views
    SGaistS
    Hi and welcome to devnet, What are the permission of the files of your project ?
  • Listview delegate update from two sources

    Solved
    5
    0 Votes
    5 Posts
    395 Views
    L
    I found the solution: I replaced the delegate with a simple Text and it worked. Then I rmeoved all functions in the original delegate which were related to the properties and assigned the properties directly to the TextFields, CheckBoxes etc. Then it also worked but i got an binding-loop error. I resolved this error and now it works. I learned my lesson this time.
  • Seeking Help with Implementing QT Digital Advertising Platform in Pyside6

    Unsolved
    4
    0 Votes
    4 Posts
    376 Views
    G
    @StarterKit Thank you for the help. Your replies are valuable to me.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Debugging segfaults

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    S
    @IDontKnowHowToCode , thanks for the reference, I'll try faulthandler next time. But actually it was never a problem to find a line of code that raises segmentation violation it rather a problem to understand why it happens there. Thinking about your problem I would suspect that you may store a reference to delegate in some local variable that is cleaned before your window is closed (or not store it at all). This way you may still have a TreeView displayed by python garbage collector may have killed the delegate already. I.e. check that scope of your delegate variable matches the scope of your TreeView which it serves for.