📄 vtable.cpp
字号:
#include <QString>#include <qstd.h>using namespace qstd;#include "vtable.h"Base::Base() { m_X = 4; m_Y = 12; cout << " Base::Base: " ; virtualFun();}Derived::Derived() { m_X = 5; m_Y = 13; m_Z = 22;}void Base::virtualFun() const { QString val=QString("[%1,%2]").arg(m_X).arg(m_Y); cout << " VF: the opposite of Acid: " << val << endl;}void Derived::virtualFun() const { QString val=QString("[%1,%2,%3)") .arg(m_X).arg(m_Y).arg(m_Z); cout << " VF: add some treble: " << val << endl;}Base::~Base() { cout << " ~Base() " << endl; virtualFun();}Derived::~Derived() { cout << " ~Derived() " << endl;}int main() { Base b; Derived d;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -