我在Windows下用Qt做一个登录界面,怎么把密码(QlineEdit)输入框的鼠标右键给屏蔽了? bool Dialog_regis
我在Windows下用Qt做一个登录界面,怎么把密码(QlineEdit)输入框的鼠标右键给屏蔽了?boolDialog_register::eventFilter(QO...
我在Windows下用Qt做一个登录界面,怎么把密码(QlineEdit)输入框的鼠标右键给屏蔽了?
bool Dialog_register::eventFilter(QObject *target, QEvent *event)
{
if(event->type()==QEvent::MouseButtonPress)
{
QMouseEvent *event1 = static_cast<QMouseEvent*>(event);
if (event1->button()==Qt::RightButton)
{
qDebug("Ate MouseButtonPress %d", event1->button());
return true;
}
}
if(event->type()==QEvent::MouseButtonRelease)
{
QMouseEvent *event1 = static_cast<QMouseEvent*>(event);
if (event1->button()==Qt::RightButton)
{
qDebug("Ate MouseButtonPress %d", event1->button());
return true;
}
} 展开
bool Dialog_register::eventFilter(QObject *target, QEvent *event)
{
if(event->type()==QEvent::MouseButtonPress)
{
QMouseEvent *event1 = static_cast<QMouseEvent*>(event);
if (event1->button()==Qt::RightButton)
{
qDebug("Ate MouseButtonPress %d", event1->button());
return true;
}
}
if(event->type()==QEvent::MouseButtonRelease)
{
QMouseEvent *event1 = static_cast<QMouseEvent*>(event);
if (event1->button()==Qt::RightButton)
{
qDebug("Ate MouseButtonPress %d", event1->button());
return true;
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询