上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 60 下一页

2016年10月27日

QT QMianWindow类

摘要: QMianWindow是一个为用户提供主窗口程序的类,包含一个菜单栏(menu bar)、及一个中心部件(central widget),是许多应用程序的基础,如文本编辑器等。 QMainWindow中菜单需要QMenu类和QAction类来实现。 QAction类定义了菜单的具体行为。 QMain 阅读全文

posted @ 2016-10-27 22:36 寒魔影 阅读(1460) 评论(0) 推荐(0)

2016年10月24日

QT 文件操作

摘要: QT提供了QFile类用于文件读写 QFile可以读写文本文件,也可以读写二进制文件 #include "widget.h" #include #include #include #include #include Widget::Widget(QWidget *parent) : QWidget(parent) { btn1=new QPushButton();... 阅读全文

posted @ 2016-10-24 21:11 寒魔影 阅读(431) 评论(0) 推荐(0)

QT QToolBox类

摘要: QToolBox类的创建 //drawer.h #ifndef DRAWER_H #define DRAWER_H #include #include #include "widget.h" class Drawer : public QToolBox { Q_OBJECT public: explicit Drawer(QWidget *parent = 0... 阅读全文

posted @ 2016-10-24 17:16 寒魔影 阅读(3670) 评论(1) 推荐(0)

2016年10月23日

C语言 自动修改文件名小程序

摘要: #define _CRT_SECURE_NO_WARNINGS #include #include #include #include int protectstr(const char *name,char *newname,int len) { int errmsg = 0; /*先找到数字5或者6,其次判断相邻的3个字符是否都是数字,取出数字*/ int ... 阅读全文

posted @ 2016-10-23 23:01 寒魔影 阅读(2155) 评论(0) 推荐(0)

2016年10月22日

QT 对话框二

摘要: QMessageBox类 information()函数,主要是提示功能,不需要用户选择 StandardButton QMessageBox::information ( QWidget *parent,//消息框父窗口指针 const QString & title,//消息框标题栏 const QString & text,消息框文字提示信息 Standar... 阅读全文

posted @ 2016-10-22 16:49 寒魔影 阅读(335) 评论(0) 推荐(0)

QT 对话框一

摘要: 标准文件对话框 其函数形式如下:: QString QFileDialog::getOpenFileName ( QWidget * parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QStri... 阅读全文

posted @ 2016-10-22 15:20 寒魔影 阅读(420) 评论(0) 推荐(0)

2016年10月19日

QT 常用控件二

摘要: QT提供QHBoxLayout类、QVBoxlayout类及QGridLayout类等的基本布局管理,分别是水平排列布局,垂直排列布局和网格排列布局 addWidget()方法用于向布局中加入需要布局的控件 addLayout()方法用于向布局中加入需要布局的子布局 Widget::Widget(Q 阅读全文

posted @ 2016-10-19 21:40 寒魔影 阅读(550) 评论(0) 推荐(0)

2016年10月18日

QT 常用控件一

摘要: QWidget 创建窗口 如果widget未使用腹肌进行创建,则在显示时视为窗口或顶层widget。 由于顶层widget没有父级对象类来确保在其不再使用时删除,所以需要开发人员在应用程序中对其进程跟踪。 在本例中,使用QWidget创建和显示具有默认大小的窗口 QWidget *win=new QWidget(); win->resize(320,240); win_>show(... 阅读全文

posted @ 2016-10-18 20:26 寒魔影 阅读(831) 评论(0) 推荐(0)

2016年10月16日

QT QT练习一

摘要: 界面中通过三个 QLineEdit控件,一个QPushButton实现+ - * /四则运算,点击pushbutton后将运算结果显示在QLabel控件上。 #ifndef WIDGET_H #define WIDGET_H #include #include #include #include class Widget : public QWidget { Q_OBJE... 阅读全文

posted @ 2016-10-16 21:06 寒魔影 阅读(712) 评论(0) 推荐(0)

2016年10月15日

QT QDateTime类、QTimer类

摘要: QDateTime类,头文件#include 可以使用QDateTime类来获得系统时间。通过QDateTime::currentDateTime()来获取本地系统的时间和日期信号。可以通过date()和time()来返回 datetime中的日期和时间部分,代码如下: QDateTime *datetime=new QDateTime(QDateTime::currentDateTime()... 阅读全文

posted @ 2016-10-15 17:47 寒魔影 阅读(18661) 评论(0) 推荐(0)

上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 60 下一页

导航