Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34661

Button control supports font property.

    XMLWordPrintable

Details

    Description

      Button controls could have a font property (e.g. TextField) or a font property exposed in the ButtonStyle.

      Currently, there is no possible way to change the font or the size of the text of the Button control.

      TextField {
      	width: applicationWindow.width / 2
      	text: qsTr("Lorem ipsum dolor sit amet.")
      	font {
      		family: "Helvetica"
      		pointSize: 32
      		bold: false
      	}
      }
      Button {
      	text: qsTr("Lorem ipsum dolor sit amet.")
      	style: ButtonStyle {
      		background: Rectangle {
      			implicitWidth: 100
      			implicitHeight: 25
      			border.width: control.activeFocus ? 2 : 1
      			border.color: "#888"
      			radius: 4
      			gradient: Gradient {
      				GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" }
      				GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" }
      			}
      		}
      	}
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            leonlee Leonard Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes