shape1.cpp.svn-base
来自「QT方面的开发」· SVN-BASE 代码 · 共 27 行
SVN-BASE
27 行
#include "shapes.h"#include <QString>#include <QDebug>void showNameAndArea(Shape* pshp) { qDebug() << pshp->getName() << " " << pshp->getDimensions() << " area= " << pshp->area();}int main() { Shape shp; /* ERROR - instantiation is not allowed on classes with pure virtual functions */ Rectangle rectangle(4.1, 5.2); Square square(5.1); Circle circle(6.1); qDebug() << "This program uses hierarchies for Shapes"; showNameAndArea(&rectangle); showNameAndArea(&circle); showNameAndArea(&square); return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?