Qt4-preview-feedback Archive, January 2008
Re: Qt Eclipse Integration: syntax highlighting with Q_SIGNALS and Q_SLOTS
Message 1 in thread
Hi,
here comes a late answer :/
Please try increasing the available memory for the indexer cache:
Preferences->C/C++->Parser in CDT3 and
Preferences->C/C++->Indexer->Cache Limits in CDT4
You might also want to give Eclipse more memory in general, and start
it with something like
eclipse -vmargs -Xmx500M
from the command line.
If you put
#include "qobject.h"
directly in your files, you avoid the additional indirection, so the
indexer parses it earlier in the process.
But you will probably miss some other things instead if the indexer
can't use enough memory!
Best regards, Eike
On Nov 28, 2007, at 2:26 PM, Niko Paltzer wrote:
> Hi,
>
> I discovered that for some files, I don't get proper syntax
> highlighting (and Eclipse outline) if I use Q_SIGNALS or Q_SLOTS.
>
> So I created a small example.
>
> I have QtCore in the include path.
>
> In the first case, slot() ist not highlighted and the whole Object
> does not show up in the Eclipse outline (but the include was resolved,
> it shows up in the outline).
>
> ===================================
> #include <QObject>
>
> class Object {
> public Q_SLOTS:
> void slot();
> };
> ===================================
>
> In the following case, everything works as expected.
>
> ===================================
> #include "qobject.h"
>
> class Object {
> public Q_SLOTS:
> void slot();
> };
> ===================================
>
> The funny thing is the content of QtCore/QObject, namely:
>
> ===================================
> #include "qobject.h"
> ===================================
>
> Might there be something wrong with my Eclipse settings?
> Or is this a bug in the eclipse indexer (or whatever is responsible
> for generating the outline)?
> Or can the Qt Eclipse Integration do sth. to resolve the problem?
>
> Thanks in advance for any hints.
>
> Regards, Niko
>
> To unsubscribe - send "unsubscribe" in the subject to qt4-preview-
> feedback-request@xxxxxxxxxxxxx
>
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Message 2 in thread
On Jan 9, 2008, at 3:26 PM, Niko Paltzer wrote:
> Hello Eike,
>
> thanks for the hint. Unfortunately, it does not work for me. I tried
> with heap size limit 40 % (max possible) and 512 MB but my previously
> posted example still fails.
Hi Niko,
First try: Please do a indexer->rebuild after changing the settings,
if you didn't.
I assume you put your example code in a header file?
Do you include your header file in any of your project's cpp files?
If not, then CDT might not follow includes in it. For me it works if
I either
* include the example header in one of the cpp files
* check the preferences -> C/C++ -> Indexer -> Index all files
* instead of doing a #include <QObject> e.g. a #include <QWidget>
(one of my cpp files includes a header that includes QWidget), which
is no "solution". but a funny effect.
You can check whether the indexer could find a macro by hovering your
mouse over it - if the macro isn't empty it shows its definition in a
tool tip. That doesn't work for Q_SLOT because it actually IS empty,
but if you add the Q_OBJECT macro to your example class (which it
should have anyway :) ), you can use it as another indicator.
And of course you need to set a valid Qt version in Preferences->Qt,
but I assume you do.
Hope that helps, Eike
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Message 3 in thread
Hi Eike,
thanks for your detailed response!
I did some tests again and sometimes it worked, sometimes it didn't.
Unfortunately, I could not figure out which settings where responsible
for which behaviour.
I gave up, when I encountered the following:
I had a situation where I got no tool tip for Q_OBJECT.
I switched to a different editor window and back again and then I got
the tool tip.
From now on I will accept the (crazy) behaviour of the indexer as it is. :-)
Regards, Niko
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx