c++ - QSize 与使用 2 Int 有常量

标签 c++ qt constants qt-creator

我正在做一个需要 2 个常量的项目:

Minimum Size of application (Width, Height) 
Initial Size of application (Width, Height)

我想知道哪个会占用更少的内存:

1- One QSize (which the variable would contain the initial width and height and the minimum being scaled of this QSize)

2- 4 ints (MinH, MinW, IniH, IniW)

感谢您的建议!

最佳答案

代码:

std::cout << "QSize: " << sizeof(QSize) << std::endl;

输出:

QSize: 8

你算一下。

关于c++ - QSize 与使用 2 Int 有常量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8594127/

相关文章:

c++ - C++下的RS-232混淆

c++ - 带有 const 模板参数的模板模板类

c++ - Qt-如何在不显式实现线程的情况下同时运行两个槽

c++ - 将 float 转换为 int,还是将 int 转换为 float?

php - 寻找正确的 PHP 套接字错误常量

java - java中的常量和属性

c++ - UAC 提示提升 - 它是如何工作的?

c++ - 检查单链表是否为空c++

qt - Qt 项目中的子目录

c++ - 当焦点转移到按钮被中断时,QPushButton 卡住绘图按下