Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » QT and CDT
QT and CDT [message #125820] Thu, 04 November 2004 05:43 Go to next message
Eclipse UserFriend
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 07:14 Go to previous messageGo to next message
Eclipse UserFriend
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 07:58 Go to previous messageGo to next message
Eclipse UserFriend
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 14: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 16: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 10:28 Go to previous messageGo to next message
Eclipse UserFriend
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 13:05 Go to previous messageGo to next message
Eclipse UserFriend
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 02:03 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Import a list of files
Next Topic:Debugging win32 C/C++ console application in Helios
Goto Forum:
  


Current Time: Tue Jul 08 18:23:28 EDT 2025

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

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

Back to the top