2010-06-10 82 views
0

在這樣的代碼:當光標在SIGNAL括號寫按鈕事件QT智能感知問題

#include <QApplication> 
#include <QPushButton> 

int main(int argc,char *argv[]) 
{ 
    QApplication app(argc,argv); 
    QPushButton *button = new QPushButton("Button Text"); 
    QObject::connect(button,SIGNAL(clicked()),&app,SLOT(quit())); 
    button->show(); 
    return app.exec(); 
} 

智能感知正在出現。但是在SLOT括號中不會出現app方法嗎?

是它與應用&性格有關係嗎?

alt text

回答

0

我覺得很愚蠢。

QObject::connect(button,SIGNAL(clicked()),&app,SLOT(quit())); 

quit()或智能感知不會出現,因爲任何函數都可以寫在圓括號之間。