QT下无法执行C++编译

安装QT完成后,无法执行c++项目的构建: Could not determine which “make” command to run. Check the “make” step in the build configuration. Error while building/deploying project xxx (kit: Desktop Qt 5.10.1 GCC 64bit) When executing step “qmake” 一般以为是qmake或make问题,但其实是C++的编译工具没指定:

Read More

QT-模态对话框与非模态对话框笔记

模态与非模态的定义: 模态对话框(Modal dialog box):只可在当前程序的当前对话框执行操作,不允许对当前程序的其他对话框执行操作。 非模态对话框(Modeless dialog box):打开当前程序的一个窗口后,仍能在当前程序的其他窗口执行操作。 在QT里创建对话框需包含头文件< QDialog>,创建非模态对话框可以用三种方法,常用的是在调用时new;第二种是提前声明其为类中成员函数;第三种是全局声明,这种很少用。 非模态对话框在调用时new,需注意空间的释放问题。 使用setAttribute属性事件接收Qt::WA_DeleteOnClose 事件,让QWidget在触发关闭事件时,自动delete。 setAttribute说明: void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on = true) 其返回值空,第二参为true时,接受第一参设置函数属性,false则清除事件属性。第二参不填则默认ture. WA_DeleteOnClose说明: Qt::WA_DeleteOnClose属于enum Qt::WidgetAttribute中的55。 其作用是接受关闭事件时,delete QWidget. //代码示例 QMenuBar *mBar = menuBar();//创建菜单栏 QMenu *pDlg = mBar->addMenu(“Menu”);//创建菜单 … “QT-模态对话框与非模态对话框笔记”

Read More