1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00
Commit graph

53 commits

Author SHA1 Message Date
Marc Khouzam
fa5de3be3b Update license.html files for 2014 version
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2014-05-02 11:17:44 -04:00
David Kaspar
82853c889d Bug 433869: IQMakeProjectInfo is not updating on active conf. changed
Fixing incorrect eventTypes used for registering
CProjectDescriptionListener in QMakeProjectInfo.start() method.

Change-Id: Ieb602a38999868e3da8487a1757c69bd50cb5837
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/25808
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
2014-04-30 15:34:21 -04:00
Doug Schaefer
e907795125 Bug 432839 - Fix out of memory condition with Qt projects.
Turn the cache in QtPDOMLinkage into a WeahHashMap.

Change-Id: I261d3aec5ee6b7537c4bfaa204dadd85b686140c
Reviewed-on: https://git.eclipse.org/r/25064
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
(cherry picked from commit b12b65bfb8)
Reviewed-on: https://git.eclipse.org/r/25069
2014-04-15 12:06:40 -04:00
David Kaspar
698788ea71 Bug 431012: Missing IQMakeProjectInfo.updateQMakeInfo()
Adding IQMakeProjectInfo.updateQMakeInfo():QMakeInfo method to allow
explicit calculation of QMakeInfo at the time of the method call.

Change-Id: I665bedd5e095d1968f0c39ff2abb19c60aac9e14
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/23800
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2014-03-24 15:01:26 -04:00
David Kaspar
73a912f95b Bug 429488: Fix for deadlock in QMakeProjectInfo.updateActiveConfiguration
To prevent a deadlock between two the workspace and QMakeProjectInfo.sync
locks, QMakeProjectInfo class has been rewritten to not call any method
under sync-lock except for IQMakeEnv.init/destroy method.

All methods should allow calling under workspace lock.

Added a new IQMakeEnv2 interface to provide an explicit init method.

Original QMakeProjectInfo has been split to
QMakeProjectInfo and QMakeProjectInfoManager.

This change is fully backward compatible.

