• 4241阅读
  • 6回复

这个错误是什么意思 [复制链接]

上一主题 下一主题
离线hlghlg123456
 

只看楼主 倒序阅读 楼主  发表于: 2014-12-20
— 本帖被 dbzhang800 从 Qt中文处理 移动到本区(2014-12-21) —
error: cannot call constructor 'QString::QString' directly
error:for a function-style cast, remove the redundant '::QString'
离线realfan

只看该作者 1楼 发表于: 2014-12-20
贴点代码上来呀
离线hlghlg123456

只看该作者 2楼 发表于: 2014-12-21
以前编译都没有问题,跟新了编译器版本arm-linux-gcc-4.5.1就出现了这个错误

void from1::Graph_2_slot()
{    
    send_key( Qt::Key_2 , 0 ,QString::QString("2") );
}

void from1::Graph_3_slot()
{  
    send_key( Qt::Key_3 , 0 ,QString::QString("3") );
}

void from1::Graph_4_slot()
{  
    send_key( Qt::Key_4 , 0 ,QString::QString("4") );
}

void from1::Graph_5_slot()
{  
    send_key( Qt::Key_5 , 0 ,QString::QString("5") );
}

void from1::Graph_6_slot()
{  
    send_key( Qt::Key_6 , 0 ,QString::QString("6") );
}

void from1::Graph_7_slot()
{  
    send_key( Qt::Key_7 , 0 ,QString::QString("7") );
}
离线dbzhang800

只看该作者 3楼 发表于: 2014-12-21
建议:你自己把顶楼的那两句error, 翻译成汉语。

错误和答案里面说的很清楚了。
离线edxoimkfvc

只看该作者 4楼 发表于: 2014-12-22
cannot call constructor 'QString::QString'
离线realfan

只看该作者 5楼 发表于: 2014-12-23
类的构造函数不是用来调用的
你的代码这样写
void from1::Graph_2_slot()
{    
    send_key( Qt::Key_2 , 0 ,QString("2") );
}
就可以了
离线hlghlg123456

只看该作者 6楼 发表于: 2014-12-23
多谢版主,我试试
快速回复
限100 字节
 
上一个 下一个