Results 1 to 5 of 5

Thread: qlayout and setGeometry

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Question qlayout and setGeometry

    Hi, I can't set dimension of vlay0 (or wid0) how my own; I'd like set its width such as the width of a checkBox; I tried every setGeometry but seems don't work. Why?
    Qt Code:
    1. QGroupBox* box = new QGroupBox (myFrame);
    2. box->setGeometry(5,5,myFrame->width()-10, myFrame->height()-10);
    3. box->setTitle("title");
    4. QWidget* wid = new QWidget(box);
    5. QWidget* wid0 = new QWidget(wid);
    6. wid->setGeometry(QRect (20,20,100,50));
    7. wid->setBackgroundColor(QColor (10,100,50));
    8.  
    9. wid0->setGeometry(QRect (0,0,5,20));
    10. QBoxLayout* hlay = new QHBoxLayout (wid);
    11. QCheckBox* c0 = new QCheckBox(wid0);
    12. c0->setBackgroundColor(QColor (10,100,50));
    13. QVBoxLayout* vlay0 = new QVBoxLayout (wid0);
    14. QLabel* l0 = new QLabel (wid0);
    15. l0->setText("l0");
    16. l0->setBackgroundColor(QColor (100,1,150));
    17. vlay0->addWidget(c0);
    18. vlay0->addWidget(l0);
    19. hlay->addWidget(wid0);
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images
    Regards

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
  •  
Qt is a trademark of The Qt Company.