quick: fix a regression
Looks like we can't use overloads in QML documents. Should fix #183 Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
648876b6b0
commit
3961ecb505
|
@ -74,7 +74,9 @@ public Q_SLOTS:
|
||||||
void setTitleBarItem(QQuickItem *value);
|
void setTitleBarItem(QQuickItem *value);
|
||||||
void setSystemButton(QQuickItem *item, const QuickGlobal::SystemButtonType buttonType);
|
void setSystemButton(QQuickItem *item, const QuickGlobal::SystemButtonType buttonType);
|
||||||
void setHitTestVisible(QQuickItem *item, const bool visible = true);
|
void setHitTestVisible(QQuickItem *item, const bool visible = true);
|
||||||
void setHitTestVisible(const QRect &rect, const bool visible = true);
|
void setHitTestVisible_rect(const QRect &rect, const bool visible = true);
|
||||||
|
void setHitTestVisible_object(QObject *object, const bool visible = true);
|
||||||
|
void setHitTestVisible_item(QQuickItem *item, const bool visible = true);
|
||||||
|
|
||||||
void showSystemMenu(const QPoint &pos);
|
void showSystemMenu(const QPoint &pos);
|
||||||
void windowStartSystemMove2(const QPoint &pos);
|
void windowStartSystemMove2(const QPoint &pos);
|
||||||
|
|
|
@ -59,6 +59,7 @@ public:
|
||||||
void setSystemButton(QQuickItem *item, const QuickGlobal::SystemButtonType buttonType);
|
void setSystemButton(QQuickItem *item, const QuickGlobal::SystemButtonType buttonType);
|
||||||
void setHitTestVisible(QQuickItem *item, const bool visible = true);
|
void setHitTestVisible(QQuickItem *item, const bool visible = true);
|
||||||
void setHitTestVisible(const QRect &rect, const bool visible = true);
|
void setHitTestVisible(const QRect &rect, const bool visible = true);
|
||||||
|
void setHitTestVisible(QObject *object, const bool visible = true);
|
||||||
void showSystemMenu(const QPoint &pos);
|
void showSystemMenu(const QPoint &pos);
|
||||||
void windowStartSystemMove2(const QPoint &pos);
|
void windowStartSystemMove2(const QPoint &pos);
|
||||||
void windowStartSystemResize2(const Qt::Edges edges, const QPoint &pos);
|
void windowStartSystemResize2(const Qt::Edges edges, const QPoint &pos);
|
||||||
|
|
|
@ -68,6 +68,7 @@ public Q_SLOTS:
|
||||||
void setSystemButton(QWidget *widget, const Global::SystemButtonType buttonType);
|
void setSystemButton(QWidget *widget, const Global::SystemButtonType buttonType);
|
||||||
void setHitTestVisible(QWidget *widget, const bool visible = true);
|
void setHitTestVisible(QWidget *widget, const bool visible = true);
|
||||||
void setHitTestVisible(const QRect &rect, const bool visible = true);
|
void setHitTestVisible(const QRect &rect, const bool visible = true);
|
||||||
|
void setHitTestVisible(QObject *object, const bool visible = true);
|
||||||
|
|
||||||
void showSystemMenu(const QPoint &pos);
|
void showSystemMenu(const QPoint &pos);
|
||||||
void windowStartSystemMove2(const QPoint &pos);
|
void windowStartSystemMove2(const QPoint &pos);
|
||||||
|
|
|
@ -56,6 +56,7 @@ public:
|
||||||
void setSystemButton(QWidget *widget, const Global::SystemButtonType buttonType);
|
void setSystemButton(QWidget *widget, const Global::SystemButtonType buttonType);
|
||||||
void setHitTestVisible(QWidget *widget, const bool visible = true);
|
void setHitTestVisible(QWidget *widget, const bool visible = true);
|
||||||
void setHitTestVisible(const QRect &rect, const bool visible = true);
|
void setHitTestVisible(const QRect &rect, const bool visible = true);
|
||||||
|
void setHitTestVisible(QObject *object, const bool visible = true);
|
||||||
void showSystemMenu(const QPoint &pos);
|
void showSystemMenu(const QPoint &pos);
|
||||||
void windowStartSystemMove2(const QPoint &pos);
|
void windowStartSystemMove2(const QPoint &pos);
|
||||||
void windowStartSystemResize2(const Qt::Edges edges, const QPoint &pos);
|
void windowStartSystemResize2(const Qt::Edges edges, const QPoint &pos);
|
||||||
|
|
|
@ -333,6 +333,20 @@ void FramelessQuickHelperPrivate::setHitTestVisible(const QRect &rect, const boo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FramelessQuickHelperPrivate::setHitTestVisible(QObject *object, const bool visible)
|
||||||
|
{
|
||||||
|
Q_ASSERT(object);
|
||||||
|
if (!object) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto item = qobject_cast<QQuickItem *>(object);
|
||||||
|
Q_ASSERT(item);
|
||||||
|
if (!item) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setHitTestVisible(item, visible);
|
||||||
|
}
|
||||||
|
|
||||||
void FramelessQuickHelperPrivate::showSystemMenu(const QPoint &pos)
|
void FramelessQuickHelperPrivate::showSystemMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WINDOWS
|
#ifdef Q_OS_WINDOWS
|
||||||
|
@ -1017,15 +1031,10 @@ void FramelessQuickHelper::setSystemButton(QQuickItem *item, const QuickGlobal::
|
||||||
|
|
||||||
void FramelessQuickHelper::setHitTestVisible(QQuickItem *item, const bool visible)
|
void FramelessQuickHelper::setHitTestVisible(QQuickItem *item, const bool visible)
|
||||||
{
|
{
|
||||||
Q_ASSERT(item);
|
setHitTestVisible_item(item, visible);
|
||||||
if (!item) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Q_D(FramelessQuickHelper);
|
|
||||||
d->setHitTestVisible(item, visible);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FramelessQuickHelper::setHitTestVisible(const QRect &rect, const bool visible)
|
void FramelessQuickHelper::setHitTestVisible_rect(const QRect &rect, const bool visible)
|
||||||
{
|
{
|
||||||
Q_ASSERT(rect.isValid());
|
Q_ASSERT(rect.isValid());
|
||||||
if (!rect.isValid()) {
|
if (!rect.isValid()) {
|
||||||
|
@ -1035,6 +1044,26 @@ void FramelessQuickHelper::setHitTestVisible(const QRect &rect, const bool visib
|
||||||
d->setHitTestVisible(rect, visible);
|
d->setHitTestVisible(rect, visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FramelessQuickHelper::setHitTestVisible_object(QObject *object, const bool visible)
|
||||||
|
{
|
||||||
|
Q_ASSERT(object);
|
||||||
|
if (!object) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Q_D(FramelessQuickHelper);
|
||||||
|
d->setHitTestVisible(object, visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FramelessQuickHelper::setHitTestVisible_item(QQuickItem *item, const bool visible)
|
||||||
|
{
|
||||||
|
Q_ASSERT(item);
|
||||||
|
if (!item) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Q_D(FramelessQuickHelper);
|
||||||
|
d->setHitTestVisible(item, visible);
|
||||||
|
}
|
||||||
|
|
||||||
void FramelessQuickHelper::showSystemMenu(const QPoint &pos)
|
void FramelessQuickHelper::showSystemMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
Q_D(FramelessQuickHelper);
|
Q_D(FramelessQuickHelper);
|
||||||
|
|
|
@ -211,7 +211,7 @@ void QuickStandardTitleBar::setWindowIconVisible(const bool value)
|
||||||
} else {
|
} else {
|
||||||
labelAnchors->setLeft(QQuickItemPrivate::get(this)->left());
|
labelAnchors->setLeft(QQuickItemPrivate::get(this)->left());
|
||||||
}
|
}
|
||||||
FramelessQuickHelper::get(this)->setHitTestVisible(windowIconRect(), windowIconVisible_real());
|
FramelessQuickHelper::get(this)->setHitTestVisible_rect(windowIconRect(), windowIconVisible_real());
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant QuickStandardTitleBar::windowIcon() const
|
QVariant QuickStandardTitleBar::windowIcon() const
|
||||||
|
@ -536,7 +536,7 @@ void QuickStandardTitleBar::itemChange(const ItemChange change, const ItemChange
|
||||||
value.window->installEventFilter(this);
|
value.window->installEventFilter(this);
|
||||||
// The window has changed, we need to re-add or re-remove the window icon rect to
|
// The window has changed, we need to re-add or re-remove the window icon rect to
|
||||||
// the hit test visible whitelist. This is different with Qt Widgets.
|
// the hit test visible whitelist. This is different with Qt Widgets.
|
||||||
FramelessQuickHelper::get(this)->setHitTestVisible(windowIconRect(), windowIconVisible_real());
|
FramelessQuickHelper::get(this)->setHitTestVisible_rect(windowIconRect(), windowIconVisible_real());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -397,6 +397,20 @@ void FramelessWidgetsHelperPrivate::setHitTestVisible(const QRect &rect, const b
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FramelessWidgetsHelperPrivate::setHitTestVisible(QObject *object, const bool visible)
|
||||||
|
{
|
||||||
|
Q_ASSERT(object);
|
||||||
|
if (!object) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto widget = qobject_cast<QWidget *>(object);
|
||||||
|
Q_ASSERT(widget);
|
||||||
|
if (!widget) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setHitTestVisible(widget, visible);
|
||||||
|
}
|
||||||
|
|
||||||
void FramelessWidgetsHelperPrivate::attach()
|
void FramelessWidgetsHelperPrivate::attach()
|
||||||
{
|
{
|
||||||
QWidget * const window = findTopLevelWindow();
|
QWidget * const window = findTopLevelWindow();
|
||||||
|
@ -968,6 +982,16 @@ void FramelessWidgetsHelper::setHitTestVisible(const QRect &rect, const bool vis
|
||||||
d->setHitTestVisible(rect, visible);
|
d->setHitTestVisible(rect, visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FramelessWidgetsHelper::setHitTestVisible(QObject *object, const bool visible)
|
||||||
|
{
|
||||||
|
Q_ASSERT(object);
|
||||||
|
if (!object) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Q_D(FramelessWidgetsHelper);
|
||||||
|
d->setHitTestVisible(object, visible);
|
||||||
|
}
|
||||||
|
|
||||||
void FramelessWidgetsHelper::showSystemMenu(const QPoint &pos)
|
void FramelessWidgetsHelper::showSystemMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
Q_D(FramelessWidgetsHelper);
|
Q_D(FramelessWidgetsHelper);
|
||||||
|
|
Loading…
Reference in New Issue