static_cast 使用

static_cast 用于基本类型转换,入int转double:

int distanceThreshold  = 4;

double val = static_cast<qreal>(distanceThreshold + 1);

猜你喜欢

转载自www.cnblogs.com/codingonelife/p/9221935.html
今日推荐