Change-Id: I880f22dd9bd999af1d3f47e4a3c4c0ab216b4ad2
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/23270
Tested-by: Hudson CI
Reviewed-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2014-03-12 20:50:01 -04:00
Andrew Eidsness
71fa7cf819 Bug 426784: Qt Codan checker uses wrong type
view.connect( view.engine(), SIGNAL( quit() ), ...

The return type of view.engine() should be checked for the quit()
signal.  The implementation was actually checking the type of view.

I've fixed a copy/paste error in a utility function.

Change-Id: Id483015214f04951fb30e3271d43499f31614446
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/21189
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2014-01-29 16:12:49 -05:00
Andrew Eidsness
d613b149a0 Bug 426781: Qt content assist is too aggressive
In Content Assist cases like:

    q->

(when the cursor is to the right of the arrow operator) the name that is
returned by the content assist context is the empty string.  This was
used to check if the QObject::connect function applied.  Since the empt
string matches all bindings the Qt assistant incorrectly continued.

I've added a check to stop processing when the current name is the empty
string.

Change-Id: I4e5bf52f4ca1ddc33d88a48917213adbbeb81836
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/21188
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2014-01-28 11:06:40 -05:00
Sergey Prigogin
5d7a19fa6c Enabled JDK 1.7.
Change-Id: Ic2a161ea3c318dc1e8ba01c271c936bf5ed8763d
Reviewed-on: https://git.eclipse.org/r/21020
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
2014-01-24 13:38:55 -05:00
Sergey Prigogin
1d166260a8 Bumped up CDT version to 8.4.
Change-Id: I1229344feaaed4a3551ceb7b1ef1410545048b55
Reviewed-on: https://git.eclipse.org/r/20908
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
2014-01-21 17:35:29 -05:00
Andrew Eidsness
fd074ab029 Bug 425102 QObject::connect content assist still broken
The content assistant was treating all function calls in the same way.
Here is an example showing the two cases that should be handled:

    qobj.connect( qobj.func(), SIGNAL( sig() ), SLOT( slot() ) );

In this case sig() applies to the return type of qobj::func() and slot()
applies to qobj (the same instance that connect is called upon).

The previous implementation of the assistant was not making a
distinction between these two cases.

I've added another test case to confirm behaviour in this area.

Change-Id: I8f76a5d5ae7384ea5162c5d36abeebb4c79c394b
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20848
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2014-01-20 22:40:56 -05:00
Andrew Eidsness
25a0992a63 Bug 425787: Reindex projects when Qt nature is added
If a project description is changed to add the Qt nature then the PDOM
needs to be rebuilt.

Since index rebuilds are potentially expensive, this first checks to
make sure the PDOM does not already contain the QtLinkage.  If the
linkage already exists, then it will be updated by the normal triggers.

The reindex operation should only be needed to add the linkage the first
time the nature is added.

This does not trigger a reindex if the nature is removed.  Without the
nature, the extra linkage will be safely ignored.  The C++ linkage is
(proportionally) much larger than the Qt linkage, so it doesn't make
sense to spend significant time rebuilding the index just for the small
space savings.

Change-Id: I263b05e4de407775979843f5d6a9c8c172948d72
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20680
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2014-01-20 12:11:46 -05:00
Doug Schaefer
801c10d789 Bug 425938 - Make Qt5 template work with 5.2. Remove Qt4 template.
Change-Id: I422a907e9db51be26acd0857d3e9e409bbd3ba2e
Reviewed-on: https://git.eclipse.org/r/20728
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2014-01-17 10:06:53 -05:00
David Kaspar
81ebdf8e82 Bug 422797 - API for retrieving QMake information from Qt project
Changes:
* QtPlugin calls QMakeProjectInfo.start/stop to start/stop listening
  on resource changes
* QMakeProjectInfo listens on changes in project description
  e.g. changing natures
* QMakeProjectInfo.getQMakeProjectInfoFor() returns info even for
  project without QtNature - this prevents race-condition that happens
  when opening legacy QML projects where QtNature is added lazily after
  the project is opened and somebody already asks for QMakeProjectInfo
* Fixing QMakeProjectInfo.stop() and
  QMakeProjectInfo.getQMakeProjectInfoFor() to fire notification outside
  of synchronized blocks

Change-Id: Ib49238f252a249d2b5936b6d8344aae93e0ef583
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/20722
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2014-01-17 10:01:12 -05:00
Andrew Eidsness
54a0b2dd06 Fix Qt core plugin's provider and plug-in names
Change-Id: Ib38b93cb2e1fef0b1e57cd4afed14c35b4bccb23
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20606
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2014-01-14 09:53:09 -05:00
Andrew Eidsness
6873bc9001 Bug 422841 QtIndex accessor for QmlRegistrations of an IQObject
This adds an API method to IQObject that will return the list of QML
registrations for that type.

I've also renamed the previous "QmlRegistered" to "QmlRegistration"
because it makes more sense.

The main part of this patch is a change to the QtPDOMLinkage.  It now
maintains an index of the registrations that are keyed by type.  The
index is a BTree that uses the QObject name as the key and a list of QML
registration PDOMNames as the value.

The list is created in the linkage's onCreate callback.  Old names are
removed in the list's onDelete callback.

This includes a test case for this scenario and also updates the
previous tests to match the new naming.

Change-Id: I4b994a51958c848b4e2a3209165e6e6866e22270
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20527
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2014-01-13 10:54:42 -05:00
David Kaspar
5927d7ea30 Bug 422797 - API for retrieving QMake information from Qt project
Adding a new IQMakeInfo getter:
* getQMakeQueryMap()
* getQtDocPath()
* getResourceFiles()
* getFormFiles()

Fixing incorrect parsing of OTHER_FILES variable.

Adding QMakeTests.testQMakeInfo() JUnit test for qmake output parser.

Change-Id: Ic4e0180381967e2a96455d6a3411fe51ce1cef91
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/20500
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2014-01-13 09:47:43 -05:00
Andrew Eidsness
f531f2f4d8 Bug 425102 New check for Qt Codan checker
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>
2014-01-10 10:40:14 -05:00
Andrew Eidsness
030bfc50fb Bug 425102 QObject::connect content assist broken
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>
2014-01-10 10:38:13 -05:00
Andrew Eidsness
78fc903d16 Bug 422841 QtIndex API for qmlRegisterType function calls
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>
2014-01-07 15:21:47 -05:00
Andrew Eidsness
0e196ca5f2 Bug 425002 QObjects cannot be found within namespaces
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>
2014-01-07 11:48:49 -05:00
Andrew Eidsness
9d6055c4a3 Bug 422841: Add Q_GADGET to QtIndex
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>
2014-01-06 09:52:15 -05:00
Andrew Eidsness
70f50274b4 Bug 424824: Codan checker for Qt
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>
2014-01-02 21:53:46 -05:00
Andrew Eidsness
a512bbb011 Bug 424499: Find References does not work for Qt signals and slots
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>
2014-01-02 21:49:38 -05:00
Andrew Eidsness
2e6729ef6f Fix version number in qt-feature
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>
2014-01-02 14:29:50 -05:00
Doug Schaefer
f6957b73ab Clean up the API around QtNature. Add isProject expr def. 2013-12-13 17:03:52 -05:00
Doug Schaefer
c0b973880f Bug 418536 Add static method to add Qt nature to a project. 2013-12-13 10:25:38 -05:00
Andrew Eidsness
ff690ab953 Content assistant for Qt elements
This adds content assistants for QObject::connect function calls and
Q_PROPERTY expansions.

QObject::connect function calls look like:

    QObject::connect(
        sender,   SIGNAL(someSignalFunction(int),
        receiver, SLOT(someSlotFunction(int));

The assistant provides proposals in the SIGNAL and SLOT expansions.  The
QObject for the corresponding type is used to create a list of signal or
slot function signatures.

Q_PROPERTY expansions look like:

    Q_PROPERTY( type name READ someFunction ... )

[The ... is a list of optional attributes.]  The assistant proposes
attribute names that have not yet been added.  It also proposals
appropriate values for the attribute.

This patch also adds test cases for this feature.

Change-Id: I0eb25235bb423c1cfcd743075331f90f269afea7
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19721
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-12-12 14:05:53 -05:00
Andrew Eidsness
c6c1ef94fc Fix Qt plugin's project structure
The Qt plugins have been naming internal packages using two different
prefixes:

    cdt.qt.internal
    cdt.internal.qt

This renames all packages to cdt.internal.qt, which seems to be the
convention for other projects.

I've increased the Qt plugin versions because alot of new API has been
added, especially to the qt.core plugin.  I increased the version in the
MANIFEST.MF and pom.xml files.

I've also fixed the MANIFEST.MF files to take CDT out of the plugin
names.

I've also replaced a call to CCorePlugin.log(Exception) with a call to
QtUIPlugin.log (and added the logging functions to QtUIPlugin.

Change-Id: I1e3e7b2a42c2eb79fe33608c14a1abcf013a9f2c
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19698
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-12-12 11:12:13 -05:00
Andrew Eidsness
1b42998e47 Bug 422841: Add IQMethod to the QtIndex
This adds support for Qt slots, signals, and invokables to the QtIndex.

This does not yet generate PDOM references for QObject::connection
function calls and the Content Assistant is not contributed yet.

This also fixes a problem in the GNUCPPSourceParser class (internal to
cdt.core).  The class has a protected method that accepts an inner enum
as a parameter.  That enum was marked as private, meaning the method
could not actually be used by subclasses.  I've updated the enum to
match the visibility of the method.

There are three big areas needed to support Qt methods:

1) Slot and signal regions must be identified in the C++ class
definition.  These regions are introduced with special macros and the
region extends to the next region or to the next visibility label.

   Single methods can also be marked with (different) special macros.
This only applies outside of a slot/signal region.

   I've created QtASTClass which examines the input class spec in order
to identify all such regions.  This information is used when creating
the QtPDOM nodes for these methods.

2) Some places in Qt use type information embedded as macro expansion
parameters.  The values are lost by the standard C++ parser (since they
are just text in the expansion).  I've added an extension to the
GNUCPPSourceParser that accepts an input string (the macro expansion
parameter) and produces an appropriate IASTNode if possible.

3) The Qt moc follows specific and non-standard rules when matching
method signatures inside of QObject::connect function calls.  I've added
a utility that creates the same signature using the CDT AST as input.

   I learned the rules used by the moc by observing it's output for
significant cases.  Those cases have been put into a test case that is
included in this patch.

Change-Id: If812558db315abec637653cc974abf1c0c13d95b
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19672
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-12-11 20:59:16 -05:00
Andrew Eidsness
2d9f3f1028 Bug 422841: Add Q_PROPERTY to the QtIndex
This extends IQObject so that it can return the list of Q_PROPERTY
expansions.  Each Q_PROPERTY is represented by the new IQProperty.  The
attributes of the property are stored in IQProperty.Attribute.

Where applicable, the attributes insert a reference from the associated
C++ binding.  This means that the Q_PROPERTY expansion will be included
in the list of references for the C++ binding.

This also simplifies the process for adding new PDOMBindings to the Qt
linkage.  New instances are stored in an implementation of IQtASTName
and able to directly create and return a new QtPDOMBinding.  This avoids
creating three parallel inheritance hierachies (compared to the previous
Qt PDOM implementations).

The patch includes test cases to check handling of Q_PROPERTY
expansions.

Change-Id: I7d256d1a938d24a9eb726c472fb150a02f26eb32
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19602
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-12-10 20:39:41 -05:00
David Kaspar
20a6412247 Bug 422797 - Improved JavaDoc for IQMakeProjectInfoListener.qmakeChanged()
Change-Id: I36ad640cefae08d5ebb2b7e6a566e7e385d9036a
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/19427
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-12-06 10:28:29 -05:00
David Kaspar
4546692659 Bug 422797 - Fix for synchronization and update in QMakeProjectInfo
handleEvent method updates for related project only
and does not fire listeners under 'sync' lock.

Change-Id: Id9726925ff9c044a3c13238406bdf3228ccf2933
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/19361
Reviewed-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-12-05 18:33:54 -05:00
Andrew Eidsness
45c388b77e Bug 418406: Qt4 and Qt5 specific HelloWorld project wizards
This replaces the QtQuick2 project wizard with Qt4 and Qt5 wizards that
include the old content as well as:

1) Make targets to build and clean the project
2) Sample interaction between C++ and QML
3) A Qt header path provider so that paths from the Qt installation are
properly resolved in the project.

