1
新建一个项目
在pro文件中只需要加上CONFIG
+= C++11
main.cpp
#include
int
main()
{
QMapint,QString>
map;
map.insert(1,"1");
...
分类:
其他好文 时间:
2014-12-18 01:43:12
阅读次数:
267
??
新建项目13IO
13IO.pro
HEADERS
+=
MyWidget.h
SOURCES
+=
MyWidget.cpp
QT
+=
gui widgets
network
CONFIG
+=
C++...
分类:
其他好文 时间:
2014-12-15 09:00:43
阅读次数:
435
fromPyQt4importQtGuifromPyQt4importQtCorefromPyQt4.QtCoreimport(QDate,QFile,QFileInfo,QIODevice,QString,QStringList,QDir,QTextStream,Qt,SIGNAL)if__nam...
分类:
其他好文 时间:
2014-12-15 00:00:28
阅读次数:
413
progressbar.h#ifndef PROGRESSBAR_H#define PROGRESSBAR_H#include class QString;class ProgressBar: public QProgressBar{ Q_OBJECTpublic: ProgressBa...
分类:
其他好文 时间:
2014-12-12 16:17:29
阅读次数:
154
tesb::tesb(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
}
void tesb::DrawCustomLine(QPainter& _painter, double _angle, double _len, const QString& _name, const QColor& _color)
{
// 初始化
...
分类:
其他好文 时间:
2014-12-09 12:20:28
阅读次数:
226
继续开始我们重构手法的系列,今天介绍的是Split Temporary Variable---分解临时变量。在我们平常写的程序中肯定有某些临时变量被赋予了超过一个的责任。如果他们不是那种收集结果(temp = temp + QString("abc"))或者循环变量(i = i + 1),然而他们却...
分类:
其他好文 时间:
2014-12-09 12:11:01
阅读次数:
179
1 void getPoint(QwtPlot *plot)2 {3 QPoint point = plot->canvas()->mapFromGlobal(QCursor::pos()); 4 QString info.sprintf("x = %g, y = %g"...
分类:
其他好文 时间:
2014-12-06 21:29:51
阅读次数:
1173
Qt开始默认是utf-8,而VS2013默认程序编码为gb2312;这样就会发现使用中文的时候乱码。一般有二种解决方案:1、在使用中文的时候,使用QTextCodecQTextCodec *gbk=QTextCodec::codecForName("gb2312");QString str=gbk-...
分类:
数据库 时间:
2014-12-05 12:11:48
阅读次数:
168
Qt获取本机IP地址:Qt版本:4.8.6#include QString ipAddr; QList list = QNetworkInterface::allAddresses(); foreach (QHostAddress address, list) { ...
分类:
其他好文 时间:
2014-12-03 21:03:05
阅读次数:
214
1.使用html生成表格QString wesiOperateWidget::MakeDataToHtml(){ //表头 //html = ""; //html += ""; //html += "编号"; //html += "姓名"; //html += "...
分类:
其他好文 时间:
2014-11-19 12:05:47
阅读次数:
985