上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 32 下一页
摘要: 1、QT += printsupport 在演练《Qt4图形设计与嵌入式开发》中ImageView的过程中,出现错误: Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QPrinter::~QPrinter(void)" (__imp_??1QPrinter@@UAE@XZ) referenced in function "private: void __thiscall ezXpns::on_loginButto 阅读全文
posted @ 2013-05-10 11:11 wiessharling 阅读(795) 评论(0) 推荐(0)
摘要: int main() { try { SocketClient s("www.site.com", 80); string data = "par1=value1&par2=value2"; s.SendLine("POST /post_page.php HTTP/1.0\r\n"); s.SendLine("Host: www.site.com\r\n"); s.SendLine("User-Agent: Mozilla/4.0\r\n"); s.SendLine("Cont 阅读全文
posted @ 2013-05-07 10:28 wiessharling 阅读(206) 评论(0) 推荐(0)
摘要: 1、对象创建 当创建一个C++对象时,会发生两件事: 步骤一:为对象分配内存; 步骤二:调用构造函数来初始化那个内存。 步骤一中,可以用几种方式或在可选择的时间发生: 1)在静态存储区域,存储空间在程序开始之前就可以分配。 2)无论何时到达一个特殊的执行点(左大括号)时,存储单元都可以在栈上被创建。出了执行点(右大括号),这个存储单元自动被释放。 3)存储单元也可以从一个称为堆(自由存储单元)的地方分配。这被称为动态内存分配。2、malloc and newObj* obj = (Obj*)malloc(sizeof(Obj)); malloc()返回一个void*类型的指针。... 阅读全文
posted @ 2013-05-06 21:19 wiessharling 阅读(176) 评论(0) 推荐(0)
摘要: class Tree{ int height;public: Tree(int treeHeight):height(treeHeight){} ~Tree(){ cout<<"*"; } friend ostream& operator<<(ostream& os, const Tree* t){ return os<<"Tree height is: "<<t->height<<endl; }}; 阅读全文
posted @ 2013-05-06 20:21 wiessharling 阅读(257) 评论(0) 推荐(0)
摘要: 单一设计模式,顾名思义就是产生一个对象到单一实例,算是设计模式中最简单也是最容易理解的一种模式了。单一设计模式的设计很简,单目前主要有两种方法,要注意的是要把类到构造函数设为私有的,防止对象可以直接new一个实例出来,下面一种是很常见到一种。public class SingletonPattern {private static SingletonPattern single = null; //防止直接产生一个的实例private SingletonPattern() {}public static SingletonPattern getInstance() { if(nul... 阅读全文
posted @ 2013-05-01 16:24 wiessharling 阅读(288) 评论(0) 推荐(0)
摘要: 现在在用Qt做一个智能家居的项目,解决了一个问题,拿出来分享一下:为了描述简单,按钮用DirectButton来表示,窗体用Form来表示。介绍:一个窗体代表一个家电(如压力锅),在窗体上有一些按钮,如开关,煮饭,煮粥之类的,让开关按钮能够控制其他按钮,即只有电器是开的时候其他按钮才能按下。因为DirectButton与DirectButton是独立不相关的,因此,通过窗体这个共同体的变量来控制。问题:DirectButton类和Form 类是两个独立的类,对象之间不能互相访问对象的成员。方法:通过建立一个监听类来解决,这个类如下:IPowerInfoListener.h#ifndef IPO 阅读全文
posted @ 2013-04-26 19:58 wiessharling 阅读(500) 评论(0) 推荐(0)
摘要: 1、C++中的指针 C和C++指针的最重要区别在于C++是一种类型要求更强的语言。C不允许随便地把一个类型的指针赋值给另一个类型,但允许通过void*来实现。bird* b;rock* r;//将b 赋给 rvoid *v;v = b;r = v; 但是在C++中不允许这样做。2、拷贝够着函数 X(X&)这样的形式。在函数调用时,这个构造函数是控制通过传值方式传递和返回用户定义类型的根本所在。事实上,我们将会看到,这是很重要的,以至于编译器在没有提供拷贝构造函数时自动地创建。 阅读全文
posted @ 2013-04-25 22:13 wiessharling 阅读(307) 评论(0) 推荐(0)
摘要: # 一、配置网卡$sudo vi /etc/network/interfaces编辑内容如下:auto loiface lo inet loopback# 将网络参数配置到相应的网卡 ,lo,eth0,eth1等等#netstat -rn 列出网卡状态及路由信息等 ,netstat –i 查看网卡状态,ifconfig 查看网卡是否启动 (up)auto eth0 #自动启动eth0这个网卡iface eth0 inet static address 192.168.3.222 #ubuntu ip 地址 netmask 255.255.255.0 #子网掩码 # network... 阅读全文
posted @ 2013-04-25 15:32 wiessharling 阅读(323) 评论(0) 推荐(0)
摘要: 最近对这个东西很头疼,Linux 下的网速一直很慢,而且每次开机都要重新加载网卡,手动连接网络,已经郁闷很久了,现在来研究一下这个东西!1、Ethernet Interfaces Ethernet interfaces are identified by the system using the naming convention ofethX, whereXrepresents a numeric value. The first Ethernet interface is typically identified aseth0, the second aseth1, and all ot. 阅读全文
posted @ 2013-04-25 15:25 wiessharling 阅读(291) 评论(0) 推荐(0)
摘要: 1.将Tomcat 6.0作为WEB应用程序的服务器时,经常会出现乱码,即编码问题。最常用的解决方法就是在/conf/server.xml中的connector标记中加URIEncoding="utf-8",统一为uft-8编码。2.最好不要把Tomcat 6.0装在系统盘里,因为很多时候在Win7 系统盘上安装完Tomcat 6.0,会出现运行错误。3.刚在Win7 上安装完Tomcat 6.0,运行Tomcat是没有问题的,但重启后就会出现运行错误了。其解决方法:打开/bin目录,然后在tomcat6.exe和tomcat6w.exe文件上点击右键,选择“属性”,最后选 阅读全文
posted @ 2013-04-25 10:26 wiessharling 阅读(246) 评论(0) 推荐(0)
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 32 下一页