Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » QT and CDT
QT and CDT [message #125820] Thu, 04 November 2004 10:43 Go to next message
Gael Martin is currently offline Gael MartinFriend
Messages: 46
Registered: July 2009
Member
Dear all, I'm using CDT 2.1RC0 to develop QT applications.
QT use this signals/slots mechanism, therefore you do find the macro
"slots" and "signals" in the classes declaration, for instance:

class Test : public QObject
{
public:
Test();
~Test();
private slots:
void mySlot();
signals:
void mySignal();
}

However the CDT parser failed to register the class whenever it finds
the word "signals" or "slots" in the class declaration. Is there anyway
to configure the parser to ignore them and still register this as a
class or I have to dig into the code?

Gael
Re: QT and CDT [message #125860 is a reply to message #125820] Thu, 04 November 2004 12:14 Go to previous messageGo to next message
Vaidotas Radžius is currently offline Vaidotas RadžiusFriend
Messages: 14
Registered: July 2009
Junior Member
Gael Martin wrote:
> Dear all, I'm using CDT 2.1RC0 to develop QT applications.
> QT use this signals/slots mechanism, therefore you do find the macro
> "slots" and "signals" in the classes declaration, for instance:
>
> class Test : public QObject
> {
> public:
> Test();
> ~Test();
> private slots:
> void mySlot();
> signals:
> void mySignal();
> }
>
> However the CDT parser failed to register the class whenever it finds
> the word "signals" or "slots" in the class declaration. Is there anyway
> to configure the parser to ignore them and still register this as a
> class or I have to dig into the code?
>
> Gael
>
In Project Peoperties -> C/C++ Include Paths & Symbols press Add
Preprocessor Symbol button and type in signals=/*signals*/. Repeat the
same with slots

Maybe this helps
Vaidas
Re: QT and CDT [message #125887 is a reply to message #125860] Thu, 04 November 2004 12:58 Go to previous messageGo to next message
Gael Martin is currently offline Gael MartinFriend
Messages: 46
Registered: July 2009
Member
Vaidotas Radžius wrote:
> In Project Peoperties -> C/C++ Include Paths & Symbols press Add
> Preprocessor Symbol button and type in signals=/*signals*/. Repeat the
> same with slots

Indeed, that works fine now, thanks ever so much.

Gael
Re: QT and CDT [message #125965 is a reply to message #125860] Thu, 04 November 2004 19:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alain.nowhere.ca

Vaidotas Radžius wrote:

> Gael Martin wrote:
>> Dear all, I'm using CDT 2.1RC0 to develop QT applications.
>> QT use this signals/slots mechanism, therefore you do find the macro
>> "slots" and "signals" in the classes declaration, for instance:
>>
>> class Test : public QObject
>> {
>> public:
>> Test();
>> ~Test();
>> private slots:
>> void mySlot();
>> signals:
>> void mySignal();
>> }
>>
>> However the CDT parser failed to register the class whenever it finds
>> the word "signals" or "slots" in the class declaration. Is there anyway
>> to configure the parser to ignore them and still register this as a
>> class or I have to dig into the code?
>>
>> Gael
>>
> In Project Peoperties -> C/C++ Include Paths & Symbols press Add
> Preprocessor Symbol button and type in signals=/*signals*/. Repeat the
> same with slots

> Maybe this helps

But are not those things define somewhere in a qt header, for all to use.
maybe the problem is that this file was not included i.e. #include
qt_macros.h
are something ?

Not a QT expert

> Vaidas
Re: QT and CDT [message #134667 is a reply to message #125965] Wed, 12 January 2005 21:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pardsbane.offthehill.org

alain wrote:
> Vaidotas Radžius wrote:
>
>> Gael Martin wrote:
>>
>>> Dear all, I'm using CDT 2.1RC0 to develop QT applications.
>>> QT use this signals/slots mechanism, therefore you do find the macro
>>> "slots" and "signals" in the classes declaration, for instance:
>>>
>>> class Test : public QObject
>>> {
>>> public:
>>> Test();
>>> ~Test();
>>> private slots:
>>> void mySlot();
>>> signals:
>>> void mySignal();
>>> }
>>>
>>> However the CDT parser failed to register the class whenever it finds
>>> the word "signals" or "slots" in the class declaration. Is there
>>> anyway to configure the parser to ignore them and still register this
>>> as a class or I have to dig into the code?
>>>
>>> Gael
>>>
>> In Project Peoperties -> C/C++ Include Paths & Symbols press Add
>> Preprocessor Symbol button and type in signals=/*signals*/. Repeat the
>> same with slots
>
>
>> Maybe this helps
>
>
> But are not those things define somewhere in a qt header, for all to use.
> maybe the problem is that this file was not included i.e. #include
> qt_macros.h
> are something ?

Yes, however, they are defined as:

#define signal
#define slot

so perhaps they cannot be properly interpreted?
Re: QT and CDT [message #134877 is a reply to message #134667] Fri, 14 January 2005 15:28 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
not knowing anything about QT : note that even if signals & slots are
#defined away, the below code would be preprocessed as:
....
private : //ok
void mySlot();
: //not ok
void mySignal();

with the given code, you would need to #define signals as one of public,
protected, private.

-Andrew

"Joshua Pollak" <pardsbane@offthehill.org> wrote in message
news:cs46cf$6hl$1@www.eclipse.org...
> alain wrote:
> > Vaidotas Rad
Re: QT and CDT [message #641509 is a reply to message #134667] Thu, 25 November 2010 18:05 Go to previous messageGo to next message
Daniel  is currently offline Daniel Friend
Messages: 2
Registered: August 2010
Junior Member
Hello guys,

Propably it is not anymore usefull for you, but what i do to get it work is the following:

first i add the path that vaias said before:

"In Project Peoperties -> C/C++ Include Paths & Symbols press Add
Preprocessor Symbol button and type in signals=/*signals*/. Repeat the
same with slots "

And then i add
#define signals
#define slots

as well as the declaration of the slot: (for example)

private slots:
void on_Ok_clicked();

on the ui_AddressBook.h

finally the code for the on_Ok_clicked() on the AddresBook.cpp.

I hope it is gonna help someone....



Re: QT and CDT [message #641568 is a reply to message #641509] Fri, 26 November 2010 07:03 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Daniel wrote on Thu, 25 November 2010 19:05
Hello guys,

Propably it is not anymore usefull for you, but what i do to get it work is the following:

first i add the path that vaias said before:

"In Project Peoperties -> C/C++ Include Paths & Symbols press Add
Preprocessor Symbol button and type in signals=/*signals*/. Repeat the
same with slots "

And then i add
#define signals
#define slots

as well as the declaration of the slot: (for example)

private slots:
void on_Ok_clicked();

on the ui_AddressBook.h

finally the code for the on_Ok_clicked() on the AddresBook.cpp.

I hope it is gonna help someone....


It is not necessary to add the defines manually. You should add the include path for Qt in Project Peoperties -> C/C++ General->Include Paths & Symbols->Includes (C++). Eclipse will then find the correct headers and can resolve the symbols.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Import a list of files
Next Topic:Debugging win32 C/C++ console application in Helios
Goto Forum:
  


Current Time: Tue Apr 16 12:25:42 GMT 2024

Powered by FUDForum. Page generated in 0.34606 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top