?? paint.cpp
字號:
/****************************************************************************** Form implementation generated from reading ui file 'paint_ui.ui'**** Created: Sun Jan 13 13:31:15 2008** by: The User Interface Compiler (uic)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "paint_ui.h"#include "paint.h"#include <qpainter.h>#include <qlabel.h>#include <qpushbutton.h>#include <qlayout.h>#include <qvariant.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qtextcodec.h>/* * Constructs a paint_ui which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */paint::paint( QWidget* parent, const char* name, WFlags fl ){ QFont unifont=QFont("XINGKAI",50,500);// setFont(unifont); unifont.setPixelSize(40); QTextCodec* codec=QTextCodec::codecForName("GBK"); pBtn_paint->setFont(unifont); pBtn_paint->setText(codec->toUnicode("畫圖")); connect(pBtn_paint,SIGNAL(clicked()),this,SLOT(paintEvent()));}/* * Destroys the object and frees any allocated resources */paint::~paint(){ // no need to delete child widgets, Qt does it all for us}void paint::paintEvent(){ QPainter paint(Label_paint); paint.setPen(QPen(black,2,SolidLine,RoundCap,RoundJoin)); paint.translate(10.0,20.0); QPointArray points(10); points[0]=QPoint(20,40); points[1]=QPoint(25,45); points[2]=QPoint(35,50); points[3]=QPoint(40,50); points[4]=QPoint(50,60); points[5]=QPoint(60,65); points[6]=QPoint(70,78); points[7]=QPoint(80,56); points[8]=QPoint(90,52); points[9]=QPoint(100,68); paint.drawPolyline(points);}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -