1 #include <QApplication>
7 class Puppas
: public Canvas
12 Puppas(QWidget
*p
= NULL
) : Canvas(p
), ppp(NULL
) {}
14 virtual void keyPressEvent ( QKeyEvent
* event
)
16 if(event
->key() == Qt::Key_Tab
)
17 (*items())[0]->raise();
19 virtual void mousePressEvent ( QMouseEvent
* event
)
21 ppp
= itemAt(event
->pos());
24 delta
= ppp
->pos() - event
->pos();
25 if(event
->button() == Qt::LeftButton
)
29 virtual void mouseMoveEvent ( QMouseEvent
* event
)
32 ppp
->moveTo(event
->pos() + delta
);
41 p
.setBrush(Qt::darkGreen
);
42 p
.drawEllipse(0,0,200,100);
47 /*QPixmap tp(QPixmap px)
49 QPixmap retv(px.size);
55 int main(int argc
, char *argv
[])
57 QApplication
app(argc
, argv
);
59 Canvas
*c
= new Puppas();
62 CanvasGroup
*cg
= new CanvasGroup( c
);
66 CanvasPixmap
*p
= new CanvasPixmap( QPixmap(
67 "/home/monge/chess_pieces/out/img_fantasy/kboard_theme/white_rook.png"), cg
);
71 CanvasPixmap
*p2
= new CanvasPixmap( QPixmap(
72 "/home/monge/chess_pieces/out/img_skulls/kboard_theme/black_bishop.png"), cg
);
76 CanvasPixmap
*p3
= new CanvasPixmap( QPixmap(
77 "/home/monge/chess_pieces/out/img_freak/kboard_theme/white_knight.png"), c
);
81 CanvasPixmap
*p4
= new CanvasPixmap( QPixmap(
82 "/home/monge/chess_pieces/out/img_spatial/kboard_theme/black_king.png"), c
);
86 CanvasPixmap
*p5
= new CanvasPixmap( QPixmap(
87 "/home/monge/chess_pieces/out/img_prmi/kboard_theme/white_queen.png"), c
);
91 CanvasTiledPixmap
*p6
= new CanvasTiledPixmap( QPixmap(
92 "/home/monge/chess_pieces/out/icons/20/r.png"),
93 QSize(200,150), QPoint(0,0), false, c
);
97 CanvasRectangle
*p7
= new CanvasRectangle( QColor(255,0,0,192), QSize(200,150), c
);
101 CanvasRectangle *p8a = new CanvasRectangle( QColor(128,128,0,255), QSize(1,200), c );
105 CanvasRectangle *p8b = new CanvasRectangle( QColor(0,128,0,255), QSize(300,1), c );
109 CanvasText
*p8
= new CanvasText( "Fuck", QColor(0,0,255,192),
110 QFont("Sans", 70, QFont::Bold
),
111 CanvasText::HCenter
, CanvasText::VCenter
, c
);
115 CanvasPicture
*p9
= new CanvasPicture( make_pic(), c
);