Results 1 to 2 of 2

Thread: QSplitter not moving programatically [SOLVED]

  1. #1
    Join Date
    May 2011
    Posts
    23
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QSplitter not moving programatically [SOLVED]

    Hi

    I'm trying to move the splitter handle to its left with the following code, but it's not moving:
    QSplitter::setHandleWidth(1);
    QSplitterHandle* psh1 = QSplitter::handle(1);
    QRect qr = psh1->geometry();
    psh1->move(qr.x()-60, qr.y());

    Is it even possible? (See attached picture)

    Jean

    splitter.jpg

    I solved it with:
    QList<int> sizes;
    sizes.append(desired_left_width);
    sizes.append(parentwidth - desired_left_width);
    QSplitter::setSizes(sizes);
    Last edited by jeanremi; 28th May 2011 at 12:41.

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: QSplitter not moving programatically [SOLVED]

    Thank you for telling how you solved it -- that is so rare, but usefull, and polite to those who spent their time trying to figure it out.

Similar Threads

  1. getting attached curve to a plot
    By corrado1972 in forum Qwt
    Replies: 2
    Last Post: 22nd June 2011, 09:35
  2. How to setFocus to QMenuBar programatically?
    By ticvitanic in forum Qt Programming
    Replies: 0
    Last Post: 2nd July 2010, 15:58
  3. Replies: 0
    Last Post: 24th May 2010, 12:19
  4. Replies: 2
    Last Post: 26th March 2009, 08:43

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.