I have problems with changing the physical appearance of a custom attribute form (QGIS 3, Windows 7).

A custom attribute form can be designed, for use in QGIS, using QT / QT Designer. In QT Designer there are several methods for changing the appearance of the attribute form - changing colours of labels or fields, field background colour, fonts, and so on. In some circumstances these show up when the attribute form is used in QGIS, but in some circumstances the settings recorded in QT/QT Designer are completely ignored.

For example: In QT designer, setting the 'stylesheet' attributes to "font-weight: bold;font-size: 18px" - specifically for a label - makes that label appear, when in QGIS, in 18px/bold. However doing the same for a 'QLineEdit' widget only has an effect on the font weight, not the font size (it appears bold, but at a standard size).

How can the appearance of the field (i.e. the LineEdit widget) be changed? What is it which limits which elements of the style can be changed and which can't? (Please note - I believe this is a question about QGIS, not one about QT, which is why I post it here).

EDIT - Adding extra confusion: some settings for a QT widget design are applied to the form only when the layer is not in edit mode. I have a QComboBox with the stylesheet setting as "font-weight:bold;font-size: 16px" which appears as large/bold only when the layer is not in edit mode.

  • You can change the font type and font size for the entire QGIS interface in Settings > Options > General. Perhaps this setting overrides the QT designer setting. – csk Apr 18 '19 at 17:06
  • Thanks - however I'm trying to design an attribute form which appears the same to different users, so I need to understand what I can and cannot change for all of these users (with settings stored in the QT form or in the QGIS project which is set to use this form). – Rostranimin Apr 21 '19 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.