Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. setSpacing not working
Forum Updated to NodeBB v4.3 + New Features

setSpacing not working

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 497 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    8e2fc1fc-ce39-432e-8ca8-683a150bf8d3-image.png

    for (int i = 0; i < m_nItemCnt; i++)
    {
            CItems* pItem = new CItems(size, this);	
    
    	this->ui.GL_title->addWidget(this->ui.label, 0, 0, 0, m_lstIncubateItems.length());
    	this->ui.HL_items->addWidget(pItem);
    	this->ui.HL_items->setSpacing(1);	
    }
    

    When the first item is created, the spacing property works, but if the second and third are added, the spacing property is not applied.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by ChrisW67
      #2

      What is a CItem? What type of object is ui.GL_title? ui.HL_items?
      Which of the bits of that picture are the three items you refer to?
      Why do you think setSpacing() is not working?

      We can guess, but should not have to.

      At first glance this->ui.label, i.e. the same instance, gets sent to addWidget() multiple times... suspicious

      I 1 Reply Last reply
      0
      • C ChrisW67

        What is a CItem? What type of object is ui.GL_title? ui.HL_items?
        Which of the bits of that picture are the three items you refer to?
        Why do you think setSpacing() is not working?

        We can guess, but should not have to.

        At first glance this->ui.label, i.e. the same instance, gets sent to addWidget() multiple times... suspicious

        I Offline
        I Offline
        IknowQT
        wrote on last edited by
        #3

        @ChrisW67

        I'll explain the structure. Citems class is customized Ui.
        There's a userItem class in the Citems class.

        Textlabel needs to change dynamically depending on the number of useritems.

        9d1ed02e-6b1d-4a6b-ae9b-edb6b3e3dd34-image.png

        I've been labelling it several times to increase the Colspan on the grid layout.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          In your first image I see two sets of three equally sized widgets in two separate horizontal layouts.
          In your latest image I see three equally sized widgets in a horizontal layout.
          I assume your complaint is that you cannot see a 1 pixel vertical line between the second and third widget in each horizontal layout.

          What are the constraints on the size of the CItems and horizontal layouts that contain them?

          I 1 Reply Last reply
          0
          • C ChrisW67

            In your first image I see two sets of three equally sized widgets in two separate horizontal layouts.
            In your latest image I see three equally sized widgets in a horizontal layout.
            I assume your complaint is that you cannot see a 1 pixel vertical line between the second and third widget in each horizontal layout.

            What are the constraints on the size of the CItems and horizontal layouts that contain them?

            I Offline
            I Offline
            IknowQT
            wrote on last edited by
            #5

            @ChrisW67
            845f2ecb-2286-483c-8cbe-6c036d38b0f8-image.png

            8696b34c-5db1-46f0-abe3-c1dbe996a1b1-image.png

            The constraints are the same

            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