| 11 | #include <QtGui/QScreen> |
| 12 | |
| 13 | DockWidget::DockWidget(QWidget *parent) |
| 14 | : QDockWidget{parent}, m_titleHide{new QWidget{this}}, m_tabs{this}, |
| 15 | m_closable{true}, m_expandable{true} { |
| 16 | // If we just use a vanilla new QWidget for m_titleHide, as a Qt source |
| 17 | // comment tells us to, then m_titleHide->sizeHint() will return {-1, -1} |
| 18 | // which, as the exact same Qt comment hints at, doesn't work and causes, |
| 19 | // at the very least, one pixel to be cropped off of the top of the dock's |
| 20 | // child widget. Therefore, our two choices are to subclass QWidget and |
| 21 | // override sizeHint and minimumSizeHint to both return {0, 0}, or to just |
| 22 | // set a dummy layout as we do below. |
| 23 | m_titleHide->setLayout(new QStackedLayout{m_titleHide}); |
| 24 | m_closeablefloat = false; |
| 25 | } |
| 26 | |
| 27 | DockWidget::DockWidget(const QString &title, QWidget *parent) : DockWidget{parent} { |
| 28 | setWindowTitle(title); |
nothing calls this directly
no test coverage detected