The Qt Codan checker for QObject::connect function calls was not
confirming that the SIGNAL and SLOT expansion parameter were Qt signals
and slots. The checker would allow the function call as long as the
expansion parameter resolved to a C++ method.
This patch changes the behaviour to required signals inside SIGNAL and
slots inside SLOT.
Change-Id: Ieec2f3a7ef4968d45ac3f6323b20c2f195fe3400
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20401
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
The QObject::connect content assistant does not work when the receiver
of the function call is an implicit this. E.g.,
class Q : public QObject { Q_OBJECT
f()
{
this->connect( ... ); // works
connect( ... ); // does not work
QObject::connect( ... ) // does not work
}
};
I've changed the Qt's ASTUtil.getReceiverType to navigate to the
ICPPClassType through the IScope's. The previous implementation was
relying on the connect function call being an IASTField
I've also added a test case for this problem.
Change-Id: I96c29a9a452280068bda39a63414c50008bfad37
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20399
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
introduced when we ported hardware debug to DSF.
Change-Id: I5232ab1e2e345edac9df640836bf8c8413ac6a36
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
The Qt spec includes a special function that is used to introduce C++
types to a namespace that is accessible from QML. E.g.,
qmlRegisterType<Q>( "uri", 1, 0, "QMLType" );
This will create a QML type called QMLType. The type will include the
signals, slots, and invokable that are defined in the C++ class Q. The
type is accessible in QML using the given URI and the version is 1.0.
More information is available at:
http://qt-project.org/doc/qt-4.8/qdeclarativeengine.html
This patch adds IQmlRegisteredType, a collection of which can be
accessed from a new method in QtIndex.
This also includes new test cases for this feature.
Change-Id: I70c44d1d8d3a0594de44e692a16f7b26396e8464
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20347
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
This changes the Qt PDOM so that QObject's are stored using their fully
qualified name (including leading ::). IQObject's API has been changed
to return the fully qualified name. Leading :: is stripped from the
IQObject name so there is no change from the previous implementation for
names that are not inside a namspace.
This includes a new test case to check this fix.
Change-Id: I1786151463e9029cdf1f2c213466adc8c3aa3618
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20328
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
When the language settings providers functionality is enabled, also
check for build settings customization, not just the language setting
entries.
Change-Id: Ia9fec3bc377617dc9f2264dd924941879f1b64b0
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/20297
Tested-by: Hudson CI
Reviewed-by: Andrew Gvozdev <angvoz.dev@gmail.com>
IP-Clean: Andrew Gvozdev <angvoz.dev@gmail.com>
Tested-by: Andrew Gvozdev <angvoz.dev@gmail.com>
This extends the QtIndex to support C++ classes that have been annotated
with the Q_GADGET macro. QGadgets are normal C++ classes that are able
to host Q_ENUMs.
The implementation classes for QObject have been modified to share
common parts with the implementation for QGadget. The types are
intentionally not related in the QtIndex API. This allows for divergent
changes in the Qt spec.
This patch includes new tests cases for Q_GADGET.
Change-Id: I59eb745ff5614c2897d67dd7d6807763091120af
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20236
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
This implements a Codan checker for QObject::connect and disconnect
function calls. There are several overloads for each function, but the
basic call looks like:
Q * q;
QObject::connect( q, SIGNAL( sign() ), q, SLOT( slot() ) );
This function calls requires that Q have a Qt signal called sign and a
Qt slot called slot, e.g.,
class Q : public QObject
{
Q_OBJECT
Q_SIGNAL void sign();
Q_SLOT void slot();
};
The Qt checker raises a warning if either condition is not true.
It also raises a warning for SIGNAL or SLOT expansions without a
parameter.
Change-Id: If68a5bcdabb3f118801675e46ae926e6a250378a
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20231
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
The QtASTVisitor is trying to use the QtIndex during indexing. Any
results available at this time are based on the state of the AST the
last time the code was indexed.
This adds a test case to reproduce the problem. The test cases indexes
the project one time. It should find two references to the signal. If
the QtIndex data is stale, then it will find 0 references.
This also replaces the code that looks for QObject::connect function
calls. The proper behaviour is to find all overloads of #connect as
well as references with QObject::disconnect (all overloads) function
calls.
A new test case checks for references in all overloads of #connect and
#disconnect function calls.
Change-Id: I28fc4213d6dddff10f81a6bd3ef01e24c74f31db
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20223
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
The version number of the feature should have been changed when the
plugin versions were changed (in commit c6c1ef9).
Change-Id: Ia6cf07edacd8cf2932b496e09c3d0aab579e9eda
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20068
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
available
Change-Id: Id950622f6ca39639addeedc33e8d1c3fadd611e0
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/20028
CodanPreferencesLoader.getProjectNode will sometimes return null. This
patch adds null checks before using the result.
Change-Id: If4dd70e6673d5da62cc0b8e899fb5066bdaa4bef
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19873
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>