Stylesheet css or xml widgets pyqt6 python
-
@Jbone73 said in Stylesheet css or xml widgets pyqt6 python:
for the layout of widgets
Layout in Qt/PyQt6 is done using https://doc.qt.io/qt-5/layout.html
You can influence some parameters (like margins) in style sheet but not the layout itself. -
@jsulm Thanks ! this's good document, I have another question :
what i would like to do is create a style for each widget i am going to use in a window. This in order to make a correct presentation of my application and to set up a style sheet is useful for the good understanding and organization of my program.
Example :
QTableWidget, QLineEdit, QLabel, QCombobox, etc.I would also like to know if it is possible to assign a different style for a widget called several times in the same window?
Example :
- 3 QLabels
the 1st make it 12px 'Arial'
the 2nd make 14px 'Open sans'
the 3rd are 18px 'Time New Roman'
if I do that in a css file it will apply a single style to all the labels.
Thanking you in advance for your help
- 3 QLabels
-
@Jbone73 said in Stylesheet css or xml widgets pyqt6 python:
if it is possible to assign a different style for a widget called several times in the same window?
Yes it is.
Take a look at https://doc.qt.io/qt-5/stylesheet-syntax.html
You can also adress specific widgets in style sheets using their object names.