Results 1 to 6 of 6

Thread: [QSplitter] How to prevent splitter snapping?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [QSplitter] How to prevent splitter snapping?

    Hi all,

    I can't seem to find the right method to disable QSplitter handle from snapping to the edge of the geometry when it's close to it. This snapping doesn't happen if one uses Designer instead of coding by hand. Also already tried to look into the code generated by Designer but there's nothing there to indicate the right method to prevent this.

    Any pointers as to what method should I be looking for?

    TIA.

    Best Regards,
    Faizol

  2. #2
    Join Date
    Sep 2012
    Location
    Iran, Tehran
    Posts
    76
    Thanks
    17
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Post Re: [QSplitter] How to prevent splitter snapping?


  3. #3
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [QSplitter] How to prevent splitter snapping?

    I realized now that the snapping behavior is totally depending on the child widget. The snapping doesn't occur if the child widget is a QFrame object, but will happen if it's a QTextEdit object, for example.

    Thanks.

  4. #4
    Join Date
    Sep 2012
    Location
    Iran, Tehran
    Posts
    76
    Thanks
    17
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: [QSplitter] How to prevent splitter snapping?

    QTextEdit is also a QFrame it inherits QFrame.
    Using something like
    Qt Code:
    1. splitter.setCollapsible(index,false);
    To copy to clipboard, switch view to plain text mode 
    to prevent the effect.

  5. #5
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [QSplitter] How to prevent splitter snapping?

    Thanks. I actually did try that, but the handle just stop at certain percentage instead of collapsing. What I wanted to do was to be able to drag the handle to the edge of the area without snapping. I could achieve this with QFrame.

    Again, thanks.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: [QSplitter] How to prevent splitter snapping?

    It depends on the size hint and size policy of the widget, not its class.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QSplitter like a "grid" splitter [Using qt 4.4]
    By yandy in forum Qt Programming
    Replies: 7
    Last Post: 22nd March 2012, 06:42
  2. thin splitter
    By nikkymen in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2011, 09:16
  3. QTableWidget: Disable 'snapping' to rows and columns?
    By PolyVox in forum Qt Programming
    Replies: 2
    Last Post: 8th October 2008, 20:04
  4. Splitter?
    By Katuakina in forum Qt Programming
    Replies: 1
    Last Post: 5th October 2007, 09:21
  5. splitter
    By gambr in forum Qt Tools
    Replies: 2
    Last Post: 21st November 2006, 17:06

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.