27 Comments

  1. t_3

    hi!

    fantastic stuff. this is _exactly_ what i’m looking for since months. do you know if this is going to work in Qt 4.5.x or Qt 4.8 wihtout heavy modifications? need to support esp. those versions, and sadly it seems not to compile with both right away (need to say, that i’m no experienced Qt coder, so the answer might be obvious to the pro 😉

    anyway – thanks for sharing this!

  2. t_3

    additional note: it is working in Qt 4.8.x – my fault. for 4.5.x it seems to be only necessary to replace the ItemScenePositionHasChanged() – which is not available there – against something more basic; what in fact shouldn’t be very complicated.

    thanks again for this great piece of code!

  3. Brecht De Rooms

    in QT 5.0 I get the following error:

    1>—— Build started: Project: test, Configuration: Debug Win32 ——
    1>Build started 04/03/2013 15:04:33.
    1>InitializeBuildStatus:
    1> Touching “Debugtest.unsuccessfulbuild”.
    1>CustomBuild:
    1> All outputs are up-to-date.
    1>ClCompile:
    1> qneblock.cpp
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(36): error C2664: ‘QGraphicsPathItem::QGraphicsPathItem(const QPainterPath &,QGraphicsItem *)’ : cannot convert parameter 1 from ‘QGraphicsItem *’ to ‘const QPainterPath &’
    1> Reason: cannot convert from ‘QGraphicsItem *’ to ‘const QPainterPath’
    1> No constructor could take the source type, or constructor overload resolution was ambiguous
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C2227: left of ‘->condition’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C2227: left of ‘->i’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C2227: left of ‘->i’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C2227: left of ‘->brk’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C2227: left of ‘->brk’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(72): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C2227: left of ‘->condition’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C2227: left of ‘->i’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C2227: left of ‘->i’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C2227: left of ‘->brk’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C2227: left of ‘->brk’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(115): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C2227: left of ‘->condition’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C2227: left of ‘->i’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C2227: left of ‘->i’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C2227: left of ‘->brk’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C3861: ‘children’: identifier not found
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C2227: left of ‘->brk’ must point to class/struct/union/generic type
    1>……….Desktopqnodeseditor_srcqnodeseditorqneblock.cpp(125): error C3861: ‘children’: identifier not found
    1> qneconnection.cpp
    1>……….Desktopqnodeseditor_srcqnodeseditorqneconnection.cpp(35): error C2664: ‘QGraphicsPathItem::QGraphicsPathItem(const QPainterPath &,QGraphicsItem *)’ : cannot convert parameter 1 from ‘QGraphicsItem *’ to ‘const QPainterPath &’
    1> Reason: cannot convert from ‘QGraphicsItem *’ to ‘const QPainterPath’
    1> No constructor could take the source type, or constructor overload resolution was ambiguous
    1> qnemainwindow.cpp
    1>c:usersbderoomsdesktopqnodeseditor_srcqnodeseditorui_qnemainwindow.h(14): fatal error C1083: Cannot open include file: ‘QtGui/QAction’: No such file or directory
    1> qneport.cpp
    1>……….Desktopqnodeseditor_srcqnodeseditorqneport.cpp(37): error C2664: ‘QGraphicsPathItem::QGraphicsPathItem(const QPainterPath &,QGraphicsItem *)’ : cannot convert parameter 1 from ‘QGraphicsItem *’ to ‘const QPainterPath &’
    1> Reason: cannot convert from ‘QGraphicsItem *’ to ‘const QPainterPath’
    1> No constructor could take the source type, or constructor overload resolution was ambiguous
    1> Generating Code…
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:02.92
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  4. Oceax

    Just what i needed, but i use QT 5 and get the same error. cannot convert from ‘QGraphicsItem *’ to ‘const QPainterPath’

  5. hydexon

    Hello, i’m started to using this wonderful but my question is how to track the flowcharts blocks and where is connected and translate them into script code (i.e Lua)?. Thanks.

  6. loganek

    Hi! Cool library;) But I think, Q_FOREACH instead of foreach should be used in library code – some people (e.g. me) compile project with flag QT_NO_KEYWORDS. Q_FOREACH is universal solution.

  7. rohitwesley

    Hay thanks man this is a really good base to start creating qt node based software. Thanks for your library and your research on the subject it has saved me a lot of time . Just for the info. on getting it to run on qt5 (seeing some of the comments above). I have been able to smoothly compile it on a desktop version of QT5. Once again thanks a ton

  8. papillon

    Thanks a lot for sharing this excellent node-based editor project.
    One question: I tried replacing QGraphicsItem with QGraphicsProxyWidget, and I cannot figure out why the latter can’t be moved around the scene, while QGraphicsItem work. Any idea? Thanks

  9. papillon

    Thanks for the answer. Would it be possible for you to modify the code so that instead of using QPaint items, it actually allows to embed QWidgets, thus allowing to create a more complex interface node?
    I’d need this for a project I’m working on, so if you want to contact me at my email, we could discuss the terms. Thanks a lot.
    Alex

    • admin

      I’m convinced QGraphicsProxyWidget is the way to go, just the issues need to be ironed out. QGraphicsProxyWidget _is_ a QGraphicsItem so there’s no need to “replace” anything. Which widget did you put inside of the proxy? Maybe you should consider putting the proxy as a child of another QGraphicsItem, to provide a “border” to be used for dragging.

      • papillon

        Thanks for the reply and clarifications.
        So I tried to add a child QGraphicsProxyWidget this way, directly in the block constructor (basically I’d like to replace the QPaint calls with widgets):

        QNEBlock::QNEBlock(QGraphicsItem *parent, QGraphicsScene *scene, QString nodeType ) : QGraphicsPathItem(parent, scene)
        {
        QLineEdit* pLineEdit = new QLineEdit(“Some Text”);
        QGraphicsProxyWidget *w = new QGraphicsProxyWidget(parent);
        w->setWidget(pLineEdit);
        …..
        }

        but unfortunately the control doesn’t show. Any idea what might be wrong?
        Thanks

        • papillon

          Ok, I managed to solve it creating subclassing a new QGraphicsItem, and adding there proxy, ports etc., as you kindly suggested. Thanks again.

  10. EvilSpirit

    now i am working on the same thing using meta information about signals and slots. going to do automatic connection )

  11. youpsla

    Sorry for this beginner question, but how tyo install this widget in Qt Creator ?

    If you find my question to much “stupid”, let me know !!! lol

Leave a Reply

Your email address will not be published. Required fields are marked *