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. Choose item library
Forum Updated to NodeBB v4.3 + New Features

Choose item library

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 740 Views 1 Watching
  • 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.
  • RomanoFXR Offline
    RomanoFXR Offline
    RomanoFX
    wrote on last edited by
    #1

    Hi,

    In QtQuick, the CheckBox item is present in two libraries QtQuick Controls and in Qt Labs Controls.

    How choosing the good one when declaring a new CheckBox in QML?

    Thank you

    p3c0P 1 Reply Last reply
    0
    • RomanoFXR RomanoFX

      Hi,

      In QtQuick, the CheckBox item is present in two libraries QtQuick Controls and in Qt Labs Controls.

      How choosing the good one when declaring a new CheckBox in QML?

      Thank you

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @RomanoFX,

      As per this document Qt Labs Controls are supposed to be used on embedded systems.

      157

      1 Reply Last reply
      1
      • RomanoFXR Offline
        RomanoFXR Offline
        RomanoFX
        wrote on last edited by
        #3

        Thank you for that explanation.
        However, if I want use CheckBox from the two libraries in a single QML file, it exists a way to assign the good one?

        p3c0P 1 Reply Last reply
        0
        • RomanoFXR RomanoFX

          Thank you for that explanation.
          However, if I want use CheckBox from the two libraries in a single QML file, it exists a way to assign the good one?

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @RomanoFX You can use Alias'es using as. For eg:

          import QtQuick 2.5
          import QtQuick.Controls 1.4 as Desktop
          import Qt.labs.controls 1.0 as Embed
          
          Item {
              width: 200
              height: 200
          
              Desktop.CheckBox {
                  checked: true
                  text: "Desktop"
              }
          
              Embed.CheckBox {
                  y: 50
                  checked: false
                  text: "Embedded"
              }
          }
          

          157

          1 Reply Last reply
          1

          • Login

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