widgets: add ClippingWrapperRectangle

This commit is contained in:
outfoxxed 2024-11-19 02:52:49 -08:00
parent 401ee4cec6
commit 033e810871
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
7 changed files with 63 additions and 4 deletions

View file

@ -11,7 +11,11 @@
namespace qs::widgets {
void WrapperManager::componentComplete() {
this->mWrapper = qobject_cast<QQuickItem*>(this->parent());
if (this->mAssignedWrapper) {
this->mWrapper = this->mAssignedWrapper;
} else {
this->mWrapper = qobject_cast<QQuickItem*>(this->parent());
}
if (!this->mWrapper) {
QString pstr;
@ -118,6 +122,17 @@ void WrapperManager::onChildDestroyed() {
emit this->childChanged();
}
QQuickItem* WrapperManager::wrapper() const { return this->mWrapper; }
void WrapperManager::setWrapper(QQuickItem* wrapper) {
if (this->mWrapper) {
qmlWarning(this) << "Cannot set wrapper after WrapperManager initialization.";
return;
}
this->mAssignedWrapper = wrapper;
}
void WrapperManager::printChildCountWarning() const {
qmlWarning(this->mWrapper) << "Wrapper component cannot have more than one visual child.";
qmlWarning(this->mWrapper) << "Remove all additional children, or pick a specific component "