Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML embed text inside a RadioButton

QML embed text inside a RadioButton

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ruysch
    wrote on last edited by
    #1

    Is it possible to have a RadioButton where the text is part of the button and not as usual placed at the side of the button?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t3685
      wrote on last edited by
      #2

      If you are using the RadioButton from Qt.Quick.Controls you can make your own "RadioButtonStyle":http://qt-project.org/doc/qt-5/qml-qtquick-controls-styles-radiobuttonstyle.html

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        You can style RadioButton as previous post indicated. You can also develop your own radio button like the following.

        @Rectangle {
        width: 40
        height: 40
        radius: width/2
        border.color: "black"
        border.width: 2
        Rectangle {
        id :radio
        anchors.centerIn: parent
        width: parent.width-10
        height: parent.height-10
        radius: width/2
        border.width: 1
        border.color: "black"
        Text {
        anchors.centerIn: parent
        text: "Wor"
        }
        }
        MouseArea {
        anchors.fill: parent
        onClicked: {
        radio.color = "black"
        }
        }
        }@

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved