↓ Skip to main content
  1. Posts/

qt 5.x 初探 (5) 

·166 words·1 min
Note: This article is available in Chinese only. 本文暂无英文版本。 View original

qt_5.9_ui_doc

还是比直接写代码方便点。。。所以不妨学习一个!

以及。。。qt在2017年6月1号发布了5.9。。。所以之前是5.8。。。现在变成5.9了。。。

遇到了修改了ui文件却没有生效的问题。。。

解决办法:

到项目目录下去执行:uic mainwindow.ui > ui_mainwindow.h

时间测试的qt方法。。。

 1头文件#include <QTime>
 2
 3
 4
 5QTime time;
 6
 7time.start();
 8
 9// do something
10
11 qDebug()<<time.elapsed()<<"ms";
12
13
14
15(注意单位。。。

Related

qt 5.x初探 (3)

·677 words·2 mins
update3: 终于知道了正确的学习姿势… 用百度把要用的东西大概描述出来,然后总能找到一个是你要的。。。 然后再去搜关键词。。。 嗯。。百度还是很有用的啊2333 qt5.8_doc_Line Edits Example 所以现在要把之前写成dialog的几个改回Line edit

qt 5.x 学习笔记 (2)

·3095 words·7 mins
先来放一波过程中用到的资料和官方文档好了。 basic layout_qt5.8 QBoxLayout Class_qt5.8 QString Class 5.8 QChar Class qt 5.8 Standard Dialogs Example qt 5.8 更新的部分还是放在最前面好了。 convert from QString to char *的时候有个坑。 In order to convert a QString to a char*, then you first need to get a latin1 representation of the string by calling toLatin1() on it which will return a QByteArray. Then call data() on the QByteArray to get a pointer to the data stored in the byte array. See the documentation: See the following example for a demonstration:

qt 5.x 初探(1)

·477 words·1 min
嘛。。为了系统安全课来学一波qt… 现在算是写出了一个可以打开文件,保存文件的记事本。 接下来要搞定的事情是,如何写一个自定义的事件?比如计算个开方之类的。