invalid conversion from ‘int’ to ‘QFont::Weight’ [-fpermissive] 109 | font3.setWeight(750);
-
Sorry but not understand ... In these day I convert My app from 5.15 to 6.7 ....
QFont font1; font1.setPointSize(11); font1.setBold(true); font1.setWeight(750);but have these error ....
invalid conversion from ‘int’ to ‘QFont::Weight’ [-fpermissive] 109 | font3.setWeight(750);I understand can not use 0-87 value as in previous version ... but seems can use value from 100 to 900 .... so not understand. I try to use 750.0 so error become .... from 'double' ...
-
Sorry but not understand ... In these day I convert My app from 5.15 to 6.7 ....
QFont font1; font1.setPointSize(11); font1.setBold(true); font1.setWeight(750);but have these error ....
invalid conversion from ‘int’ to ‘QFont::Weight’ [-fpermissive] 109 | font3.setWeight(750);I understand can not use 0-87 value as in previous version ... but seems can use value from 100 to 900 .... so not understand. I try to use 750.0 so error become .... from 'double' ...
@gfxx
Be aware that as per @Christian-Ehrlicher's new enumerated values you are not supposed to set it to exactly the750you used to have. That number would now lie betweenQFont::BoldandQFont::ExtraBold. I presume this is acceptable. If you really want specifically750you would presumably have to writefont1.setWeight(static_cast<QFont::Weight>(750))now. -
As you can see in the documentation setWeight() now takes an enum instead an integer - so change your code accordingly.
-
Sorry but not understand ... In these day I convert My app from 5.15 to 6.7 ....
QFont font1; font1.setPointSize(11); font1.setBold(true); font1.setWeight(750);but have these error ....
invalid conversion from ‘int’ to ‘QFont::Weight’ [-fpermissive] 109 | font3.setWeight(750);I understand can not use 0-87 value as in previous version ... but seems can use value from 100 to 900 .... so not understand. I try to use 750.0 so error become .... from 'double' ...
@gfxx
Be aware that as per @Christian-Ehrlicher's new enumerated values you are not supposed to set it to exactly the750you used to have. That number would now lie betweenQFont::BoldandQFont::ExtraBold. I presume this is acceptable. If you really want specifically750you would presumably have to writefont1.setWeight(static_cast<QFont::Weight>(750))now. -
G gfxx has marked this topic as solved on