⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cwidget.h

📁 QT编写 的 简易 计算器
💻 H
字号:
#ifndef CWIDGET_H
#define CWIDGET_H

#include <qapplication.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qlineedit.h>
#include <qstring.h>
#include <qevent.h>
#include <qmessagebox.h>

class CWidget : public QWidget
{
	Q_OBJECT
public:
	CWidget(QWidget *parent=0, char *name=0);
	~CWidget();
private:
	QLineEdit *edit;
	QPushButton *button[16];
	QVBoxLayout *mainLayout;
	QHBoxLayout *topLayout;
	QGridLayout *bottomLayout;
	int firstNum;
	int secondNum;
	int oper;
protected slots:
	void setValue();
	void setOper();
	void calculate();
	void clear();
protected:
	virtual bool event(QEvent *e);
private:
	void initialize();
	void createForm();
	void onClicked(int key);
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -