Qt 5.10 Book Examples
Calculator.h
Go to the documentation of this file.
1 // ======================================================================
2 // Calculator.h
3 // ======================================================================
4 // This file is a part of the book
5 // "Qt 5.10 Professional programming with C++"
6 // http://qt-book.com
7 // ======================================================================
8 // Copyright (c) 2017 by Max Schlee
9 // ======================================================================
10 
11 #pragma once
12 
13 #include <QWidget>
14 #include <QStack>
15 
16 class QLCDNumber;
17 class QPushButton;
18 
19 // ======================================================================
20 class Calculator : public QWidget {
21  Q_OBJECT
22 private:
23  QLCDNumber* m_plcd;
24  QStack<QString> m_stk;
25  QString m_strDisplay;
26 
27 public:
28  Calculator(QWidget* pwgt = 0);
29 
30  QPushButton* createButton(const QString& str);
31  void calculate ( );
32 
33 public slots:
34  void slotButtonClicked();
35 };
36 
QPushButton * createButton(const QString &str)
Definition: Calculator.cpp:41
void slotButtonClicked()
Definition: Calculator.cpp:74
void calculate()
Definition: Calculator.cpp:51
Calculator(QWidget *pwgt=0)
Definition: Calculator.cpp:15