Item 3 is particularly important for using the 'New Class' wizard with
QObject as the base class.  Unless the Qt paths are pre-populated the
QObject base class will not be found and the New Class wizard's Finish
button will be disabled.

The Qt headers are resolved by running `qmake -query QT_INSTALL_HEADERS`
and then creating IncludePath entries for all sub-folders.  This list of
include paths is persisted with other shared language settings into a
file in the workspace metadata area.

The persisted data is reloaded when any of the following change:
- the modification time of the qmake binary
- the modification time of the reported QT_INSTALL_HEADERS folder

The persisted node is ignored when the target qmake binary no longer
exists.  The node is removed from the persisted form the next time that
the shared settings are persisted.

Change-Id: Ic82fdb147e6a69060f93e2e9aed2e919139a0ae9
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/16909
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-12-03 18:51:38 -05:00
Andrew Eidsness
16083fee1e Bug 422841: Add Q_CLASSINFO to the QtIndex
Qt allows string-based key/value pairs to be inserted into QObject class
definitions.  E.g.,

    class Q : public QObject
    {
    Q_OBJECT
    Q_CLASSINFO( "key1", "value1" )
    };

The class info is accessible in the meta-object system.  See:

    http://qt-project.org/doc/qt-4.8/qmetaclassinfo.html

