Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

[solved] error with connecting functions to button

$
0
0
Hi.. Myself trying to write a program in Qt connecting a function to a button in Qt5. #include <QApplication> #include <QtGui> #include <QPushButton> static void insert() { qDebug() << "pressed"; }     int main(int argc,char *argv[]) { QApplication app(argc,argv); QPushButton *button=new QPushButton("button"); button->setGeometry(50,100,150,80); QObject::connect(button,&QPushButton::clicked,insert()); button->show(); } But I am getting errors like main.cc:23:39: error: within this context main.cc:23:55: error: invalid use of void expression make: *** [main.o] Error 1 Please help… [code tags and solved, added, koahnig]

Viewing all articles
Browse latest Browse all 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>