cppcheck/cfg/qt.cfg

642 lines
23 KiB
INI

<?xml version="1.0"?>
<def format="2">
<markup ext=".qml" reporterrors="false" aftercode="true">
<!-- keywords in QML code to ignore -->
<keywords>
<keyword name="if"/>
<keyword name="while"/>
<keyword name="typeof"/>
<keyword name="for"/>
</keywords>
<!-- code blocks are meta-code/pseudo code placed in the library
that is used/called by the native c/c++ code -->
<codeblocks>
<!-- need to add all the QML function names below -->
<block name="onClicked"/>
<block name="onFinished"/>
<block name="onTriggered"/>
<block name="onRetrieveTriggered"/>
<block name="onPressed"/>
<block name="onTouch"/>
<block name="onFocusedChanged"/>
<block name="onSubmittedNewStatusChanged"/>
<block name="onCreationCompleted"/>
<block name="onFileSelected"/>
<!-- code block structure in QML is:
onClicked: {
call(var)
} -->
<structure offset="3" start="{" end="}"/>
<!-- the start block is '3' tokens after the
name token so we skip them -->
</codeblocks>
<codeblocks>
<block name="function"/>
<!-- code block structure in QML is:
funnction x(args): {
call(var)
} -->
<structure offset="2" start="{" end="}"/>
</codeblocks>
<!-- Qt Properties have the format :
Q_PROPERTY(<type> <name> READ <func> WRITE <func> NOTIFY <func>)
the READ/WRITE/NOTIFY parts are optional -->
<exported>
<exporter prefix="Q_PROPERTY">
<suffix>READ</suffix>
<!-- catch the element before READ if present -->
<prefix>READ</prefix>
<prefix>WRITE</prefix>
<prefix>NOTIFY</prefix>
</exporter>
</exported>
<!-- qml files can call connect on the c++ code -->
<imported>
<importer>connect</importer>
</imported>
</markup>
<!-- qt can call methods as strings using invokeMethod -->
<reflection>
<call arg="2">invokeMethod</call>
</reflection>
<define name="SIGNAL(X)" value="#X"/>
<define name="SLOT(X)" value="#X"/>
<!-- QMetaObject::Connection QObject::connect(const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type = Qt::AutoConnection) const -->
<!-- QMetaObject::Connection QObject::connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type = Qt::AutoConnection) -->
<!-- QMetaObject::Connection QObject::connect(const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type = Qt::AutoConnection) -->
<!-- QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type = Qt::AutoConnection) -->
<!-- QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, Functor functor) -->
<!-- QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type = Qt::AutoConnection) -->
<!-- TODO: function configuration should match all overloaded functions and ideally only QObject methods -->
<function name="connect">
<noreturn>false</noreturn>
<arg nr="1">
<not-null/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
<not-uninit/>
</arg>
<arg nr="4">
<not-uninit/>
</arg>
</function>
<!-- bool QObject::disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method) -->
<!-- bool QObject::disconnect(const char *signal = Q_NULLPTR, const QObject *receiver = Q_NULLPTR, const char *method = Q_NULLPTR) const -->
<!-- bool QObject::disconnect(const QObject *receiver, const char *method = Q_NULLPTR) const -->
<!-- bool QObject::disconnect(const QMetaObject::Connection &connection) -->
<!-- bool QObject::disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) -->
<!-- TODO: function configuration should match all overloaded functions and ideally only QObject methods -->
<function name="disconnect">
<noreturn>false</noreturn>
<arg nr="1">
<not-null/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
<not-uninit/>
</arg>
<arg nr="4">
<not-uninit/>
</arg>
</function>
<!-- QString QObject::tr(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) //static -->
<function name="tr,QObject::tr">
<noreturn>false</noreturn>
<returnValue type="QString"/>
<use-retval/>
<leak-ignore/>
<arg nr="1">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="2" default="0">
<not-uninit/>
</arg>
<arg nr="3" default="-1">
<not-uninit/>
</arg>
</function>
<!-- void QSettings::setValue(const QString &key, const QVariant &value) -->
<function name="QSettings::setValue">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<strz/>
<not-uninit/>
<not-null/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
</function>
<!-- QVariant QSettings::value(const QString &key, const QVariant &defaultValue = QVariant()) const -->
<function name="QSettings::value">
<noreturn>false</noreturn>
<returnValue type="QVariant"/>
<use-retval/>
<const/>
<arg nr="1">
<strz/>
<not-uninit/>
<not-null/>
</arg>
<arg nr="2" default="QVariant()">
<not-uninit/>
</arg>
</function>
<!-- QString & QString::sprintf(const char * cformat, ...); -->
<function name="QString::sprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr/>
<arg nr="1">
<formatstr/>
<not-uninit/>
</arg>
</function>
<!-- QString & QString::asprintf(const char * cformat, ...); -->
<function name="QString::asprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr/>
<arg nr="1">
<formatstr/>
<not-uninit/>
</arg>
</function>
<!-- const QChar QString::at(int position) const -->
<function name="QList::at,QString::at,QStringList::at">
<noreturn>false</noreturn>
<returnValue type="const QChar"/>
<use-retval/>
<const/>
<arg nr="1">
<not-uninit/>
<valid>0:</valid>
</arg>
</function>
<!-- int QString::capacity() const -->
<function name="QString::capacity">
<noreturn>false</noreturn>
<returnValue type="int"/>
<use-retval/>
<const/>
</function>
<!-- iterator QList::..() -->
<function name="QList::begin,QList::end,QList::cbegin,QList::cend,QList::constBegin,QList::constEnd,QList::rbegin,QList::rend,QList::crbegin,QList::crend">
<noreturn>false</noreturn>
<use-retval/>
</function>
<!-- iterator QString::..() -->
<function name="QString::begin,QString::end,QString::cbegin,QString::cend,QString::constBegin,QString::constEnd,QString::rbegin,QString::rend,QString::crbegin,QString::crend">
<noreturn>false</noreturn>
<use-retval/>
</function>
<!-- iterator QStringList::..() -->
<function name="QStringList::begin,QStringList::end,QStringList::cbegin,QStringList::cend,QStringList::constBegin,QStringList::constEnd,QStringList::rbegin,QStringList::rend,QStringList::crbegin,QStringList::crend">
<noreturn>false</noreturn>
<use-retval/>
</function>
<!-- void QString::chop() -->
<function name="QString::chop">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- void QString::clear() -->
<function name="QList::clear,QString::clear">
<noreturn>false</noreturn>
</function>
<!-- int QString::compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive) //static -->
<!-- int QString::compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- int QString::compare(const QString &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- int QString::compare(const QString &s1, QLatin1String s2, Qt::CaseSensitivity cs = Qt::CaseSensitive) //static -->
<!-- int QString::compare(QLatin1String s1, const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive) //static -->
<!-- int QString::compare(const QStringRef &ref, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive) //static -->
<function name="QString::compare">
<noreturn>false</noreturn>
<returnValue type="int"/>
<use-retval/>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2" default="0">
<not-uninit/>
</arg>
<arg nr="3" default="0">
<not-uninit/>
</arg>
</function>
<!-- bool QList::contains(const T &value) const -->
<!-- bool QList::startsWith(const T &value) const -->
<!-- bool QList::endsWith(const T &value) const -->
<function name="QList::contains,QList::startsWith,QList::endsWith">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="bool"/>
<const/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- bool QString::contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- bool QString::startsWith(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- bool QString::endsWith(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<function name="QString::contains,QString::startsWith,QString::endsWith">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="bool"/>
<const/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2" default="Qt::CaseSensitive">
<not-uninit/>
</arg>
</function>
<!-- bool QStringList::contains(const T &value) const -->
<!-- bool QStringList::startsWith(const T &value) const -->
<!-- bool QStringList::endsWith(const T &value) const -->
<function name="QStringList::contains,QStringList::startsWith,QStringList::endsWith">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="bool"/>
<const/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- int QList::count() const -->
<!-- int QList::length() const -->
<!-- int QList::size() const -->
<!-- int QString::count() const -->
<!-- int QString::length() const -->
<!-- int QString::size() const -->
<!-- int QStringList::count() const -->
<!-- int QStringList::length() const -->
<!-- int QStringList::size() const -->
<function name="QList::count,QList::length,QList::size,QString::count,QString::length,QString::size,QStringList::count,QStringList::length,QStringList::size">
<noreturn>false</noreturn>
<const/>
<use-retval/>
<returnValue type="signed int"/>
<const/>
</function>
<!-- bool QList::empty() const -->
<!-- bool QList::isEmpty() const -->
<!-- bool QString::isEmpty() const -->
<!-- bool QString::isNull() const -->
<!-- bool QStringList::empty() const -->
<!-- bool QStringList::isEmpty() const -->
<function name="QList::empty,QList::isEmpty,QString::isEmpty,QString::isNull,QStringList::empty,QStringList::isEmpty">
<noreturn>false</noreturn>
<const/>
<use-retval/>
<returnValue type="bool"/>
<const/>
</function>
<!-- QString QString::fromStdString(const std::string &str) //static -->
<function name="QString::fromStdString">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="QString"/>
<arg nr="1"/>
</function>
<!-- int QList::indexOf(const T &) const -->
<!-- int QStringList::indexOf(const QString &) const -->
<function name="QList::indexOf,QStringList::indexOf">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="signed int"/>
<const/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- int QString::indexOf(const QString &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- int QString::indexOf(QChar ch, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- int QString::indexOf(QLatin1String str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- int QString::indexOf(const QStringRef &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- int QString::indexOf(const QRegExp &rx, int from = 0) const -->
<!-- int QString::indexOf(QRegExp &rx, int from = 0) const -->
<!-- int QString::indexOf(const QRegularExpression &re, int from = 0) const -->
<!-- int QString::indexOf(const QRegularExpression &re, int from, QRegularExpressionMatch *rmatch) const -->
<function name="QString::indexOf">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="signed int"/>
<const/>
<arg nr="any">
<not-uninit/>
</arg>
</function>
<!-- bool QString::isRightToLeft() const -->
<function name="QString::isRightToLeft">
<noreturn>false</noreturn>
<returnValue type="bool"/>
<use-retval/>
<const/>
</function>
<!-- int QList::lastIndexOf(const T &value, int from = -1) const -->
<!-- int QStringList::lastIndexOf(const QString &value, int from = -1) const -->
<function name="QList::lastIndexOf,QStringList::lastIndexOf">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="signed int"/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2" default="-1">
<not-uninit/>
</arg>
</function>
<!-- int QString::lastIndexOf(const QString &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<function name="QString::lastIndexOf">
<noreturn>false</noreturn>
<use-retval/>
<returnValue type="signed int"/>
<const/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2" default="-1">
<not-uninit/>
</arg>
<arg nr="3" default="Qt::CaseSensitive">
<not-uninit/>
</arg>
</function>
<!-- QString QString::left(int n) const -->
<function name="QString::left">
<noreturn>false</noreturn>
<returnValue type="QString"/>
<use-retval/>
<const/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- QList<T> QList::mid(int pos, int length = -1) const -->
<!-- QString QString::mid(int position, int n = -1) const -->
<!-- QStringList QStringList::mid(int pos, int length = -1) const -->
<function name="QList::mid,QString::mid,QStringList::mid">
<noreturn>false</noreturn>
<use-retval/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2" default="-1">
<not-uninit/>
</arg>
</function>
<!-- QString QString::number(long n, int base = 10) -->
<!-- QString QString::number(uint n, int base = 10) -->
<!-- QString QString::number(int n, int base = 10) -->
<!-- QString QString::number(ulong n, int base = 10) -->
<!-- QString QString::number(qlonglong n, int base = 10) -->
<!-- QString QString::number(qulonglong n, int base = 10) -->
<!-- QString QString::number(double n, char format = 'g', int precision = 6) -->
<function name="QString::number">
<noreturn>false</noreturn>
<returnValue type="QString"/>
<use-retval/>
<leak-ignore/>
<arg nr="any">
<not-uninit/>
</arg>
</function>
<!-- QString QString::right(int n) const -->
<function name="QString::right">
<noreturn>false</noreturn>
<returnValue type="QString"/>
<use-retval/>
<leak-ignore/>
<const/>
<arg nr="1">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
</function>
<!-- QStringList QString::split(const QString &sep, SplitBehavior behavior = KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- QStringList QString::split(QChar sep, SplitBehavior behavior = KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const -->
<!-- QStringList QString::split(const QRegExp &rx, SplitBehavior behavior = KeepEmptyParts) const -->
<!-- QStringList QString::split(const QRegularExpression &re, SplitBehavior behavior = KeepEmptyParts) const -->
<function name="QString::split">
<noreturn>false</noreturn>
<returnValue type="QStringList"/>
<use-retval/>
<leak-ignore/>
<const/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- int QString::toInt(bool *ok = Q_NULLPTR, int base = 10) const -->
<function name="QString::toInt">
<noreturn>false</noreturn>
<returnValue type="int"/>
<use-retval/>
<leak-ignore/>
<const/>
<arg nr="1" default="0">
<not-uninit/>
</arg>
<arg nr="2" default="10">
<not-uninit/>
<valid>0,2:36</valid>
</arg>
</function>
<!-- QString QString::toLower() const -->
<function name="QString::toLower">
<noreturn>false</noreturn>
<returnValue type="QString"/>
<use-retval/>
<const/>
</function>
<!-- std::string QString::toStdString() const -->
<function name="QString::toStdString">
<noreturn>false</noreturn>
<returnValue type="std::string"/>
<use-retval/>
<const/>
</function>
<!-- QString QString::toUpper() const -->
<function name="QString::toUpper">
<noreturn>false</noreturn>
<returnValue type="QString"/>
<use-retval/>
<const/>
</function>
<!-- QByteArray QString::toUtf8() const -->
<function name="QString::toUtf8">
<noreturn>false</noreturn>
<returnValue type="QByteArray"/>
<use-retval/>
<const/>
</function>
<!-- QString QString::trimmed() const -->
<function name="QString::trimmed">
<noreturn>false</noreturn>
<returnValue type="QString"/>
<use-retval/>
<const/>
</function>
<!-- void QMetaObject::connectSlotsByName(QObject *object) -->
<function name="QMetaObject::connectSlotsByName">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
</arg>
</function>
<!-- QString QDir::fromNativeSeparators(const QString &pathName) -->
<!-- QString QDir::toNativeSeparators(const QString &pathName) -->
<function name="QDir::fromNativeSeparators,QDir::toNativeSeparators">
<noreturn>false</noreturn>
<returnValue type="QString"/>
<use-retval/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- bool QFile::open(OpenMode mode) -->
<!-- bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags = DontCloseHandle) -->
<!-- bool QFile::open(int fd, OpenMode mode, FileHandleFlags handleFlags = DontCloseHandle) -->
<function name="QFile::open">
<noreturn>false</noreturn>
<returnValue type="bool"/>
<leak-ignore/>
<arg nr="any">
<not-uninit/>
</arg>
</function>
<!-- bool QFile::remove() -->
<!-- bool QFile::remove(const QString &fileName) -->
<function name="QFile::remove">
<noreturn>false</noreturn>
<returnValue type="bool"/>
<leak-ignore/>
<arg nr="any">
<not-uninit/>
</arg>
</function>
<!-- bool QFile::rename(const QString &newName) -->
<!-- bool QFile::rename(const QString &oldName, const QString &newName) -->
<function name="QFile::rename">
<noreturn>false</noreturn>
<returnValue type="bool"/>
<leak-ignore/>
<arg nr="any">
<not-uninit/>
</arg>
</function>
<!-- qint64 QFile::size() const -->
<!-- qint64 QIODevice::size() const -->
<function name="QFile::size,QIODevice::size">
<noreturn>false</noreturn>
<returnValue type="qint64"/>
<use-retval/>
<const/>
</function>
<container id="qtContainer" opLessAllowed="false">
<type templateParameter="0"/>
<size>
<function name="append" action="push"/>
<function name="clear" action="clear"/>
<function name="count" yields="size"/>
<function name="erase" action="erase"/>
<function name="insert" action="insert"/>
<function name="isEmpty" yields="empty"/>
<function name="length" yields="size"/>
<function name="size" yields="size"/>
<function name="swap" action="change"/>
</size>
<access>
<function name="begin" yields="start-iterator"/>
<function name="cbegin" yields="start-iterator"/>
<function name="constBegin" yields="start-iterator"/>
<function name="end" yields="end-iterator"/>
<function name="cend" yields="end-iterator"/>
<function name="constEnd" yields="end-iterator"/>
</access>
</container>
<container id="qtList" startPattern="QList &lt;" inherits="qtContainer" opLessAllowed="true">
<type string="std-like"/>
<size>
<function name="resize" action="resize"/>
</size>
<access indexOperator="array-like">
<function name="at" yields="at_index"/>
<function name="front" yields="item"/>
<function name="back" yields="item"/>
</access>
</container>
<container id="qtString" startPattern="QString" endPattern="" inherits="qtContainer" opLessAllowed="true">
<type string="std-like"/>
<size>
<function name="isNull" yields="empty"/>
<function name="resize" action="resize"/>
</size>
<access indexOperator="array-like">
<function name="at" yields="at_index"/>
<function name="front" yields="item"/>
<function name="back" yields="item"/>
</access>
</container>
<container id="qtStringList" startPattern="QStringList" inherits="qtContainer" opLessAllowed="true">
<type string="std-like"/>
<size>
<function name="resize" action="resize"/>
</size>
<access indexOperator="array-like">
<function name="at" yields="at_index"/>
<function name="front" yields="item"/>
<function name="back" yields="item"/>
</access>
</container>
<define name="Q_DECL_EXPORT" value=""/>
<define name="Q_DECL_IMPORT" value=""/>
<define name="Q_DECLARE_FLAGS(x,y)" value=""/>
<define name="Q_DISABLE_COPY(C)" value="C(C&amp;);C&amp; operator=(const C&amp;);"/>
<define name="Q_ENUM(X)" value=""/>
<define name="Q_ENUMS(X)" value=""/>
<define name="Q_FLAGS(X)" value=""/>
<define name="Q_INTERFACES(X)" value=""/>
<define name="Q_OBJECT" value=""/>
<define name="Q_PROPERTY(X)" value=""/>
<define name="foreach(A,B)" value="for(A:B)"/>
<podtype name="qint8" sign="s" size="1"/>
<podtype name="qint16" sign="s" size="2"/>
<podtype name="qint32" sign="s" size="4"/>
<podtype name="qint64" sign="s" size="8"/>
<podtype name="quint8" sign="u" size="1"/>
<podtype name="quint16" sign="u" size="2"/>
<podtype name="quint32" sign="u" size="4"/>
<podtype name="quint64" sign="u" size="8"/>
<!-- https://doc.qt.io/qt-5/qtglobal.html#qlonglong-typedef "This is the same as qint64." -->
<podtype name="qlonglong" sign="s" size="8"/>
<!-- https://doc.qt.io/qt-5/qtglobal.html#qulonglong-typedef "This is the same as quint64." -->
<podtype name="qulonglong" sign="u" size="8"/>
<podtype name="uchar" sign="u" size="1"/>
<podtype name="uint" sign="u"/>
<podtype name="ulong" sign="u"/>
<podtype name="ushort" sign="u"/>
<podtype name="qptrdiff" sign="s"/>
<podtype name="qintptr" sign="s"/>
<podtype name="quinitptr" sign="u"/>
</def>