qmessagebox

结对编程作业

☆樱花仙子☆ 提交于 2019-12-01 14:00:59
一、GitHub地址 https://github.com/huangzihaohzh/ExerciseMaker 二、估计耗费的时间 PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) Planning 计划 40 40 · Estimate · 估计这个任务需要多少时间 40 40 Development 开发 1400 1550 · Analysis · 需求分析 100 120 · Design Spec · 生成设计文档 60 70 · Design Review · 设计复审 40 50 · Coding Standard · 代码规范 30 40 · Design · 具体设计 90 100 · Coding · 具体编码 900 950 · Code Review · 代码复审 60 70 · Test · 测试(自我测试,修改代码,提交修改) 120 150 Reporting 报告 130 140 · Test Report · 测试报告 60 80 · Size Measurement · 计算工作量 30 20 · Postmortem & Process Improvement Plan · 事后总结, 并提出过程改进计划 40 40 合计   1530 1690 三、效能分析 优化时间

Auto close QMessageBox

半世苍凉 提交于 2019-11-30 09:15:58
I'm building a Qt Symbian Project and I want to show a notification for the user that should auto close after some seconds. I have seen that Nokia uses this a lot in their ui. Right now I'm using the code below so that the user can close the QMessageBox but I would like it if it was possible to auto close the QMessageBox after 1 or 2 seconds. How can I do this using Qt? QMessageBox msgBox; msgBox.setText("Hello!"); msgBox.setIcon(QMessageBox::Information); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.exec(); Andy M I would suggest to subclass QMessageBox to add your own desired behavior.

pyqt对话框

江枫思渺然 提交于 2019-11-30 05:53:01
1 import sys 2 from PyQt5.QtCore import * 3 from PyQt5.QtGui import * 4 from PyQt5.QtWidgets import * 5 class MyWindow(QWidget): 6 def __init__(self,parent=None): 7 super(MyWindow,self).__init__(parent) 8 self.setWindowTitle("弹出式对话框例子") 9 self.resize(400,200) 10 self.btn1=QPushButton(self) 11 self.btn1.setText("消息框") 12 self.btn1.clicked.connect(self.msg1) 13 layout=QVBoxLayout() 14 15 self.btn2=QPushButton(self) 16 self.btn2.setText("问答对话框") 17 self.btn2.clicked.connect(self.msg2) 18 19 self.btn3=QPushButton() 20 self.btn3.setText("警告对话框") 21 self.btn3.clicked.connect(self.msg3) 22 23 self

NeHe教程Qt实现——lesson09

