Multi-view geometry computations. More...
#include <multiviewlayout.h>
Public Member Functions | |
| MultiViewLayout ()=default | |
| float | splitX () const |
| float | splitY () const |
| void | setSplitX (float x) |
| void | setSplitY (float y) |
| void | resetSplits () |
| int | hitTolerancePx () const |
| int | minPanePx () const |
| int | separatorLinePx () const |
| QRect | slotRect (int slot, int numEnabled, const QSize &outputSize) const |
| SplitterHit | hitTestSplitter (const QPoint &pos, int numEnabled, const QSize &outputSize) const |
| int | viewportIndexAt (const QPoint &pos, const QVector< int > &enabledViewports, const QSize &outputSize) const |
| QRect | insetForSeparator (const QRect &paneRect, int slot, int numEnabled) const |
| void | separatorGeometries (int numEnabled, const QSize &widgetSize, QRect &verticalRect, QRect &horizontalRect) const |
| void | dragSplitter (const QPoint &pos, SplitterHit activeSplitter, const QSize &widgetSize) |
Static Public Member Functions | |
| static Qt::CursorShape | cursorForHit (SplitterHit hit) |
Multi-view geometry computations.
Pure-geometry class for multi-view viewport layout.
This class has no widget dependencies — it works with sizes, rectangles, and fractional split positions. The hosting widget queries this class for rectangles and hit-test results, and updates separator widgets accordingly.
Layout rules:
Definition at line 78 of file multiviewlayout.h.
|
default |
Constructor.
|
static |
Return the Qt::CursorShape appropriate for a splitter hit.
| [in] | hit | Hit-test result. |
Definition at line 149 of file multiviewlayout.cpp.
| void MultiViewLayout::dragSplitter | ( | const QPoint & | pos, |
| SplitterHit | activeSplitter, | ||
| const QSize & | widgetSize ) |
Update split fractions from a mouse drag position.
| [in] | pos | Current cursor position. |
| [in] | activeSplitter | Which splitter is being dragged. |
| [in] | widgetSize | Widget size in pixels. |
Definition at line 269 of file multiviewlayout.cpp.
| SplitterHit MultiViewLayout::hitTestSplitter | ( | const QPoint & | pos, |
| int | numEnabled, | ||
| const QSize & | outputSize ) const |
Hit-test the splitter bars.
| [in] | pos | Cursor position (widget coords). |
| [in] | numEnabled | Total number of enabled panes. |
| [in] | outputSize | Total output pixel size. |
Definition at line 104 of file multiviewlayout.cpp.
|
inline |
Definition at line 97 of file multiviewlayout.h.
| QRect MultiViewLayout::insetForSeparator | ( | const QRect & | paneRect, |
| int | slot, | ||
| int | numEnabled ) const |
Apply a separator-pixel inset to a pane rect so adjacent panes don't overlap the separator bar. This is used in the render loop to trim viewports.
| [in] | paneRect | Original pane rectangle. |
| [in] | slot | Slot index (0-based). |
| [in] | numEnabled | Total enabled count. |
Definition at line 176 of file multiviewlayout.cpp.
|
inline |
Definition at line 98 of file multiviewlayout.h.
|
inline |
Definition at line 93 of file multiviewlayout.h.
| void MultiViewLayout::separatorGeometries | ( | int | numEnabled, |
| const QSize & | widgetSize, | ||
| QRect & | verticalRect, | ||
| QRect & | horizontalRect ) const |
Compute the separator widget geometries.
| [in] | numEnabled | Number of enabled panes. |
| [in] | widgetSize | Widget size in pixels. |
| [out] | verticalRect | Geometry for the vertical separator (empty if hidden). |
| [out] | horizontalRect | Geometry for the horizontal separator (empty if hidden). |
Definition at line 218 of file multiviewlayout.cpp.
|
inline |
Definition at line 99 of file multiviewlayout.h.
|
inline |
Definition at line 91 of file multiviewlayout.h.
|
inline |
Definition at line 92 of file multiviewlayout.h.
| QRect MultiViewLayout::slotRect | ( | int | slot, |
| int | numEnabled, | ||
| const QSize & | outputSize ) const |
Compute the pixel rectangle for a layout slot.
| [in] | slot | Slot index (0-based among enabled viewports). |
| [in] | numEnabled | Total number of enabled panes (1–4). |
| [in] | outputSize | Total output pixel size. |
Definition at line 48 of file multiviewlayout.cpp.
|
inline |
Definition at line 89 of file multiviewlayout.h.
|
inline |
Definition at line 90 of file multiviewlayout.h.
| int MultiViewLayout::viewportIndexAt | ( | const QPoint & | pos, |
| const QVector< int > & | enabledViewports, | ||
| const QSize & | outputSize ) const |
Given a cursor position and output size, determine which viewport index the cursor is in.
| [in] | pos | Cursor position (widget coords). |
| [in] | enabledViewports | Ordered list of enabled viewport indices. |
| [in] | outputSize | Total output pixel size. |
Definition at line 161 of file multiviewlayout.cpp.