摘要: 1 #include 2 int main(int argc, char *argv[]) 3 { 4 QApplication a(argc, argv); 5 QGraphicsScene scene(0, 0, 480, 320);//场景 所有的图形item都被必须附着在这个场景(scene)上面 6 QGraphicsView view(&scen... 阅读全文
posted @ 2017-03-10 16:02 Dayu0501 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 //自定义item需要重写的两个函数boudingRect()和paint() 3 class CheckBoxItem : public QGraphicsObject 4 { 5 Q_OBJECT 6 public: 7 CheckBoxItem(int w, int h, const QString &text, const QSt... 阅读全文
posted @ 2017-03-10 15:59 Dayu0501 阅读(3309) 评论(0) 推荐(0) 编辑