简体   繁体   中英

Error on enabling touchscreen in QT

I want to enable touchscreen in QT, so I gave:

ui->pushButton->setsetAttribute(Qt::WA_AcceptTouchEvents,true); 

but it shows the following error:

error: no matching function for call to 'QPushButton::setAttribute(bool)' ui->pushButton->setAttribute((Qt::WA_AcceptTouchEvents,true)); ^

Remove the superfluous parentheses:

ui->pushButton->setAttribute(Qt::WA_AcceptTouchEvents,true);

vs.

ui->pushButton->setAttribute((Qt::WA_AcceptTouchEvents,true));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM