Qt4-preview-feedback Archive, July 2007
Eclipse Integration and Code Style / Code Assist with signals/slots
Message 1 in thread
Hello,
I am trying out the release candidate of the Qt Eclipse integration
(Eclipse 3.3.0, CDT 4.0.0), and it looks like a very good job! However,
I am experiencing a few annoyances. The most critical thing to me is
that the CDT indexer who does not seem to work with signal/slot
declarations. As a result, neither code style (code format,
indentation) nor the -- far more important -- content assist works.
Is there any work going on with respect to this?
Holger
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Message 2 in thread
Hi,
we can reproduce that the signal and slot keywords are not recognized as keywords, so that indentiation and formatting fails. We will investigate possibilities, there.
Could you specify how the content assist does not work. What did you do, what did you expect and what did you get?
Regards,
Alessandro
Holger Berndt schrieb:
> Hello,
>
> I am trying out the release candidate of the Qt Eclipse integration
> (Eclipse 3.3.0, CDT 4.0.0), and it looks like a very good job! However,
> I am experiencing a few annoyances. The most critical thing to me is
> that the CDT indexer who does not seem to work with signal/slot
> declarations. As a result, neither code style (code format,
> indentation) nor the -- far more important -- content assist works.
>
> Is there any work going on with respect to this?
>
> Holger
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Message 3 in thread
Hi Alessandro,
thanks for your interest in this issue.
Alessandro Portale schrieb:
> we can reproduce that the signal and slot keywords are not recognized as
> keywords, so that indentiation and formatting fails. We will investigate
> possibilities, there.
>
> Could you specify how the content assist does not work. What did you do,
> what did you expect and what did you get?
I am attaching a minimal example of a source file. For content assist to
work I would expect to get autocompletion proposals for Var1-Var4 when I
type A.Var followed by CTRL-Space in the main function. This indeed
works if (and only if) there is no slot declaration in the class. Please
don't forget to update the indexer cache after experimenting with
commenting the slot declarations out, to actually the current situation.
I am not an Eclipse expert, but from what I know the content assist
bails out as soon as the CDT parsers fail to parse a file, which is as
soon as a slot declaration appears. The same might be the case with
signals, but I didn't check that. My guess is that the problems with the
identation and code assist are symptoms of the same ache.
This guess is backed up by the comments of some people from the CDT
newsgroup, see for example
http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg13684.html
http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg13751.html
(please regard this message as the "reminder" that is spoken of in the
second post ;).
Best regards,
Holger
#include <QObject>
#include <QObject>
class ClassA : public QObject
{
Q_OBJECT
public:
ClassA() {};
virtual ~ClassA() {};
int Var1;
float Var2;
double Var3;
unsigned long Var4;
//public slots:
// void mySlot();
};
int main(int argc, char *argv[])
{
ClassA A;
// Now try code assist on A.Var (type "A.Var" and hit CTRL-Space in the
// default config). It will work iff the two lines of the slot
// declaration in ClassA are commented out.
// After commenting/uncommenting, don't forget to rebuild the indexer cache
// to test the current situation (right-click in the navigator view on the
// project -> Index -> Rebuild)
return 0;
}
Message 4 in thread
Hi Holger,
Please go to the project's preferences and add YOUR_QT_INSTALL/
include/QtCore (and the other subdirectories as needed) to the C/C++
Include Paths and rebuild the index. This should fix the problems
with content assist.
CDT can't find qobject.h otherwise and, as a result, doesn't know
about the signals/slots definitions.
In the next build of the Qt Eclipse Integration we will add these
directories automatically.
Code formatting is still broken though; I will look further into it.
Best regards, Eike
On Jul 19, 2007, at 8:16 PM, Holger Berndt wrote:
> Hi Alessandro,
>
> thanks for your interest in this issue.
>
> Alessandro Portale schrieb:
>> we can reproduce that the signal and slot keywords are not
>> recognized as
>> keywords, so that indentiation and formatting fails. We will
>> investigate
>> possibilities, there.
>>
>> Could you specify how the content assist does not work. What did
>> you do,
>> what did you expect and what did you get?
>
> I am attaching a minimal example of a source file. For content
> assist to
> work I would expect to get autocompletion proposals for Var1-Var4
> when I
> type A.Var followed by CTRL-Space in the main function. This indeed
> works if (and only if) there is no slot declaration in the class.
> Please
> don't forget to update the indexer cache after experimenting with
> commenting the slot declarations out, to actually the current
> situation.
>
> I am not an Eclipse expert, but from what I know the content assist
> bails out as soon as the CDT parsers fail to parse a file, which is as
> soon as a slot declaration appears. The same might be the case with
> signals, but I didn't check that. My guess is that the problems
> with the
> identation and code assist are symptoms of the same ache.
> This guess is backed up by the comments of some people from the CDT
> newsgroup, see for example
>
> http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg13684.html
> http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg13751.html
>
> (please regard this message as the "reminder" that is spoken of in the
> second post ;).
>
>
> Best regards,
> Holger
> #include <QObject>
>
> class ClassA : public QObject
> {
> Q_OBJECT
>
> public:
> ClassA() {};
> virtual ~ClassA() {};
>
> int Var1;
> float Var2;
> double Var3;
> unsigned long Var4;
>
> //public slots:
> // void mySlot();
> };
>
> int main(int argc, char *argv[])
> {
> ClassA A;
>
> // Now try code assist on A.Var (type "A.Var" and hit CTRL-Space
> in the
> // default config). It will work iff the two lines of the slot
> // declaration in ClassA are commented out.
> // After commenting/uncommenting, don't forget to rebuild the
> indexer cache
> // to test the current situation (right-click in the navigator
> view on the
> // project -> Index -> Rebuild)
>
> return 0;
> }
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Message 5 in thread
Hello Eike,
On Mo, 23.07.2007 15:51, Eike Preuss wrote:
>Please go to the project's preferences and add YOUR_QT_INSTALL/
>include/QtCore (and the other subdirectories as needed) to the C/C++
>Include Paths and rebuild the index. This should fix the problems
>with content assist.
indeed it seems like I missed some Qt include directories in Eclipse's
include path. Thanks for pointing this out! Content-Assist seems to
work fine now.
>Code formatting is still broken though; I will look further into it.
And another thank you for your interest in this issue as well.
Greetings,
Holger
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Message 6 in thread
>> Code formatting is still broken though; I will look further into it.
>
> And another thank you for your interest in this issue as well.
CDT's formatter seems to get confused whenever a macro has an access
keyword (like 'protected') in it (which is used in Qt), i filed a bug
here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=197494
++ Eike
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Message 7 in thread
On Fr, 27.07.2007 10:45, Eike Preuss wrote:
>CDT's formatter seems to get confused whenever a macro has an access
>keyword (like 'protected') in it (which is used in Qt), i filed a bug
>here
>
>https://bugs.eclipse.org/bugs/show_bug.cgi?id=197494
Thanks, Eike! FYI, I posted an update about the issues discussed in this
thread to the CDT newsgroup.
Holger
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx