| 250 | } |
| 251 | |
| 252 | void 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 | |
| 271 | QWidget* ElaAppBar::getCustomWidget(ElaAppBarType::CustomArea customArea) const |
| 272 | { |
no test coverage detected