C++ 入門指南 - GUIDemo.h




GUIDemo.h 的程式原始碼如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef GUIDEMO_H
#define GUIDEMO_H
 
#include <QWidget>
#include "Encrypt.h"
 
class QLabel;
class QLineEdit;
class QPushButton;
 
class GUIDemo : public QWidget {
    Q_OBJECT
 
public:
    GUIDemo(QWidget *parent = 0);
    QString s2q(const string &); 
    string q2s(const QString &);
 
public slots:
    void newEncrypt();
    void loadEncrypt();
    void saveEncrypt();
    void encodeContact();
    void decodeContact();
    void clearContact();
    void copyContact();
    void inputContact();
 
private:
    QLabel *display;
    QLineEdit *inputField;
    QLineEdit *outputField;
    QPushButton *newButton;
    QPushButton *loadButton;
    QPushButton *saveButton;
    QPushButton *encodeButton;
    QPushButton *decodeButton;
    QPushButton *clearButton;
    QPushButton *copyButton;
     
    QString inputText;
    QString outputText;   
    Encrypt *e;
};
 
#endif
 
/* 《程式語言教學誌》的範例程式
    檔名:GUIDemo.h
    功能:示範 C++ 程式
    作者:張凱慶
    時間:西元 2012 年 10 月 */


您可以繼續參考
範例程式碼


相關目錄
回 C++ 入門指南
回 C++ 教材目錄
回首頁


參考資料
C++ reference
Qt Developer Network

沒有留言: