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. Checkbox
Qt 6.11 is out! See what's new in the release blog

Checkbox

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 1.7k 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.
  • Bhushan_SureB Offline
    Bhushan_SureB Offline
    Bhushan_Sure
    wrote on last edited by Bhushan_Sure
    #1

    Hi, I want to make a checkbox and i am able to do that but i want to resize "tick" and "rectangle" size in checkbox, To resize there is :- "checkboxstyle" and the code is given

    CheckBox {
         text: "Check Box"
         style: CheckBoxStyle {
             indicator: Rectangle {
                     implicitWidth: 16
                     implicitHeight: 16
                     radius: 3
                     border.color: control.activeFocus ? "darkblue" : "gray"
                     border.width: 1
                     Rectangle {
                         visible: control.checked
                         color: "#555"
                         border.color: "#333"
                         radius: 1
                         anchors.margins: 4
                         anchors.fill: parent
                     }
             }
         }
     }
    

    By doing this it is getting resize, but definitely i will not not get "tick" inside rectangle,
    i will get another rectangle, i searched for this online that how to resize checkbox with tick but i got that it's not possible as the "tick" is image and it's size is fixed.

    Is it right or wrong ?

    1 Reply Last reply
    0
    • ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      hi,
      @Bhushan_Sure said in Checkbox:

      indicator: Rectangle {

      You can do

      indicator :  Image{}
      

      and create your indicator image

      Bhushan_SureB 1 Reply Last reply
      2
      • ODБOïO ODБOï

        hi,
        @Bhushan_Sure said in Checkbox:

        indicator: Rectangle {

        You can do

        indicator :  Image{}
        

        and create your indicator image

        Bhushan_SureB Offline
        Bhushan_SureB Offline
        Bhushan_Sure
        wrote on last edited by
        #3

        @LeLev image source i have to give or QT will take system's image ?

        ODБOïO 1 Reply Last reply
        0
        • Bhushan_SureB Bhushan_Sure

          @LeLev image source i have to give or QT will take system's image ?

          ODБOïO Offline
          ODБOïO Offline
          ODБOï
          wrote on last edited by
          #4

          @Bhushan_Sure
          you can create a scalable image (.svg) with Inkscape for exemple, and set is as source of your indicator Image

          Bhushan_SureB 1 Reply Last reply
          3
          • ODБOïO ODБOï

            @Bhushan_Sure
            you can create a scalable image (.svg) with Inkscape for exemple, and set is as source of your indicator Image

            Bhushan_SureB Offline
            Bhushan_SureB Offline
            Bhushan_Sure
            wrote on last edited by
            #5

            @LeLev Thank you Very much, it Worked :)

            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