ºÇºÇ£¡Ò»¸öQTͨ¹ýÌùͼʵÏÖµÄÄ£ÄâʱÖÓ cÎļþ
#include "draw.h"
#include "ui_draw.h"
#include <QPixmap>
draw::draw(QWidget *parent)
: QDialog(parent), ui(new Ui::draw)
{
ui->setupUi(this);
// this->setWindowFlags( Qt::FramelessWindowHint);
ctrlPoint.setX(this->width() / 2);
ctrlPoint.setY(this->height() / 2);
m_pixmap = QPixmap("Skin/Night Blue/main.png");
m_mainScale = this->width() /((qreal)(m_pixmap.width())) ;
m_pixmap = QPixmap("Skin/Night Blue/hour.png");
m_hourScale = (this->width()/(qreal)2.0 ) / (m_pixmap.width()) ;
m_pixmap = QPixmap("Skin/Night Blue/min.png");
m_minScale = (this->width()/(qreal)1.8 ) / (m_pixmap.width()) ;
m_pixmap = QPixmap("Skin/Night Blue/sec.png");
m_secScale = (this->width()/(qreal)1.5 ) / (m_pixmap.width()) ;
// qDebug("m_mainScale = %f , m_hourScale = %f , m_minScale = %f ,m_secScale = %f",m_mainScale,m_hourScale,m_minScale,m_secScale);
m_secRotation = QTime::currentTime ().second() *6 - 90;
m_minRotation = QTime::currentTime ().minute() *6 - 90;
m_hourRotation = m_minRotation / 10 + QTime::currentTime ().hour() * 30 - 90;
upTimer = new QTimer(this);
connect(upTimer,SIGNAL(timeout()),this,SLOT(updataTime()));
upTimer->start(500);
}
draw::~draw()
{
delete ui;
}
void draw::paintEvent(QPaintEvent *event)
{
//face
QPainter painter(this);
m_pixmap = QPixmap("Skin/Night Blue/main.png");
painter.scale(m_mainScale,m_mainScale);
painter.drawPixmap(QPointF(0, 0), m_pixmap);
//hour
QPainter p
Ïà¹ØÎĵµ£º
The meaning of each is:
MemberMeaningRange
tm_sec
seconds after the minute
0-61*
tm_min
minutes after the hour
0-59
tm_hour
hours since midnight
0-23
tm_mday
day of the month
1-31
tm_mon
months since January
0-11
tm_year
years since 1900
tm_wday
days since Sunday
0-6
tm_yday
d ......
ÏÖÔÚѧ±à³ÌÁË£¬×îÏÈѧµÄÊÇCÓïÑÔ£¬£¬Ï£Íû¾¹ýŬÁ¦£¬×Ô¼ºÒ²ÄÜÏñÆäËûµÄÈËÒ»Ñù£¬³ÉΪһ¸öÓÅÐãµÄC³ÌÐòÔ±£¬£¬¾ÍÔÚCSDN£¬¼Ç¼ÏÂÎÒµÄC³ÌÐòÔ±³É³¤¹ý³Ì¡£
Ìý±ðÈË˵£¬Ñ§ÓïÑÔ×îºÃµÄ;¾¶¾ÍÊǶàд´úÂ룬ϣÍûÎÒÔÚÕâÒ»·½ÃæÄÜ×öµÄ±È½ÏºÃ£¬»¹ÓоÍÊÇÅàÑøÁ¼ºÃµÄ±à³Ì·ç¸ñºÍÍŶӾ«Éñ¡£ÔÚCSDN£¬ÓкܶàµÄÁ¼Ê¦ÒæÓÑ£¬ÓÐËûÃÇ£¬ÏàÐÅÎÒÒ»¶ ......
ÃæÊÔʱ±»Îʵ½¹ý£¬²»ÉõÃ÷ÁË£¬ÍøÉϰٶÈһϣ¬ÕûºÏÁËÁ½¸öÈÊÐÖµÄÎÄÕ£¬ÈçÏ¡£:-)
ʱ³£ÔÚcppµÄ´úÂëÖ®Öп´µ½ÕâÑùµÄ´úÂë:
#ifdef __cplusplus //c++±àÒë»·¾³ÖвŻᶨÒå__cplusplus (plus¾ÍÊÇ"+"µÄÒâ˼)
extern "C" { //¸æËß±àÒëÆ÷ÏÂÃæµÄº¯ÊýÊÇcÓïÑÔº¯Êý£¨ÒòΪc++ºÍcÓïÑÔ¶Ôº¯ÊýµÄ±àÒëת»»²»Ò»Ñù£¬Ö÷ÒªÊÇc++ÖдæÔÚÖØÔØ£©
#en ......
/* =========================================================================== */
/* Project: s3c44b0_lib & ......
// backlightDlg.cpp : implementation file
//
#include "stdafx.h"
#include "backlight.h"
#include "backlightDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CbacklightDlg dialog
CbacklightDlg::CbacklightDlg(CWnd* pParent /*=NULL*/)
: CDialog(CbacklightDlg::IDD, pParent)
{
......