aclock.h

来自「作为qt 入门的学习的例子」· C头文件 代码 · 共 45 行

H
45
字号
/****************************************************************************** $Id:  qt/aclock.h   3.0.5   edited Oct 12 2001 $**** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.**** This file is part of an example program for Qt.  This example** program may be used, distributed and modified without limitation.*******************************************************************************/#ifndef ACLOCK_H#define ACLOCK_H#include <qwidget.h>#include <qdatetime.h>class AnalogClock : public QWidget              // analog clock widget{    Q_OBJECTpublic:    AnalogClock( QWidget *parent=0, const char *name=0 );    void setAutoMask(bool b);public slots:    void setTime( const QTime & t );protected:    void updateMask();    void paintEvent( QPaintEvent *);    void mousePressEvent( QMouseEvent *);    void mouseMoveEvent( QMouseEvent *);private slots:    void drawClock( QPainter* );    void        timeout();private:    QPoint clickPos;    QTime       time;};#endif // ACLOCK_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?