原创 設計模式之——橋接模式

handsetsoft.h #ifndef HANDSETSOFT_H #define HANDSETSOFT_H #include <QtDebug> class HandsetSoft { public: Hands

原创 設計模式之——迭代器模式

iterator.h #ifndef ITERATOR_H #define ITERATOR_H #include <QString> class Iterator { public: Iterator() {}

原创 設計模式之——單例模式

懶漢模式 singleton.h //懶漢模式 class Singleton { protected: Singleton() { } private: static Singleton* p;

原创 設計模式之——備忘錄模式

originator.h #ifndef ORIGINATOR_H #define ORIGINATOR_H #include <QString> #include <QtDebug> #include "memento.h"

原创 設計模式之——組合模式

component.h #ifndef COMPONENT_H #define COMPONENT_H class Component { public: Component(QString name):m_name(n

原创 qt HTTP Basic Authentication認證

HTTP Basic Authentication認證方式: 在http頭中添加,Authorization屬性。 http head 格式: POST http://117.48.xxxxxxxxxxxxxxxxxxxxxxxx

原创 qt 連接SQL Server服務器

qt連接sql server 需要配置ODBC數據源 一、數據源配置 控制面板 → 管理工具 → ODBC 數據源 數據源名稱自起(等會兒代碼中會用到)。 服務器輸入要連接服務器名稱。 錄入登錄名,密碼 選擇要操作的數據庫

原创 SQL Server服務器安裝

官網下載地址:http://www.microsoft.com/zh-cn/download/details.aspx?id=23650 安裝完成。 開始目錄 —— 打開SQL Server Management Stu

原创 設計模式之——建造者模式

builder.h #ifndef BUILDER_H #define BUILDER_H #include "computer.h" class Builder { public: Builder() {} v

原创 設計模式之——代理模式

IGiveGift.h #ifndef IGIVEGIFT_H #define IGIVEGIFT_H class IGiveGift { public: IGiveGift() {} virtual void

原创 設計模式之——原型模式

prototype.h #ifndef PROTOTYPE_H #define PROTOTYPE_H #include <QtDebug> class Prototype { public: Prototype(){}

原创 設計模式之——觀察者模式

boss.h #ifndef BOSS_H #define BOSS_H #include <QList> #include "observer.h" #include "subject.h" class Boss : pub

原创 設計模式之——外觀模式

Facade.h #ifndef FACADE_H #define FACADE_H #include "subsystemone.h" #include "subsystemtwo.h" class Facade { pub

原创 設計模式之——工廠方法模式

product.h #ifndef PRODUCT_H #define PRODUCT_H #include <QtDebug> class Product { public: Product(){} virt

原创 設計模式之——模板方法模式

company.h #ifndef COMPANY_H #define COMPANY_H #include <QtDebug> class Company { public: Company() {} void