Results 1 to 3 of 3

Thread: stitch 4 QSpinBox without margin ?

  1. #1
    Join Date
    Oct 2009
    Posts
    16
    Qt products
    Qt4
    Platforms
    Windows

    Default stitch 4 QSpinBox without margin ?

    Hello,

    I try to stitch 4 QSpinBox using the following code:

    QWidget* w = new QWidget();
    QGridLayout* grid = new QGridLayout(w);
    grid->setMargin(0);
    grid->addWidget(new QSpinBox(), 1, 1);
    grid->addWidget(new QSpinBox(), 1, 2);
    grid->addWidget(new QSpinBox(), 2, 1);
    grid->addWidget(new QSpinBox(), 2, 2);

    However, I get this:


    So there's still a 5/6 pixels margin between SpinBox I want to get rid off... Any way to do this ?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: stitch 4 QSpinBox without margin ?

    Hi,

    please use the [code] tags next time and also add the images at the board and not on a 3rd party site. This is to keep the posts consistent a long time.

    As for your problem have a look at QGridLayout::setSpacing().

    Lykurg

  3. #3
    Join Date
    Oct 2009
    Posts
    16
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: stitch 4 QSpinBox without margin ?

    ok

    thanks !

Similar Threads

  1. QTableView and margin
    By miraks in forum Qt Programming
    Replies: 6
    Last Post: 17th May 2009, 15:14
  2. Layout without margin??
    By zlosynus in forum Qt Programming
    Replies: 1
    Last Post: 2nd August 2008, 09:59
  3. Disable margin when using QMdiArea
    By vql in forum Qt Programming
    Replies: 1
    Last Post: 10th April 2008, 16:07
  4. zero'ing margin in a qhboxlayout
    By illuzioner in forum Qt Programming
    Replies: 3
    Last Post: 2nd July 2007, 10:54
  5. How to Set margin
    By suresh in forum Newbie
    Replies: 1
    Last Post: 5th October 2006, 06:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.