Skip to content

Commit

Permalink
Fix bugs in qml plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
laumaya committed May 19, 2014
1 parent dfe4d80 commit e9dc03b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/examples/example11/GLC_Quick.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Rectangle {
source: ":model/Democles.dae"
spacePartitionningEnabled: true
onSelectionChanged : {
if (!view1.selection.isEmpty)
if (!view1.selection.isEmpty())
{
selectionInfo.text= view1.selection.first.id;
selectionInfo.text= view1.selection.first().id;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/qml/glc_quickitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class GLC_LIB_EXPORT GLC_QuickItem : public QQuickItem
Q_PROPERTY(QVector3D defaultUpVector READ defaultUpVector WRITE setDefaultUpVector)

//! Current selection
Q_PROPERTY(GLC_QuickSelection* selection READ selection NOTIFY selectionChanged)
Q_PROPERTY(GLC_QuickSelection* selection READ selection)


//////////////////////////////////////////////////////////////////////
Expand Down
13 changes: 3 additions & 10 deletions src/lib/qml/glc_quickselection.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,24 @@
class GLC_LIB_EXPORT GLC_QuickSelection : public QObject
{
Q_OBJECT
Q_PROPERTY(QList<GLC_QuickOccurrence*> occurrences READ occurrences)
Q_PROPERTY(int count READ count)
Q_PROPERTY(GLC_QuickOccurrence* first READ first)
Q_PROPERTY(bool isEmpty READ isEmpty)

public:
explicit GLC_QuickSelection(QObject *parent = 0);
virtual ~GLC_QuickSelection();

public:
QList<GLC_QuickOccurrence*> occurrences() const
{return m_Occurrences;}

int count() const
Q_INVOKABLE int count() const
{return m_Occurrences.count();}

GLC_QuickOccurrence* first() const
Q_INVOKABLE GLC_QuickOccurrence* first() const
{return m_Occurrences.first();}

Q_INVOKABLE GLC_QuickOccurrence* at(int i) const
{return m_Occurrences.at(i);}

void setWorld(const GLC_World& world);

bool isEmpty()
Q_INVOKABLE bool isEmpty() const
{return m_Occurrences.isEmpty();}

signals:
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/GLC_ViewerItem/glc_vieweritem_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ void GLC_ViewerItemPlugin::registerTypes(const char *uri)
// @uri glclib
qmlRegisterType<GLC_QuickItem>(uri, 1, 0, "GLC_QuickItem");
qmlRegisterType<GLC_QuickCamera>();
qmlRegisterType<GLC_QuickSelection>();
qmlRegisterType<GLC_QuickOccurrence>();
qmlRegisterType<GLC_QuickSelection>();
}


0 comments on commit e9dc03b

Please sign in to comment.