For more information.

This patch adds the API to access these key/value pairs from the
QtIndex.  The values are stored in a single block in the PDOM record for
the QObject.

The API returns the value for a given key if it is found in the receiver
QObject or any of its base classes.  The API returns the first such
value that is found.

This patch also adds a test case for this functionality.

Change-Id: Ie3f821a0c5f6f1347a0c0c6dafa184510ae26c29
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19154
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-12-03 09:05:53 -05:00
Andrew Eidsness
0f482a80b2 Bug 422841: Add QEnum to QtIndex
The Qt meta-object system allows C++ enums to be added as simple enums
and as flags.  There is more detail at:

    http://qt-project.org/doc/qt-4.8/qobject.html#Q_ENUMS
and http://qt-project.org/doc/qt-4.8/qflags.html

This patch adds IQEnum to the QtIndex.  IQEnums are contained in
IQObjects and therefore are accessed with the IQObject.getEnums.

An IQEnum holds its name, enumerators, and a boolean indicating whether
the instance represents a Qt flag.

A Qt flag is an enum where the enumerators are intended to be used with
bitwise operations.  The Q_DECLARE_FLAGS macro is used to introduce a
type-safe container for the flags.

This patch also adds unit tests for this new functionality.

Change-Id: If51524e93533bae82a3263f3c7973a31793a8a83
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19147
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-12-03 09:02:31 -05:00
David Kaspar
dc746352a3 Bug 422797 - API for retrieving QMake information from Qt project
Adding ...cdt.qt.tests/SimpleTests JUnit tests

