本站電子書

您可以在這些電子書店找到本站電子書: Google Play 圖書iBooks StoreHyReadReadmooPubu
===>>>本站推出學習遊戲意見調查<<<===《如何自學程式設計》入選 Google Play 台灣地區2016年度最佳書籍

C++ 入門指南 V2.00 - 單元 28 範例及練習程式碼



encryptwindow.h


#ifndef ENCRYPTWINDOW_H
#define ENCRYPTWINDOW_H

#include <QMainWindow>

#include "encrypt.h"

namespace Ui {
class EncryptWindow;
}

class EncryptWindow : public QMainWindow
{
   Q_OBJECT

public:
   explicit EncryptWindow(QWidget *parent = 0);
   ~EncryptWindow();

private slots:
   void on_pushButton_new_clicked();
   void on_pushButton_save_clicked();
   void on_pushButton_load_clicked();
   void on_pushButton_encode_clicked();
   void on_pushButton_decode_clicked();
   void on_pushButton_clear_clicked();
   void on_pushButton_copy_clicked();

private:
   Ui::EncryptWindow *ui;
};

#endif // ENCRYPTWINDOW_H

encryptwindow.cpp


#include "encryptwindow.h"
#include "ui_encryptwindow.h"

// 建構函數
EncryptWindow::EncryptWindow(QWidget *parent) :
   QMainWindow(parent),
   ui(new Ui::EncryptWindow)
{
   ui->setupUi(this);
}

// 解構函數
EncryptWindow::~EncryptWindow()
{
   delete ui;
}

// 按下 New 按鈕的事件
void EncryptWindow::on_pushButton_new_clicked()
{
   ui->label_display->setText("This is New button.");
}

// 按下 Save 按鈕的事件
void EncryptWindow::on_pushButton_save_clicked()
{
   ui->label_display->setText("This is Save button.");
}

// 按下 Load 按鈕的事件
void EncryptWindow::on_pushButton_load_clicked()
{
   ui->label_display->setText("This is Load button.");
}

// 按下 Encode 按鈕的事件
void EncryptWindow::on_pushButton_encode_clicked()
{
   ui->label_display->setText("This is Encode button.");
}

// 按下 Decode 按鈕的事件
void EncryptWindow::on_pushButton_decode_clicked()
{
   ui->label_display->setText("This is Decode button.");
}

// 按下 Clear 按鈕的事件
void EncryptWindow::on_pushButton_clear_clicked()
{
   ui->label_display->setText("This is Clear button.");
}

// 按下 Copy 按鈕的事件
void EncryptWindow::on_pushButton_copy_clicked()
{
   ui->label_display->setText("This is Copy button.");
}

gamewindow.h


#ifndef GAMEWINDOW_H
#define GAMEWINDOW_H

#include <QMainWindow>

#include "guessgame.h"

namespace Ui {
class GameWindow;
}

class GameWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit GameWindow(QWidget *parent = 0);
    ~GameWindow();

private slots:
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();

private:
    Ui::GameWindow *ui;
};

#endif // GAMEWINDOW_H

gamewindow.cpp


#include "gamewindow.h"
#include "ui_gamewindow.h"

GameWindow::GameWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::GameWindow)
{
    ui->setupUi(this);
}

GameWindow::~GameWindow()
{
    delete ui;
}

void GameWindow::on_pushButton_clicked()
{
    ui->textBrowser->append("This is New Game Button.");
}

void GameWindow::on_pushButton_2_clicked()
{
    ui->textBrowser->append("These is Guess Button.");
}

the end

沒有留言: