1. vs中Qt添加模块在这个位置:
VS2019 Qt 怎么添加Qt模块?_qt+vs添加第三方qt模块_令狐掌门的博客-CSDN博客

2.布局学习
(1)
    QVBoxLayout *layout=new QVBoxLayout(this);
    QWidget *w1=new QWidget;
    QWidget *w2=new QWidget;
    w1->setStyleSheet("background-color:red");
    w2->setStyleSheet("background-color:green");
    layout->addWidget(w1,1);
    layout->addWidget(w2,7);
    //1:7的比例
    setLayout(layout);
(2)
    setContentsMargins(15, 15, 15, 15);
    setStyleSheet("background-color:black");
    QVBoxLayout *layout=new QVBoxLayout(this);
    QWidget *w1=new QWidget;
    w1->setStyleSheet("background-color:red");
    layout->addWidget(w1,1);
    layout->setContentsMargins(5,5,5,5);
    setLayout(layout);
黑色区域:
宽度15+5=20
15来自窗体,5来自layout。
3.WinExec
WinExec("calc.exe", SW_SHOW);
SW_SHOW 用当前的大小和位置显示一个窗口,同时令其进入活动状态
WinExec("calc.exe", SW_SHOWMAXIMIZED);
WinExec("Notepad.exe", SW_SHOW);
WinExec("Notepad.exe", SW_SHOWMAXIMIZED);
WinExec("Notepad.exe", SW_HIDE);
//会出现在任务管理器中,但不会显示在任务栏。
运行ScreenToGif.exe:
#include <Windows.h>
#include <stdlib.h>
#include <iostream>
#include "tchar.h"
int main(
	int argc, char* argv[]) {
	int res = WinExec("E:\\ScreenToGif\\ScreenToGif.exe", SW_SHOW);
	std::cout << res<<'\n';
	if (res == 0) {
		std::cout << "系统内存或资源不足";
	}
	else if (res == ERROR_BAD_FORMAT) {
		std::cout << ".EXE文件格式无效";
	}
	else if (res == ERROR_FILE_NOT_FOUND) {
		std::cout << "指定的文件没有找到";
	}
	else if (res == ERROR_PATH_NOT_FOUND) {
		std::cout << "指定的路径没有找到";
	}
	return 0;
}注意:路径中是\\
同理:
打开网易词典
int res = WinExec("E:\\网易有道词典\\Dict\\YodaoDict.exe", SW_SHOW);
打开指定的txt文件
	int res = WinExec("notepad.exe D:\\2.txt", SW_SHOW);这样也可以:
	std::string str("notepad.exe D:\\work\\版本\\1.0.1\\OfficeAssistant2.0\\Debug\\license.txt");
	int res = WinExec(str.c_str(), SW_SHOW);这样也可以:
	QString str1("notepad.exe D:\\work\\learn_git\\Git\\2.txt");
	int res = WinExec(str1.toStdString().c_str(), SW_SHOW);这样也可以:
QString中文乱码_qstring 中文_Coder-LiyG的博客-CSDN博客
	QString str1=QString::fromLocal8Bit("notepad.exe D:\\work\\版本\\1.0.1\\OfficeAssistant2.0\\Debug\\license.txt");
	QByteArray by = str1.toLocal8Bit();
	int res = WinExec(str1.toLocal8Bit().constData(), SW_SHOW);4.patch:补丁



















