Re: [Interest] Qt basics - QObject::connect: signal not found

2017-11-06 Thread Thiago Macieira
On Monday, 6 November 2017 02:10:06 PST Nuno Santos wrote:
> What am I missing?

Most likely, the Q_OBJECT macro ad signals: declaration in A.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt basics - QObject::connect: signal not found

2017-11-06 Thread Nuno Santos
Konstantin,

It is supposed to be the same thing. 

I don’t know what happened but I have moved the signals declaration below in 
the header and now is working. 

It’s working now! I hate when I don’t know exactly what has made the 
difference..

Thanks anyway! 

Regards,

Nuno

> On 6 Nov 2017, at 11:04, Konstantin Shegunov  wrote:
> 
> On Mon, Nov 6, 2017 at 12:21 PM, Nuno Santos  > wrote:
> This is the function where the connect is called (in a Cocoa file)
> 
> [Snippet ...]
> 
> And the error is:
> 
> QObject::connect: signal not found in DRCController
> 
> I'm sorry I was left with the impression we are talking about C++, I have no 
> experience with the language you use (I imagine that's Objective-C).

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt basics - QObject::connect: signal not found

2017-11-06 Thread Konstantin Shegunov
On Mon, Nov 6, 2017 at 12:21 PM, Nuno Santos 
wrote:
>
> This is the function where the connect is called (in a Cocoa file)
>
> [Snippet ...]
>
> And the error is:
>
> QObject::connect: signal not found in DRCController
>

I'm sorry I was left with the impression we are talking about C++, I have
no experience with the language you use (I imagine that's Objective-C).
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt basics - QObject::connect: signal not found

2017-11-06 Thread Nuno Santos
Konstantin,

There isn’t much more, really! 

DRCController is B
IController is A

This is the function where the connect is called (in a Cocoa file)

- (void)openWithAu:(AudioUnit)inAU andController:(IController*)controller
{
_controller = controller;

_controller->connect(_controller, ::grabFocus, [=]() {

});
}

And the error is:

QObject::connect: signal not found in DRCController

That’s it! Nothing more! :(

Regards,

Nuno

> On 6 Nov 2017, at 10:15, Konstantin Shegunov  wrote:
> 
> 
> 
> On Mon, Nov 6, 2017 at 12:10 PM, Nuno Santos  > wrote:
> Hi,
> 
> Hi!
>  
> I have a class B that extends A.
> I’m passing a pointer of B casted to A to another C, and inside C I call:
> 
> You don't need to cast `B *` to `A *`, B is already A and is casted 
> implicitly (and safely) by the compiler.
> 
> I’m getting "signal not found in B” error
> 
> Could you attach the whole error (the one from the failed assertion), it 
> should contain the the template arguments resolution?

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt basics - QObject::connect: signal not found

2017-11-06 Thread Konstantin Shegunov
On Mon, Nov 6, 2017 at 12:10 PM, Nuno Santos 
wrote:

> Hi,
>

Hi!


> I have a class B that extends A.
> I’m passing a pointer of B casted to A to another C, and inside C I call:
>

You don't need to cast `B *` to `A *`, B is already A and is casted
implicitly (and safely) by the compiler.

I’m getting "signal not found in B” error
>

Could you attach the whole error (the one from the failed assertion), it
should contain the the template arguments resolution?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Qt basics - QObject::connect: signal not found

2017-11-06 Thread Nuno Santos
Hi,

I have a class B that extends A.

I’m passing a pointer of B casted to A to another C, and inside C I call:

connect(BPointerCastedToA, ::signal, [=]() { // do something });

I’m getting "signal not found in B” error

I have similar situations in which this scenario works (B extends A and I 
connect B to signals of A). I can’t understand why is not working. 

What am I missing? 

Thanks!

Regards,

Nuno


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest