Results 1 to 2 of 2

Thread: add vertical spacer in QGridLayout

  1. #1
    Join Date
    Jan 2020
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default add vertical spacer in QGridLayout

    How to Add Vertical spacer in QGridLayout?.

    In my code (part) here:
    Qt Code:
    1. glMain->addWidget(lblHdg, 0, 0);
    2. glMain->setAlignment(lblHdg, Qt::AlignTop | Qt::AlignCenter);
    3. glMain->addLayout(hbxCh1, 1, 0);
    4. glMain->setAlignment(hbxCh1, Qt::AlignTop | Qt::AlignLeft);
    5. glMain->addLayout(hbxCh2, 2, 0);
    6. glMain->setAlignment(hbxCh2, Qt::AlignTop | Qt::AlignLeft);
    7. glMain->addItem(spcr, 3, 0, 4, 1);
    To copy to clipboard, switch view to plain text mode 

    it is giving error while i run. it is compiling, but gives "The program has unexpectedly finished." red error.
    Last edited by d_stranz; 9th January 2021 at 17:18. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: add vertical spacer in QGridLayout

    > QSpacerItem *spcr;

    Maybe you should initialize the pointer?

Similar Threads

  1. QGridLayout vertical spacing
    By tvj4218 in forum Newbie
    Replies: 1
    Last Post: 12th January 2018, 22:22
  2. Replies: 1
    Last Post: 24th January 2014, 07:28
  3. Code for Horizontal spacer
    By Gary7 in forum Newbie
    Replies: 2
    Last Post: 15th August 2012, 05:52
  4. Replies: 1
    Last Post: 20th May 2011, 18:36
  5. Designer: Spacer doesn't do what I want...
    By jochen_r in forum Qt Tools
    Replies: 3
    Last Post: 19th January 2006, 06:23

Tags for this Thread

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.