Skip to content
  • 0 Votes
    2 Posts
    36 Views
    C

    Oups, everything is working only if I select the python interpreter version in Visual studio Code in the right bottom bar and not by using the classic command lines pyenv local / .\env\Scripts\activate
    XD

  • 0 Votes
    2 Posts
    50 Views
    jsulmJ

    It is not really clear what exactly you did. What is BaseWidgetWindow?
    If you're imnplementing a custom title bar then take a look at https://github.com/imitatehappiness/QtCustomTitleBar

  • 0 Votes
    4 Posts
    160 Views
    AnmolA

    @jsulm ahh.. got it 😄. Thank you

  • debugging problem

    Solved QtWebEngine
    1
    0 Votes
    1 Posts
    125 Views
    No one has replied
  • 0 Votes
    3 Posts
    142 Views
    A

    @JonB I wasn't even aware my widgets would disappear when dragging it in the middle like that -- but they did as well!

    The second link seems to have solved it. Thank you so much for help!

    Just in case anyone finds this in the future, here's the Python version:

    def dragMoveEvent(self, e): if ( (self.row(self.itemAt(e.pos())) == self.currentRow() + 1) or (self.currentRow() == self.count() - 1 and self.row(self.itemAt(e.pos())) == -1) ): e.ignore() else: super().dragMoveEvent(e)
  • 0 Votes
    6 Posts
    430 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.

    e5ba5886-00aa-4dac-b61c-9bf28770a84c-image.png

  • 0 Votes
    4 Posts
    359 Views
    S

    I agree with @JonB that QLineEdit would not be my first choice. We have similar cases where we use a QStackedWidget with a QLineEdit and a slider to switch between the two. In other instances Qt will put an edit widget over the current widget (e.g. in table widgets). These would be the usual approached to solve this problem differently.

    However, I would advice against using several stylesheets for your QLineEdit and switching between them. You can have a single stylesheet together with dynamic properties. Have a look at the documentation: https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-using-dynamic-properties
    Just use an enum for your different modes and check inside the stylesheet the value of your mode to do different styles.

  • 0 Votes
    2 Posts
    341 Views
    JonBJ

    @ZEZON
    Please paste code not screenshots so people can copy from it.

    Your code should be working, but I'm afraid it looks like it isn't due to some PySide2->Python issue. https://www.pythonguis.com/tutorials/pyside-dialogs/ for PySide2 even includes same line as you. If you can test under PyQt5 that would confirm.

    I don't suppose it will help, but try:

    buttons = QMessageBox.Yes | QMessageBox.No mais.setStandardButtons(buttons)

    Actually, if you try the above one and it errors please show which of the two lines it complains about, that would be useful to know.

    I don't know whether something like

    buttons = QMessageBox.StandardButton(QMessageBox.Yes | QMessageBox.No) mais.setStandardButtons(buttons)

    would work.

  • 0 Votes
    6 Posts
    2k Views
    F

    See for example https://www.qt.io/blog/qt-offering-changes-2020

  • 0 Votes
    1 Posts
    194 Views
    No one has replied
  • 1 Votes
    3 Posts
    461 Views
    SGaistS

    Hi,

    Since Qt 5.15.2 contains only x86_64, one thing you can do is start a shell with the arch command so that it runs in x86_64 mode and from there follow the build instructions.

  • 0 Votes
    8 Posts
    887 Views
    D

    I have had the same error but with another library "libQt5Qml.so.5". I have tried various alternatives, and in my case, that error occurred when I executed a function in QML, which was supposed to create a custom component previously created in another directory, inside main.qml. In the end, the only thing that solved the problem was migrating to QT6. In my case, I was using PySide2, so switching from PySide2 to PySide6 solved the problem. Try using QT6 instead of QT5. Good Luck

  • 0 Votes
    3 Posts
    197 Views
    J.HilkJ

    locked as a dublicate of
    https://forum.qt.io/topic/143047/connect-parent-window-to-child-s-close-event

    give people time to answer, usually at least 24 hours.

    This is a user driven forum, no-one is paid to be here :D

  • 0 Votes
    10 Posts
    2k Views
    SGaistS

    @tilz0R in addition to @JonB, don't call self.show in an __init__ method. It's not the role of the widgets to make themselves visible. That is the role of the object or method creating them.

  • 0 Votes
    2 Posts
    209 Views
    D

    Meh forgot about shiboken2 sigh
    shiboken2.wrapInstance(widget_pointer, QWidget)
    To the rescue!

  • 0 Votes
    8 Posts
    407 Views
    JonBJ

    @probiner
    Wrong, you will be able to use QSortFilterProxyModel against QStandardItemModel. What I pointed out was: QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel) means that it can act as a proxy on any QAbstractItemModel. The docs tell you that QStandardItemModel inherits QAbstractItemModel. Therefore QSFPM can accept QSIM as its source model. And if it some point you derive your own model class from QAbstractItemModel the proxy will work against that for the same reason. This is what inheritance means in C++ and in Python.

  • 0 Votes
    4 Posts
    329 Views
    adrianghcA

    Hi again loopless, sorry for getting back to you so late. I'm actually struggling myself to build PySide 2 on Windows (running into different problems, though) so trying to reproduce this has been challenging.

    In the meantime, may I suggest that you

    a) try with a newer Qt version like 5.15.10
    b) try with a newer Python version like Python 3.10

    and see what happens?

  • 0 Votes
    9 Posts
    862 Views
    M

    @SGaist i did, it runs smooth with one camera, since its using available picture to stream, problem is when we have more than one camera, i cant choose each stream directly to communicate with in Qt.
    lets say i have a class in python that each def() does one job with a camera, one for focusing on for taking a picture one for sending too AI model and so on, i need to make 6 different object from this class for 6 different cameras and connect them to buttons in Qml, what i explained is alright, but the only part i can not do is the live stream for each camera separately, there is no function or at least i couldn't find which define separate stream of images for separate windows in qml, there are two method so far which looks for available stream of image not a specific one, one is imageprovider, other is paintclass
    this is were i have the main problem

  • shiboken2 compiles

    Solved Qt for Python
    2
    0 Votes
    2 Posts
    252 Views
    SGaistS

    Hi and welcome to devnet,

    You do not have a constructor without argument.

  • 0 Votes
    2 Posts
    615 Views
    C

    OK, after more searching I found this answer form the same helpful author.

    He says that when the qml files aren't in the root folder you should add
    import "qrc:/QML in the main file so it could see other components in the qrc file. (This path is specfic to my case because my qml files are in ./qml folder.)

    On thing to note that might seem obvious but I spent quite a few tries to figure it out is that you must compile the qrc file
    to py after every change you make to the qml files.

    Meaning running pyside2-rcc qml.qrc -o qml_rc.py. Otherwise the imports won't update, and you'll be stuck trying to figure out why the changes you're making don't affect anything.