2013-04-18 5 views
1

나는이처럼 내 슬롯을 정의 :C++ Qt는 QObject를 :: 연결 : 없음 같은 슬롯을

void choixPoints:: prendpixel1(Pixel depart) 
{ 
//... 
} 

나는 다음과 같은 문장을 실행하려는 : 내가 얻을 실행할 때

Pixel depart= picmou->define(); //definition of a pixel, well defined 
connect(chp3, SIGNAL(clicked()), this, SLOT(prendpixel1(Pixel depart))); 

을 :

QObject::connect: No such slot choixPoints::prendpixel1(Pixel depart) 

왜 내 슬롯이 작동하지 않습니까?

답변

5

나는 문제가 SLOT 정의에 당신이 인의 변수 이름이 "출발"넣어 생각 올바르지 않습니다. SLOT 및 SIGNAL 정의에는 함수 이름과 유형 만 있어야합니다. 그래서 :

connect(chp3, SIGNAL(clicked()), this, SLOT(prendpixel1(Pixel))); 

가 BTW 나는 그것이 또한 공간에 민감한 생각, 그래서 SLOT(anotherfn(Pixel, Pixel))은 잘못된 것입니다.

HTH, 루스