摘要: a 把消息接受的函数放入独立线程。(待代码验证) /// start recv work thread recv_flag_ = true; recv_thread_ = new std::thread(&CPlatformProxyXMLImpl::recv_work_thread, this); 阅读全文
posted @ 2020-05-23 17:31 郭朋振 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 业务逻辑和代码逻辑之间,业务逻辑越清晰,代码逻辑也可以越清晰,这是相辅相成的一个过程。看代码:不会的语法,代码逻辑(多段相互关联的代码和业务功能有关系,如果不了解业务功能,可能看不懂,这也是为什么叫我熟悉软件的原因,玩儿一下软件就更加了解功能逻辑,从而看代码的时候,可以更具体的知道其中的逻辑)。 阅读全文
posted @ 2020-05-23 17:29 郭朋振 阅读(1229) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-05-23 17:14 郭朋振 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 工厂模式接口使用方法: /// 初始化管理台接口 auto factory = new zl::CPlatformProxyFactory; 接口类; plat_api_ = factory->get(); 转换成实现的product; zl::IPlatformProxyInterface::Pl 阅读全文
posted @ 2020-05-23 16:55 郭朋振 阅读(45) 评论(0) 推荐(0) 编辑
摘要: QUrl::fromLocalFile()的路径设置不对,应该使用绝对路径: QUrl::fromLocalFile("C:/Users/guopengzhen_zhilai/Documents/test_lineedit/music/Choose payment method.mp3") 如果要使 阅读全文
posted @ 2020-05-23 16:52 郭朋振 阅读(1963) 评论(0) 推荐(0) 编辑
摘要: bool QRegExp::exactMatch(const QString &str) const Returns true if str is matched exactly by this regular expression; otherwise returns false. You can 阅读全文
posted @ 2020-05-23 16:46 郭朋振 阅读(1103) 评论(0) 推荐(0) 编辑
摘要: string str1; stringList strList; foreach(str1,strList){…} foreach会便利strList,并把strList的值赋给str1; foreach (const QFileInfo& fi, dir.entryInfoList(QDir::F 阅读全文
posted @ 2020-05-23 16:45 郭朋振 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 静态成员变量不能在声明的时候初始化(其他的成员变量是可以的), 在类体外面初始化: MyMusicPlayer* MyMusicPlayer::Instance_ = nullptr; 静态成员在类里面是声明,是放在静态存储区的,所以不能直接定义和赋值,而只有在程序运行之后,才能在类外面通过定义分配 阅读全文
posted @ 2020-05-23 16:40 郭朋振 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 单例模式的使用场景:当只需要一个实例,但是需要在多个不同的地方调用的时候,都可以通过这个实例函数来调用。 使用方式:private:或者protect:构造函数。 A 设备管理器,多个设备,但是只有一个设备管理器。 B 数据池。 class QUdpSocket; namespace zl { // 阅读全文
posted @ 2020-05-23 16:39 郭朋振 阅读(55) 评论(0) 推荐(0) 编辑
摘要: int32_t是32bit,4byte的有符号的int,uint32_t是无符号。 int8_t 是8bit,以此类推。 阅读全文
posted @ 2020-05-23 16:34 郭朋振 阅读(506) 评论(0) 推荐(0) 编辑
摘要: The QHostAddress class provides an IP address. This class holds an IPv4 or IPv6 address in a platform- and protocol-independent manner. QHostAddress i 阅读全文
posted @ 2020-05-23 16:33 郭朋振 阅读(709) 评论(0) 推荐(0) 编辑
摘要: CCabinetManager::CCabinetManager(QObject* parent) : connector_(new QUdpSocket(this)), timer_polling_(-1), timer_searching_(-1), udp_send_worker_flag_( 阅读全文
posted @ 2020-05-23 16:25 郭朋振 阅读(53) 评论(0) 推荐(0) 编辑
摘要: Schedules this object for deletion. The object will be deleted when control returns to the event loop. If the event loop is not running when this func 阅读全文
posted @ 2020-05-23 16:22 郭朋振 阅读(358) 评论(0) 推荐(0) 编辑
摘要: socket套接字,是一组接口。在传输层的tcp和udp的上一层,直接和用户数据打交道的接口。典型的使用方式是“bind -> read/write->close” ,linux系统认为万物皆是socket,万物皆是可以读写的文件。 阅读全文
posted @ 2020-05-23 16:20 郭朋振 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 用集线器(广播作用)链接起来的小型的网络叫局域网,跨了很大的物理距离时,需要使用路由器,这时的网络叫广域网,比如跨国公司这种,保证了不同区域之间通信的带宽,所以一般用光纤等,费用比较高。而通常所说的互联网,是一种公共的广域网,不保证带宽,所以费用较低。 阅读全文
posted @ 2020-05-23 16:17 郭朋振 阅读(145) 评论(0) 推荐(0) 编辑
摘要: The QUdpSocket class provides a UDP socket. UDP (User Datagram Protocol) is a lightweight, unreliable, datagram-oriented, connectionless protocol. It 阅读全文
posted @ 2020-05-23 16:16 郭朋振 阅读(217) 评论(0) 推荐(0) 编辑
摘要: Introduction This User Datagram Protocol (UDP) is defined to make available a datagram mode of packet-switched computer communication in the environme 阅读全文
posted @ 2020-05-23 16:15 郭朋振 阅读(147) 评论(0) 推荐(0) 编辑
摘要: The Qt Concurrent module extends the basic threading support found in Qt Core module and simplifies the development of code that can be executed in pa 阅读全文
posted @ 2020-05-23 16:14 郭朋振 阅读(399) 评论(0) 推荐(0) 编辑
摘要: 需要的头文件:#include <windows.h> 宏定义:#pragma comment(lib, "user32.lib") //调用windows的API函数,弹出小键盘的功能 该指令用来将user32.lib库文件加入到本工程中。 void CBackendWnd::on_btnl_ke 阅读全文
posted @ 2020-05-23 16:13 郭朋振 阅读(216) 评论(0) 推荐(0) 编辑
摘要: C++ 不允许变量重名,但是允许多个函数取相同的名字,只要参数表不同即可,这叫作函数的重载(其英文是 overload)。 重载就是装载多种东西的意思,即同一个事物能完成不同功能。 c++ 11 提供override关键字,当重载时使用可以用于判断语句是否错误; protected: bool ev 阅读全文
posted @ 2020-05-23 16:11 郭朋振 阅读(53) 评论(0) 推荐(0) 编辑