File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919#include < QColor>
2020#include < QMainWindow>
2121#include < QRect>
22+ #include < QSize>
2223#include < QString>
2324#include < QWidget>
2425
@@ -37,12 +38,22 @@ class AwayDockBody : public QWidget
3738public:
3839 // Fixed at a pixel across the divider; free along it, so the dock — and
3940 // the separator Qt reserves beside it — runs the whole of its area.
40- explicit AwayDockBody (Qt::Orientation across, QWidget* parent = nullptr ) : QWidget(parent)
41+ explicit AwayDockBody (Qt::Orientation across, QWidget* parent = nullptr )
42+ : QWidget(parent), m_across(across)
4143 {
4244 if (across == Qt::Vertical) setFixedWidth (1 ); // a column at the side
4345 else setFixedHeight (1 ); // a row at the foot
4446 setAutoFillBackground (true ); // the divider's background, set by setAwayDockColour
4547 }
48+
49+ // A size of its own. A widget without a layout answers an invalid -1,
50+ // and Qt 6.4's dock layout took the dock's minimum from it: (1, -1),
51+ // which it then refused with a warning.
52+ QSize sizeHint () const override { return m_across == Qt::Vertical ? QSize (1 , 0 ) : QSize (0 , 1 ); }
53+ QSize minimumSizeHint () const override { return sizeHint (); }
54+
55+ private:
56+ Qt::Orientation m_across;
4657};
4758
4859inline QDockWidget* makeAwayDock (QMainWindow* window, const QString& name, Qt::DockWidgetArea area)
You can’t perform that action at this time.
0 commit comments