Qt学习笔记(二)

这篇博客主要介绍了Qt编程中常用的头文件,包括QProcess用于程序启动,QMessageBox用于显示信息提示,QFile进行文件读写,QFileDialog让用户选择文件或目录,以及QDir和QTextStream方便地操作目录和文本。
摘要由CSDN通过智能技术生成

在学习过程中,用到的一些头文件

1、#include<QProcess> 这个头文件在  “运行”这个程序中用到,用来打开程序。

/*   QProcess *myProcess = new QProcess(parent);
     myProcess->start(program, arguments);*/                                          argument争吵,arguments参数


QProcess *process=new QProcess;
    QString startProgram=ui->lineEdit->text();
    process->start(startProgram.trimmed());  //这几行代码就是打开了字符串所代表的程序


2、#inlude<QMassageBox>

在发生一些操作,要弹出一个提示信息的时候会用到information()函数,这个函数是QMessageBox继承来的。

information ( QWidget *, const QString &, const QString &, StandardButtons, StandardButton ) : StandardButton

这个函数返回的是StandarButton类型,第一个参数即对象自身,一般用this,第二个参数用来给出这个message的title “fdaffdfd”,第三个是信息内容 “fdshfsdhfsud”

第四个和第五个参数应该是用来设置这个小提示框的按钮,没用过。


3、#inlude<QFile>

    The QFile class provides an interface for reading from and writing to files.QFile提供了一个文件读写的接口。

QFile is an I/O device for reading and writing text and binary files andresources. A QFile may be used by itself or, more conveniently, with a

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值