Results 1 to 14 of 14

Thread: dont want to scroll

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Posts
    51
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default Re: dont want to scroll

    yes sir i got it thanks but i think i will need you help with the layout more. thanks

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: dont want to scroll

    Sure, you are welcome

  3. #3
    Join Date
    Mar 2011
    Posts
    51
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default Re: dont want to scroll

    Sir i got an other problem i am calling all these statements in my button event handler like this
    Qt Code:
    1. void analysis::on_pushButton_clicked()
    2. {
    3. myplot * p = new myplot(gao.structpayloadgraph,gao1.structpayloadgraph, gao.structcol-2, "payload");
    4.  
    5. myplot * p1 = new myplot(gao.structsessiongraph,gao.structsessiongraph ,gao.structcol-2, "session");
    6.  
    7.  
    8. QHBoxLayout * layout = new QHBoxLayout;
    9. ui->horizontalLayout_2->addLayout(layout);
    10. layout->addWidget(p);
    11. layout->addWidget(p1);
    12. }
    To copy to clipboard, switch view to plain text mode 

    but the problem is that each time i click the button new graph appear and previous remains, like one !st click 2 appear on second they become 4 then 6......
    how to i destroy QHBoxLayout in my button event handler

    thanks

  4. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: dont want to scroll

    Add this in the beginning of the slot (i assume ui->horizontalLayout_2 does not have anything else, other than the layout you add)

    Qt Code:
    1. void analysis::on_pushButton_clicked()
    2. {
    3. QLayoutItem *child;
    4. while ((child = ui->horizontalLayout_2->takeAt(0)) != 0) {
    5. delete child;
    6. }
    7.  
    8. ....
    9. }
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to Santosh Reddy for this useful post:

    maarvi (27th June 2011)

  6. #5
    Join Date
    Mar 2011
    Posts
    51
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default Re: dont want to scroll

    thank u so much sir for your help


    Added after 5 minutes:


    sir the previous on is still not removing now graph is drawn over one an other
    Last edited by maarvi; 27th June 2011 at 13:19.

  7. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: dont want to scroll

    See your other thread: http://www.qtcentre.org/threads/42750-destroy-QHBoxLayout

    Please refrain from asking the same question in multiple places.

Similar Threads

  1. I dont see any linewidth on a splitter ...
    By tonnot in forum Newbie
    Replies: 3
    Last Post: 31st March 2011, 21:06
  2. QDial disabling key scroll and mouse wheel scroll
    By ldg20 in forum Qt Programming
    Replies: 2
    Last Post: 2nd June 2010, 23:05
  3. Replies: 0
    Last Post: 28th December 2009, 12:24
  4. QGraphicsView dont refresh
    By ProTonS in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2009, 14:05
  5. Replies: 6
    Last Post: 14th April 2006, 05:39

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