Results 1 to 8 of 8

Thread: dynamically building qdialog at runtime

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    May 2012
    Posts
    57
    Thanks
    11
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: dynamically building qdialog at runtime

    LOL

    I already was wondering about those 'new QLabel' etc.

    Thanks.


    Added after 34 minutes:


    I still haven't got it right. I have created the widgets in the constructor in stead of on the stack.
    When I set the layout of box2 to a simple widget, it works, but if I set it to layout2, the program crashes badly.

    Qt Code:
    1. //----------------------------------
    2. void Edit::makeform(bool landscape)
    3. {
    4. layout1->addRow(labelname, editname);
    5. layout1->addRow(labeldate, editdate);
    6. layout1->addRow(labeltime, edittime);
    7. box1->setLayout(layout1);
    8. layout2->addRow(labeldst, editdst);
    9. box2->setLayout(layout2);
    10. vlayout->addWidget(box1);
    11. vlayout->addWidget(box2);
    12. vlayout->addWidget(buttons);
    13. setLayout(vlayout);
    14. setWindowTitle(landscape ? "landscape" : "portrait");
    15. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by Cremers; 23rd October 2012 at 20:41.

Similar Threads

  1. Replies: 9
    Last Post: 25th March 2011, 21:22
  2. QDialog.exec() exiting without calling QDialog::accept()
    By doggrant in forum Qt Programming
    Replies: 3
    Last Post: 2nd February 2011, 11:35
  3. Replies: 1
    Last Post: 25th September 2010, 08:20
  4. Replies: 8
    Last Post: 21st March 2010, 11:31
  5. closing a Qdialog called from a Qdialog
    By OverTheOCean in forum Qt Programming
    Replies: 3
    Last Post: 28th September 2009, 08:02

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.