Change-Id: I68d8e56d6b81a65eb1b6823cf7f1df63f00c1a15
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/19145
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-12-03 08:58:10 -05:00
Doug Schaefer
c8b535a52c Bug 418536 - Add Qt tests to maven build.
Change-Id: Ic194325d526a498f81ab9d73fe84841e98663065
Reviewed-on: https://git.eclipse.org/r/19164
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-11-29 23:27:13 -05:00
Andrew Eidsness
fccbec7b0d Bug 422841: Initial implementation of QtIndex
This uses the new PDOMASTProcessor extension point to create a
Qt-specifc PDOMLinkage.  This initial version of the linkage only stores
QObjects and their base classes.  Later commits will fill out other
details and introduce classes that use this data for things like Content
Assistance and Codan checking.

This patch introduces the following:

1) QtIndex: This is an index that provides access to Qt-specific data.
The index is mostly a wrapper on the CDT's existing IIndex, but it
provides very specific information about the Qt elements.  The only data
that can be accessed from the QtIndex (in this patch) is a QObject and
the QObject's that appear in its base class specifier list.

2) QtPDOMLinkage: This linkage is implemenated as an extension of the
PDOMCPPLinkage.  In some cases it adds references to Qt names from the
C++ bindings.

3) Test suite: The test suite has some base classes for parsing the Qt
source code.  The only test case is for the simple functionality that is
being added in this patch -- examining the base class specifier list of
QObjects.

These areas will be extended in later patches.

Change-Id: I13fb83beb7f50cd2efb1de97b562245dc642468d
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/19113
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-11-29 14:43:41 -05:00
David Kaspar
026b9325f0 Bug 422797 - API for retrieving QMake information from Qt project
API is located at org.eclipse.cdt.qt.core.index package.
Entry point is QMakeProjectInfoFactory.getForActiveConfigurationIn method
that provides ability to retrieve QMake information (IQMakeInfo interface)
for active project configuration of a specified project.
Also allows to listen on changes of such information.

qmakeEnvProvider extensions allows CDT build-system to provide environment
for QMake runs within their build-system.

Information is gather by parsing output of:
1) qmake -query
2) qmake -E file.pro // only for QMake version 3.0

Change-Id: Iae569bdbc89dc26d60530596b66b5227f36dfae6
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/19082
Reviewed-by: Andrew Eidsness <eclipse@jfront.com>
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2013-11-28 23:33:42 -05:00
Andrew Gvozdev
652ce4748e Fixed parent pom version to reference 2013-08-27 15:16:24 -04:00
Doug Schaefer
eb663099f5 Clean up more of the legal files for the new features LLVM and Qt. 2013-05-30 13:33:39 -04:00
Doug Schaefer
8b55ae44ac Set proper info in the Qt feature. 2013-05-29 16:28:44 -04:00
Doug Schaefer
3795dbf60e Add pom files for the Qt plug-ins and feature. 2013-04-13 17:01:14 -04:00
Andrew Eidsness
719982b23b Recognize Q_SIGNAL and Q_SLOT on single functions
Qt allows signals and slots to be marked directly on the function, e.g.,

class T
{
    Q_SIGNAL void some_signal();
    Q_SLOT   void some_slot();
};

This change modifies the Qt signal/slot tagger to look for these tags in
addition to the previously implemented search for the visibility label.

Change-Id: Ibf43df8d80d4ca9f8b62776e7a35a4fc067a289e
Reviewed-on: https://git.eclipse.org/r/10701
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-02-28 18:19:59 -05:00
Andrew Eidsness
6c6ab24c23 Bug 400020: Allow tagging of IBindings
Addresses review comments from https://git.eclipse.org/r/#/c/10648.

