QT下载
安装msvc2017 x86或者64
VS2019内设置【扩展-QT VS Tools-Options】
解决打开UI时使用Qt Designer闪退的问题,设置为true
解决生成Release版本的exe时报错缺少dll
提取.exe文件,然后打开命令行窗口,在.exe文件路径下执行
windeployqt xxx.exe
无法生成.moc文件
右键.h文件,属性
子Widget的继承类修改背景颜色无效
需要重写paintEvent
#include <QPainter>
#include <QStyleOption>
void MyWidget::paintEvent(QPaintEvent* event)
{
QStyleOption StyleOption;
StyleOption.initFrom(this);
QPainter Painter(this);
style()->drawPrimitive(QStyle::PE_Widget, &StyleOption, &Painter, this);
QWidget::paintEvent(event);
}