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

Example fails to build #7

Open
poinot opened this issue Dec 1, 2016 · 2 comments
Open

Example fails to build #7

poinot opened this issue Dec 1, 2016 · 2 comments

Comments

@poinot
Copy link

poinot commented Dec 1, 2016

The example test looks for a (missing) qobjectnode.h

There is a pre-processing directive to skip this object use in MainWindow::addNodeViews (which obviously looks like a temporary switch), but the GraphicsNode object used in place requires args.

@nwaniek
Copy link
Owner

nwaniek commented Dec 1, 2016

At the moment the example is not expected to work with the massive changes that were introduced recently. I didn't come around to write an example yet.

@Elv13
Copy link
Contributor

Elv13 commented Dec 1, 2016

Sorry about that, this is my fault, here's a simple one (untested, but mostly ok-ish)

#include <QtWidgets/QApplication>
#include <qnodewidget.h>

class MyObject : public QObject
{
    Q_OBJECT
public:
    Q_PROPERTY(bool aUnBonjour READ aUnBonjour WRITE disBonjourMonde NOTIFY bonjour USER true)

    bool aUnBonjour() const {return m_hello;}
    void disBonjourMonde(bool hello) {m_Hello = hello; emit bonjour(hello); }

signals:
    void bonjour(bool);

private:
    bool m_hello {false};
};

int main(int argc, char** argv) {
    QApplication a(argc, argv);

    auto nw = new QNodeWidget(this);
    nw->show();

    auto o = new MyObject(this);

    nw->addObject(o);

    return a.exec();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants