Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements for PropertySelector #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions qt/qml/PropertySelector/PropertySelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ using namespace cpp::qmltypes;

///@brief constructor
///@param parent the parent item
PropertySelector::PropertySelector(QQuickItem *parent)
PropertySelector::PropertySelector(QObject *parent)
:QObject(parent)
{
}
Expand Down Expand Up @@ -286,9 +286,9 @@ void PropertySelector::prepareRules()
auto context = QQmlEngine::contextForObject(target());
const QString objectName = context->objectName().isEmpty() ? QStringLiteral("unnamed") : context->objectName(); //FIXME: broken
auto switchContext = QQmlEngine::contextForObject(this);
qWarning(QString("PropertySelector target %1 (%2) does not have a property '%3' requested from %4, line %5:%6")
qWarning() << QString("PropertySelector target %1 (%2) does not have a property '%3' requested from %4, line %5:%6")
.arg(target()->metaObject()->className(), objectName, start->property,
switchContext->baseUrl().toString(), QString::number(start->location.line), QString::number(start->location.column)).toLatin1() );
switchContext->baseUrl().toString(), QString::number(start->location.line), QString::number(start->location.column)).toLatin1();
} else {
PropertyRules rules {prop, start, end, end, nullptr};
m_properties.append(rules);
Expand Down
3 changes: 1 addition & 2 deletions qt/qml/PropertySelector/PropertySelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#ifndef PROPERTYSWITCH_H
#define PROPERTYSWITCH_H

#include <QQuickItem>
#include <bitset>
#include <private/qqmlcustomparser_p.h>
#include <QQmlParserStatus>
Expand All @@ -51,7 +50,7 @@ class PropertySelector : public QObject, public QQmlParserStatus
///@brief the maximum number of conditions supported
static const int MaxConditionCount = 32;

PropertySelector(QQuickItem *parent = nullptr);
PropertySelector(QObject *parent = nullptr);

QObject *target() const;
Q_SLOT void setTarget(QObject *target);
Expand Down