MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / setWidget

Method setWidget

Gui/FloatingWidget.cpp:111–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void
112FloatingWidget::setWidget(QWidget* w)
113{
114 QSize widgetSize = w->size();
115
116 assert(w);
117 if (_embeddedWidget) {
118 return;
119 }
120 _embeddedWidget = w;
121 _scrollArea->setWidget(w);
122 w->setVisible(true);
123 w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
124
125#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
126 QScreen* desktop = QGuiApplication::primaryScreen();
127 assert(desktop != nullptr);
128 QRect geom = desktop->availableGeometry();
129#else
130 QDesktopWidget* dw = qApp->desktop();
131 assert(dw);
132 QRect geom = dw->screenGeometry();
133#endif
134 widgetSize.setWidth( std::min( widgetSize.width(), geom.width() ) );
135 widgetSize.setHeight( std::min( widgetSize.height(), geom.height() ) );
136 resize(widgetSize);
137 show();
138}
139
140void
141FloatingWidget::removeEmbeddedWidget()

Callers 8

floatPaneMethod · 0.80
splitInternalMethod · 0.80
stopDragTabMethod · 0.80
restoreLayoutMethod · 0.80
floatPanelMethod · 0.80
getOrCreatePageMethod · 0.80

Calls 6

setWidthMethod · 0.80
resizeFunction · 0.50
sizeMethod · 0.45
setVisibleMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected