MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / DockWidget

Method DockWidget

gui/qt/dockwidget.cpp:13–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <QtGui/QScreen>
12
13DockWidget::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
27DockWidget::DockWidget(const QString &title, QWidget *parent) : DockWidget{parent} {
28 setWindowTitle(title);

Callers

nothing calls this directly

Calls 1

setExpandableFunction · 0.85

Tested by

no test coverage detected