[PyQt] Equivalent of Q_PROPERTY's MEMBER for pyqtProperty?

Elvis Stansvik elvstone at gmail.com
Sun Nov 11 11:14:00 GMT 2018


Hi all,

E.g. in C++ one can do:

    Q_PROPERTY(bool showFileDialog MEMBER m_showFileDialog NOTIFY
showFileDialogChanged)
...
public:
    bool m_showFileDialog = false;
...
signals:
    void showFileDialogChanged();

This makes the m_showFileDialog member variable readable and writable
without the need of creating READ and WRITE accessor functions, and Qt
emits automatically the showFileDialogChanged signal when needed.

Is it possible to get this kind of convenience with PyQt?

Cheers,
Elvis


More information about the PyQt mailing list