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. spacing between two Text by using Column

spacing between two Text by using Column

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 1.0k 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
    RG90
    wrote on last edited by
    #1

    Hi ,

    I am working on implementing a column list that aligns at the beginning of the text, but I want to use different spacing between two text, how can I create a different spacing between two text manually. Is their is possibility of it ?

    Thanks.

    E 1 Reply Last reply
    0
    • R RG90

      Hi ,

      I am working on implementing a column list that aligns at the beginning of the text, but I want to use different spacing between two text, how can I create a different spacing between two text manually. Is their is possibility of it ?

      Thanks.

      E Offline
      E Offline
      Eeli K
      wrote on last edited by
      #2

      @RG90 Can you give a minimal working main.qml which has that column list and tell where you want that spacing? It's a bit difficult to understand it from your question.

      R 1 Reply Last reply
      0
      • E Eeli K

        @RG90 Can you give a minimal working main.qml which has that column list and tell where you want that spacing? It's a bit difficult to understand it from your question.

        R Offline
        R Offline
        RG90
        wrote on last edited by RG90
        #3

        @Eeli-K

        Here is the sample code, I want to use spacing between callerNumberText and callTimeText other than usual spacing. How, can I do manually?
        Column{

            id: activeCallInformation
        
            spacing: 5
            anchors{
                topMargin: 68
                leftMargin: 20
                bottomMargin: 20
                left: callerPhoto.right
                right: parent.right
                top: parent.top
            }
        
            Text
            {
                id: callerNameText
                color: T.textColorEnabled
                font.pixelSize: 38
                elide: Text.ElideRight
            }
        
            Image
            {
                id: numberTypeIcon
        
                source: (numberType != "")? T.theme + "/icon/phone_" + numberType + "_enabled.png" : ""
                anchors.verticalCenter: parent.verticalCenter
            }
        
            Text
            {
                id: callerNumberText
                color: T.textColorEnabled
                font.pixelSize: 38
                elide: Text.ElideRight
        
                onTextChanged:
                {
                    width = parent.width - 40 - numberTypeIcon.width;
                    width = contentWidth;
                }
            }
        
            Text
            {
                id: callTimeText
                //: This shows the elapsed time of the current phone call.
                //# REQ PHONE_01
                text: qsTranslate("", "%1").arg(callTime)+ Retranslate.whenLocaleOrLangChanges
                color: T.textColorEnabled
                font.pixelSize: 38
                elide: Text.ElideRight
            }
        
            Text
            {
                id: networkProviderText
                color: T.textColorEnabled
                font.pixelSize: 32
                elide: Text.ElideRight
            }
        }
        
        E 1 Reply Last reply
        0
        • R RG90

          @Eeli-K

          Here is the sample code, I want to use spacing between callerNumberText and callTimeText other than usual spacing. How, can I do manually?
          Column{

              id: activeCallInformation
          
              spacing: 5
              anchors{
                  topMargin: 68
                  leftMargin: 20
                  bottomMargin: 20
                  left: callerPhoto.right
                  right: parent.right
                  top: parent.top
              }
          
              Text
              {
                  id: callerNameText
                  color: T.textColorEnabled
                  font.pixelSize: 38
                  elide: Text.ElideRight
              }
          
              Image
              {
                  id: numberTypeIcon
          
                  source: (numberType != "")? T.theme + "/icon/phone_" + numberType + "_enabled.png" : ""
                  anchors.verticalCenter: parent.verticalCenter
              }
          
              Text
              {
                  id: callerNumberText
                  color: T.textColorEnabled
                  font.pixelSize: 38
                  elide: Text.ElideRight
          
                  onTextChanged:
                  {
                      width = parent.width - 40 - numberTypeIcon.width;
                      width = contentWidth;
                  }
              }
          
              Text
              {
                  id: callTimeText
                  //: This shows the elapsed time of the current phone call.
                  //# REQ PHONE_01
                  text: qsTranslate("", "%1").arg(callTime)+ Retranslate.whenLocaleOrLangChanges
                  color: T.textColorEnabled
                  font.pixelSize: 38
                  elide: Text.ElideRight
              }
          
              Text
              {
                  id: networkProviderText
                  color: T.textColorEnabled
                  font.pixelSize: 32
                  elide: Text.ElideRight
              }
          }
          
          E Offline
          E Offline
          Eeli K
          wrote on last edited by
          #4

          @RG90 At least couple of things come to mind. You can use the 'bottomPadding' or 'topPadding' property of Text. Or you can add an empty Item of certain height to the Column. Or you can embed a Text into an Item and add some empty space inside the Item.

          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