蹲街弑〆低调 提交于 2019-11-29 21:40:56
NeHe 系列教程之九: 在3D空间中移动位图 英文教程地址: lesson09 本课基于 第一课 的代码, 利用颜色混合的方法,将一个黑白纹理与随机颜色进行混合,产生绚丽的效果。 首先是定义相关变量和数据结构,如下所示: namespace { bool twinkle; // Twinkling Stars bool tp; // 'T' Key Pressed? const int num = 50; // Number Of Stars To Draw typedef struct // Create A Structure For Star { int r, g, b; // Stars Color GLfloat dist; // Stars Distance From Center GLfloat angle; // Stars Current Angle }stars; // Structures Name Is Stars stars star[num]; // Make 'star' Array Of 'num' Using Info From The Structure GLfloat zoom=-15.0f; // Viewing Distance Away From Stars GLfloat tilt=90.0f; // Tilt The View

Auto close QMessageBox

橙三吉。 提交于 2019-11-29 13:59:20
问题 I'm building a Qt Symbian Project and I want to show a notification for the user that should auto close after some seconds. I have seen that Nokia uses this a lot in their ui. Right now I'm using the code below so that the user can close the QMessageBox but I would like it if it was possible to auto close the QMessageBox after 1 or 2 seconds. How can I do this using Qt? QMessageBox msgBox; msgBox.setText("Hello!"); msgBox.setIcon(QMessageBox::Information); msgBox.setStandardButtons

QMessageBox 主要用法

人盡茶涼 提交于 2019-11-29 06:10:56
QMessageBox 主要有四个对话框 1.Question 普通操作询问问题 2.Information 普通操作报告信息 3.Warning 不太严肃的错误报告信息 4.Critical 严肃的报告信息 拿warning举例: 第一个参数是指定父窗口 第二个参数是弹出对话框的标题 第三个参数是对话框的内容 第四个参数是添加的按钮(不写也会有默认的) QMessageBox::warning(this,"title","text",QMessageBox::Ok|QMessageBox::Cancel); 其余三个大同小异: QMessageBox::warning(this,"title","text",QMessageBox::Ok|QMessageBox::Cancel); QMessageBox::critical(this,"title","text",QMessageBox::Ok|QMessageBox::Cancel); QMessageBox::information(this,"title","text",QMessageBox::Ok|QMessageBox::Cancel); QMessageBox::question(this,"title","text",QMessageBox::Ok|QMessageBox::Cancel); 来源: https:

GUI学习之二十八—QMessageBox

牧云@^-^@ 提交于 2019-11-29 05:10:11
   今天来学习下QMessageBox。 QMessageBox主要用来通知用户或者请求用户提问和接收应答一个模态对话框。 一.对话框的构成 图标是有标准图标的,可以直接调用。 我们声明的消息框,初始状态都是模态的(阻塞程序,这里就不演示了),如果想把它变成非模态的,可以直接设置 mb = QMessageBox(self) # mb.setModal(False) #方法1 mb.setWindowModality(Qt.NonModal) #方法2 mb.show() 上面两个方法都是可以的,但是必须是窗口级别的控件(show()方法调用的,open和exec是不可以的。) 二.内容展示    1.图标     标准图标的展示方法 QMessageBox.setIcon(self, a0: 'QMessageBox.Icon') #图标枚举值type: 'QMessageBox.Icon' NoIcon = ... # 无图标 Information = ... # 信息图标(也可以表示消息无异常) Warning = ... # 警告图标 Critical = ... # 严重警告图标 Question = ... # 提问图标     此外还可以添加自定义图标 QMessageBox.setIconPixmap(self, a0: QtGui.QPixmap)    2

串口调试助手--Qt

删除回忆录丶 提交于 2019-11-28 17:31:20
串口调试助手----------该程序使用Qt框架,C ++语言编译而成 项目文件介绍: main.cpp 该文件为该程序的入口程序 mainwindow.h 该文件为该程序的主要声明部分 mainwindow.cpp 该文件为该程序的主要定义部分 mainwindow.ui 该文件为该程序的ui界面设计 界面.png 界面的显示效果 该文件中获取串口是通过读取Windows系统下的注册表中的信息得到的, - 使用Qt中的定时器来每个3s读取一次注册表 串口通信方面:通过使用Qt的封装的QSerialPort来实现 main.cpp #include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QSerialPort> #include <QTimer> namespace Ui { class MainWindow; } class MainWindow :

PyCharm中Qt Designer+PyUIC配置

陌路散爱 提交于 2019-11-28 07:45:20
本文环境配置: 系统=>windows10:64位 语言=>Python:3.7.1 第三方库 PyQT5:5.11.3 pyqt5-tools:5.11.3.1.4 工具=>PyCharm:2018.3.1 使用PyCharm,根据不同的项目搭建独立的虚拟环境 打开PyCharm 点击New Project 选择Pure Python,具体设置如下: 项目路径自定义 选择venv(virtualenv)目录,这里存放一个虚拟的python环境。这里所有的类库依赖都可以直接脱离系统安装的python独立运行。 制定虚拟环境解释器以本地安装的哪个python版本来创建。 用同样的方法在创建一个GUI的项目。这样在我们的Project文件中就有两个文件夹,每一个文件夹对应一个项目。 不同的项目需要不同的第三方库。而PyCharm是根据项目来管理第三方库的安装。这样做的好处有很多。 python项目可以独立部署 防止一台服务器部署多个项目之间存在类库的版本依赖问题发生 也可以充分发挥项目的灵活性 在PyCharm中安装项目需要的包和插件 1、进入GUI项目,安装PyQt5和pyqt5-tools包 2、添加Qt Designer工具,Tools——External Tools——点击右侧的"+" Name: 输入最后工具在菜单中的想呈现名称,比如我这里命名为 QT Designer

PyQt5 控件学习(一个一个学习之QMessageBox)

谁说我不能喝 提交于 2019-11-28 07:30:27
QMessageBox继承图: QMessageBox描述: QMessageBox继承: 它继承自QDialog QMessageBox功能作用: QMessageBox功能作用之构造函数: from PyQt5.Qt import * #刚开始学习可以这样一下导入 import sys class Window(QWidget): def __init__(self): super().__init__() self.setWindowTitle("QMessageBox的学习") self.resize(400,400) self.set_ui() def set_ui(self): messageBox = QMessageBox(self) #强行变为非模态的方法: # messageBox.setModal(False) # messageBox.setWindowModality(Qt.NonModal) messageBox.show() if __name__ == '__main__': app =QApplication(sys.argv) window = Window() window.show() sys.exit(app.exec_()) View Code 第二个构造函数: from PyQt5.Qt import * #刚开始学习可以这样一下导入