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. [Solved]How to avoid Gap/Space between my custom widgets ?
Forum Updated to NodeBB v4.3 + New Features

[Solved]How to avoid Gap/Space between my custom widgets ?

Scheduled Pinned Locked Moved General and Desktop
25 Posts 8 Posters 10.1k 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.
  • C Offline
    C Offline
    Charles.qt
    wrote on last edited by
    #15

    Woody
    i am adding my custom widget through coding,

    @ widget1 = new CustomWidget();
    widget1->ui->pushButton->setText("SECTION 1");
    widget2 = new CustomWidget();
    widget2->ui->pushButton->setText("SECTION 2");
    widget3 = new CustomWidget();
    widget3->ui->pushButton->setText("SECTION 3");
    widget4 = new CustomWidget();
    widget4->ui->pushButton->setText("SECTION 4");@

    How can i add Spacer to that? Thats why Rahul said to try setSpacing(),That also not works.

    Thankyou for your information.

    1 Reply Last reply
    0
    • W Offline
      W Offline
      Woody
      wrote on last edited by
      #16

      Aah ok, sorry for the misunderstanding.

      Something like this: "QSpacerItem":http://qt-project.org/doc/qt-4.8/qspaceritem.html

      I didn't really looked into it. I'm using the graphical designer do achieve this.

      Hopes this works out for you.

      File not found. Nobody leave the room!

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Charles.qt
        wrote on last edited by
        #17

        Woody,

        I checked QSpacerItem,there is no need for using this class, spacing can be acheived by calling the method setSpacing().So i already tried setSpacing(),this also not works.

        1 Reply Last reply
        0
        • W Offline
          W Offline
          Woody
          wrote on last edited by
          #18

          Mmh that is strange. You probably set a layout to the parent widget?

          Is it possible to provide the code, so I can have a better look?

          File not found. Nobody leave the room!

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Rahul Das
            wrote on last edited by
            #19

            Sweeten, Try the combination of spacer in VBoxLayout. It works.


            Declaration of (Platform) independence.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Charles.qt
              wrote on last edited by
              #20

              I have uploaded my full project . Just run the application and see the Gap between the custom widgets(Section 1,Section 2,Section 3 & Section 4).

              Your suggestions are welcome.

              "Accordion Test":http://www.4shared.com/zip/rPHyPhdL/AccordionTest.html

              1 Reply Last reply
              0
              • C Offline
                C Offline
                Charles.qt
                wrote on last edited by
                #21

                Guys any suggestion..

                1 Reply Last reply
                0
                • W Offline
                  W Offline
                  Woody
                  wrote on last edited by
                  #22

                  Sorry I can't download it, haven't got an account. Will get it tonight.

                  File not found. Nobody leave the room!

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    Charles.qt
                    wrote on last edited by
                    #23

                    I have done .Thankyou all for your support.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      Sam
                      wrote on last edited by
                      #24

                      Kindly edit your title and preprend [Solved] to it.

                      Thanks :)

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        Charles.qt
                        wrote on last edited by
                        #25

                        Thank you Sam for your information ,i have edited my title as Solved.

                        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