Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to access custom properties from QT Designer after converting to python?

I am new to PyQt and Qt Designer and I'm trying to create an easy method for relating qWidgets with the tables and columns in an SQLite database. My idea was to tag each qWidget in designer with two custom properties, one with the table name and one with the column name. Later, I would use the info provided by designer to build my own class which creates a relationship between the qwidets and SQLite database.

Adding the custom properties in Designer seems to work fine however, the code for these custom properties do not get generated when converting the xml of designer into python (using UIC). Has anyone done this successfully? Perhaps there is a better way to do this?

Thanks,

Eric

like image 752
Eric Black Avatar asked Dec 31 '25 00:12

Eric Black


1 Answers

If you added a property in Designer called "myproperty", fetch it with...

mywidget.property("myproperty")

This works fine in pyqt 4.8.3, perhaps it did not work in previous versions.

like image 104
goertzenator Avatar answered Jan 03 '26 06:01

goertzenator



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!