Important: Please read the Qt Code of Conduct -

Error while compiling PythonQt (including code-snippets) - hoping for ideas

  • I am not sure if it is acceptable behavior, but I'll try it:
    "Here": I got some help on enabling a Qt application to run Python scripts.
    I tried to compile "this": respository and got a huge amount of errors, 95% of them like this (slightly edited to coincide with the code snippets following):

    @generator_50\parser\binder.cpp: In member function 'FileModelItem Binder::run(AST*)':
    parser\binder.cpp:7:38: error: base operand of '->' has non-pointer type 'FileModelItem {aka CodeModelPointer<_FileModelItem>}'
    updateItemPosition (_M_current_file->toItem(), node);

    I tried to trace down the problem, but I personally do not see it. Maybe somebody with more experience does. The error is given in the code-snippet at the bottom and I climbed up the food-chain until I landed in a dead end, it seems - the first mentioning of CodeModelPointer .

    @template <class T> class CodeModelPointer: public QAtomicPointer<T>

    template <class T>
    Q_INLINE_TEMPLATE CodeModelPointer<T>::CodeModelPointer(T *adata) : d(adata)
    { if (d) d->ref.ref(); }@

    @class _FileModelItem;

    typedef CodeModelPointer<_FileModelItem> FileModelItem;@

    @class _FileModelItem: public _NamespaceModelItem

    static FileModelItem create(CodeModel *model);

    _FileModelItem(CodeModel *model, int kind = __node_kind)
    : _NamespaceModelItem(model, kind) {}

    _FileModelItem(const _FileModelItem &other);
    void operator = (const _FileModelItem &other);

    @FileModelItem _M_current_file;//member of some class@

    @FileModelItem Binder::run(AST *node)
    FileModelItem old = _M_current_file;
    _M_current_access = CodeModel::Public;

    _M_current_file = model()->create<FileModelItem>();
    updateItemPosition (_M_current_file->toItem(), node);//this produces the "non-pointer" error
    FileModelItem result = _M_current_file;

    _M_current_file = old; // restore

    return result;

    If I need to collect any more information, just tell me. If this thread is considered a duplicate...well, I hope it isn't. But since this is about a very specific compilation, I thought that the odds of somebody even reading it in the other thread are pretty slim.

Log in to reply