資源簡介
網上找的兩個QML和c++庫相互調用的例子,使用環境是QT5.4
代碼片段和文件信息
#include?“colorMaker.h“
#include?
#include?
#include
ColorMaker::ColorMaker(Qobject?*parent)
????:?Qobject(parent)
?????m_algorithm(RandomRGB)
?????m_currentColor(Qt::black)
?????m_nColorTimer(0)
{
????qsrand(QDateTime::currentDateTime().toTime_t());
}
ColorMaker::~ColorMaker()
{
}
QColor?ColorMaker::color()?const
{
????return?m_currentColor;
}
void?ColorMaker::setColor(const?QColor?&color)
{
????qDebug()?<“call?setColor?-?“?<????m_currentColor?=?color;
????emit?colorChanged(m_currentColor);
}
QColor?ColorMaker::timeColor()?const
{
????QTime?time?=?QTime::currentTime();
????int?r?=?time.hour();
????int?g?=?time.minute()*2;
????int?b?=?time.second()*4;
????return?QColor::fromRgb(r?g?b);
}
ColorMaker
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????601??2014-12-12?14:29??unti
?????文件???????1372??2014-12-16?16:13??unti
?????文件????????723??2014-12-16?16:40??unti
?????文件???????1000??2014-12-16?15:53??unti
?????文件???????1411??2014-12-16?16:40??unti
?????文件?????????92??2014-12-16?15:15??unti
?????文件????????300??2014-12-12?14:36??unti
?????文件??????18474??2014-12-17?09:19??unti
?????文件???????2413??2014-12-17?08:36??unti
?????文件???????1072??2014-12-16?17:28??unti
?????文件????????601??2014-12-09?17:13??unti
?????文件????????692??2014-12-16?17:16??unti
?????文件???????3040??2014-12-17?08:38??unti
?????文件?????????92??2014-12-16?17:07??unti
?????文件???????1972??2014-12-09?17:13??unti
?????文件???????1202??2014-12-09?17:13??unti
?????文件????????444??2014-12-09?17:13??unti
?????文件????????567??2014-12-16?17:05??unti
?????文件??????18474??2014-12-17?09:19??unti
?????文件??????18280??2014-12-11?13:36??unti
?????目錄??????????0??2014-12-09?17:13??unti
?????目錄??????????0??2014-12-17?09:19??unti
?????目錄??????????0??2014-12-17?09:19??unti
-----------?---------??----------?-----??----
????????????????72822????????????????????23
- 上一篇:VC6.0 atlsd.lib文件
- 下一篇:51單片機 紅外傳感程序 C語言
評論
共有 條評論