Qt-FullyQualifiedMocTypes

Warns when a signal, slot, or invokable declaration is not using fully-qualified type names

Required inputs: IR

Warns when a signal, slot, or invokable declaration is not using fully-qualified type names, which will break old-style connects and interaction with QML.

Also warns if a Q_PROPERTY of type gadget is not fully-qualified (Enums and QObjects in Q_PROPERTY do not need to be fully qualified).

Example:

namespace MyNameSpace {

    struct MyType { (...) };

    class MyObject : public QObject
    {
        Q_OBJECT
        Q_PROPERTY(MyGadget myprop READ myprop); // Wrong, needs namespace
    Q_SIGNALS:
        void mySignal(MyType); // Wrong
        void mySignal(MyNameSpace::MyType); // OK
    };
}

Beware that fixing these type names might break user code if they are connecting to them via old-style connects, since the users might have worked around your bug and not included the namespace in their connect statement.

This rule is only relevant for moc input files.

This rule is based on clazy rule fully-qualified-moc-types

Possible Messages

Key

Text

Severity

Disabled

fully_qualify_property

Q_PROPERTY of type {} should use full qualification ({}).

None

False

not_fully_qualified

{} need to be fully-qualified ({} instead of {}).

None

False

Options

level

level : int = 0

Importance level of the rule as given for clazy. 0 is most desirable, higher values fall off in quality.