0

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?

johnsyweb
  • 136,902
  • 23
  • 188
  • 247
user1162272
  • 31
  • 1
  • 6

3 Answers3

2

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

Luchian Grigore
  • 253,575
  • 64
  • 457
  • 625
0

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

snoofkin
  • 8,725
  • 14
  • 49
  • 86
0

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.

Wes
  • 4,781
  • 7
  • 44
  • 53