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

Fix #13282 FN functionConst with unknown base class #6990

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

@chrchr-github chrchr-github reopened this Nov 5, 2024
@chrchr-github
Copy link
Collaborator Author

I wonder if we can define Q_OBJECT as empty.

@chrchr-github
Copy link
Collaborator Author

I wonder if we can define Q_OBJECT as empty.

The current definition was added in #5533
virtual seems to be part of the original definition: https://stackoverflow.com/a/58483226

@firewave
Copy link
Collaborator

From the macro expansion view of my IDE.

Qt5:

public:
    static const QMetaObject staticMetaObject;
    virtual const QMetaObject* metaObject() const;
    virtual void* qt_metacast(const char*);
    virtual int qt_metacall(QMetaObject::Call, int, void**);

    static inline QString tr(const char* s, const char* c = nullptr, int n = -1)
    {
        return staticMetaObject.tr(s, c, n);
    }

    __attribute__ ((__deprecated__)) static inline QString trUtf8(const char* s, const char* c = nullptr, int n = -1)
    {
        return staticMetaObject.tr(s, c, n);
    }

private:
    __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject*, QMetaObject::Call, int, void**);

    struct QPrivateSignal
    {
    };

Qt6:

public:
    static const QMetaObject staticMetaObject;
    virtual const QMetaObject* metaObject() const;
    virtual void* qt_metacast(const char*);
    virtual int qt_metacall(QMetaObject::Call, int, void**);

    static inline QString tr(const char* s, const char* c = nullptr, int n = -1)
    {
        return staticMetaObject.tr(s, c, n);
    }

private:
    __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject*, QMetaObject::Call, int, void**);

    struct QPrivateSignal
    {
        explicit QPrivateSignal() = default;
    };

@firewave
Copy link
Collaborator

So we should add the virtual to those methods.

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

Successfully merging this pull request may close these issues.

2 participants