iso c++ says that these are ambiguous ,even thought the worst conversion

iso c++ says that these are ambiguous ,even thought the worst  conversion

for the first is better the worst conversion for the second :
数据类型转换导致产生歧义的错误。
这是一段源代码分享给大家:
/*
   path1.addEllipse(QPointF(qreal(m_Width*m_Height),qreal

(m_Height)),qreal(m_Height-3),qreal(m_Height-3));
/////////////////////////////////////////////////////////////
path1.addEllipse(QPointF(int(m_Width*m_Height),int(m_Height)),int

(m_Height-3),int(m_Height-3));
*/

这里的"int"和"qreal"在Windows下可以互用或者互换,但是到了linux下得严格按照

qt gui里面的接口定义来,不然直接报错。
QPointF ( qreal x, qreal y );
QPpint(int,int);参数导致的错误。
在windows和linux平台互相交错开发,看来移植性和平台性很好的qt仍然需要注意良

好的开发习惯的培养,平台差异性也不得不考虑。

你可能感兴趣的:(C++,linux,windows,qt,Path,平台)