user1162272
user1162272

Reputation: 31

Connect Function

What is this in the following QT function call?

connect(findButton, SIGNAL(clicked()), this, SLOT(findClicked()));

I know the background of this in C++ but what is this pointing to in this function call?

Upvotes: 0

Views: 1994

Answers (3)

Wes
Wes

Reputation: 5067

In this example you are connecting:

  • findButton's clicked() SIGNAL

with:

  • this's findClicked() SLOT

This is most likely the object in which the connect line's code is located.

To answer your question, you need to check and see what object is being created in the code that contains the connect call.

Upvotes: 0

snoofkin
snoofkin

Reputation: 8895

this is more like a C++ question than Qt's one, If you dont know what it means, go and read some more about C++ rather than study Qt. See this about this

Upvotes: 0

Luchian Grigore
Luchian Grigore

Reputation: 258618

this points to the current object. The method is called from a member function.

Upvotes: 2

Related Questions