Fixes the junit problems by making sure that the dummy PDOM acquires its
write lock before calling exercising the tag index.

Original commit message:
This new extension point allows contributors to put their own
information into the PDOM and to later retrieve it for their own
purposes.

There are many details in the bug.  The idea is that contributors
provide an implementation of IBindingTagger, which is given a chance to
examine IBindings when they are created.  The ITagWriter interface
allows the contributor to create a new tag which can then have data
written to it.

The ITagService interface (accessible from CCorePlugin.getTagService()
provides a way for the contributor to later get an instance of
ITagReader to retrieve tags from bindings.

ITags are copied to the PDOM when the associated binding is persisteed.

Contributors use a unique id (based on their plugin id), so that
multiple contributors are able to independently tag a given binding.

In-memory tags are not cached.  I've done some timing tests using my
sample implementation and found no measurable difference.  The full log
lines look like:

	!MESSAGE Indexed 'simple-01' (2 sources, 184 headers) in <see below>
sec: 21,550 declarations; 35,394 references; 0 unresolved inclusions; 1
syntax errors; 0 unresolved names (0.00%)

I did 5 tests using the current master (no tagging-related code), the
times were:
	18.86 sec
	 9.17 sec
	 5.91 sec
	 4.79 sec
	 4.83 sec

And then I ran the same sequence of tests using the code in this
commit:
	18.73 sec
	 9.39 sec
	 6.50 sec
	 4.78 sec
	 5.27 sec

If performance does become a problem, then caching could be introduced
with a new implementation of ITaggableService.  The two problems are
finding a key other than the identity of the IBinding (since IBindings
are re-created often) and properly evicting stale entries when the
binding is no longer valid.

The process of copying tags from an in-memory IBinding to a PDOMBinding,
is a synchronization.  This means that tags that are no longer
applicable, will be removed from the persistent store.

While developing this I found that PDOMBindings are not deleted from the
Database (only the names that reference them are deleted), so there is
no provision for deleting all tags at once.

New database locks are not needed.  By the time the persistent tags are
accessed, higher levels of code have already taken a read or write lock
as appropriate.

There are new unit tests covering the changes to the PDOM.

Change-Id: I6ae1afc949082f7f4484b3faa1550670be43312f
Reviewed-on: https://git.eclipse.org/r/10659
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-02-26 21:17:01 -05:00
Andrew Eidsness
1908efec38 qt slot/signal auto-complete
Tags signal and slot methods when the index is created.  Uses these tags
to suggest values inside of SIGNAL and SLOT macro expansions.  Enabled
only for projects with the QtNature.

Recognizes QObject::connect function calls and suggests SIGNAL(a) and
SLOT(a) for the 2nd and 4th parameters.

When expanding the SIGNAL and SLOT macros within a call to
QObject::connect, suggests signals and slots based on the type of the
previous parameter.

E.g. in

    QObjectA a;
    QObjectB b;
    QObject::connect( &a, SIGNAL(*), &b, SLOT(**) );

The content assistant will suggest the methods of type QObjectA that
have been marked as signals at *, and the methods of QObjectB that have
been marked as slots at **.

Change-Id: Ia6aaa71724547b0977e322399a500f072004767a
Reviewed-on: https://git.eclipse.org/r/10532
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-02-20 16:13:49 -05:00
Doug Schaefer
9c88bbc509 Fix overly strict dependency in qt.core. 2013-02-19 10:50:58 -05:00
Andrew Eidsness
862099aa7a Bug 399985: Semantic highlighting for qt signals/slots
The signals, slots, Q_SIGNALS, and Q_SLOTS macros are
used as 'keywords' when developing Qt applications.  This
patch adds a semantic highlighter for these keywords in
projects with a qtnature.

Change-Id: I7a5906aa69e6d7dab4ce20a16b425ae177f9bd25
Reviewed-on: https://git.eclipse.org/r/10179
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
2013-02-05 10:37:02 -05:00
Doug Schaefer
98e5959c90 Added template process to add nature. Added Qt nature. 2013-01-17 15:27:47 -05:00
Doug Schaefer
997f7b6607 Fix qt template to use variable instead of test data. 2013-01-14 17:13:13 -05:00