MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / setCustomWidget

Method setCustomWidget

ElaWidgetTools/ElaAppBar.cpp:252–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void ElaAppBar::setCustomWidget(ElaAppBarType::CustomArea customArea, QWidget* widget, QObject* hitTestObject, const QString& hitTestFunctionName)
253{
254 Q_D(ElaAppBar);
255 if (!widget || widget == this)
256 {
257 return;
258 }
259 widget->setMinimumHeight(0);
260 widget->setMaximumHeight(height());
261 widget->setParent(this);
262 int customAreaIndex = static_cast<int>(customArea);
263 d->_mainLayout->removeWidget(d->_customAreaWidgetList[customAreaIndex]);
264 d->_mainLayout->insertWidget(2 * customAreaIndex + 1, widget);
265 d->_customAreaWidgetList[customAreaIndex] = widget;
266 d->_customAreaHitTestObjectList[customAreaIndex] = hitTestObject;
267 d->_customAreaHitTestFunctionNameList[customAreaIndex] = hitTestFunctionName;
268 Q_EMIT customWidgetChanged();
269}
270
271QWidget* ElaAppBar::getCustomWidget(ElaAppBarType::CustomArea customArea) const
272{

Callers 1

initEdgeLayoutMethod · 0.45

Calls 1

removeWidgetMethod · 0.80

Tested by

no test coverage detected