简体   繁体   English

在QT中启用触摸屏时出错

[英]Error on enabling touchscreen in QT

I want to enable touchscreen in QT, so I gave: 我想在QT中启用触摸屏,所以我给出了:

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)); 错误:没有匹配的函数来调用'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));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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