[Interest] QSplitter and resizing QGraphicsView problem

David Heremans david.heremans at intersoft-electronics.com
Thu Mar 12 13:38:06 CET 2015


Hello,

I have a slight problem  and was hoping that someone here could provide
some advice on how to handle/solve this.

Let me sketch my problem in plain old ASCII art here.

+----------+--------------------------------+-----------+
|          | +----------------------------+ |           |
|          | |                            | |           |
|          | |             item1          | |           |
|          | |                            | |           |
|          / |          item2             | /  label B  |
|          / |                            | /           |
|          / |           item3            | /           |
|          | |                            | |           |
|          | |                            | |           |
|          | +----------------------------+ |           |
|          |     label A                    |           |
+----------+--------------------------------+-----------+

My main window has 3 parts separated by a QSplitter. In the middle there
is a graphicsview and selecting the items in it cause the labels A and B
to be updated with info regarding the selected item. The items are
movable by dragging.

The problem manifests itself when starting to drag an item around.
The reason is that the size of the new label text can vary a lot. So it
is possible that label A or B becomes wider then its current panel
width. This will resize  the panel and shrink/grow the graphicsview, But
when you thenstart dragging your mouse then your mousepointer is still
on your monitor in the same 'monitor position' but with regards to the
scene it has now jumped quite some distance and your one pixel  movement
in the 'monitor coordinates' has much bigger impact on the 'scene
coordinates' and the item jumps several coordinates to the left or right.

If the panels could be made to only resize when a users drags the
splitter handles around this would probably solve my problem, but I
don't seem to find such an option in the documentation...
Is this indeed the solution I need to search for, or am I looking at
this problem the wrong way ?

rgds,

David H





-------------- next part --------------
A non-text attachment was scrubbed...
Name: testsplitterresize.tar.gz
Type: application/gzip
Size: 2278 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150312/5296d839/attachment.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3692 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150312/5296d839/attachment.bin>


More information about the Interest mailing list