qt时间轴滑动条

时间:2022-01-31 08:24:10
【文件属性】:
文件名称:qt时间轴滑动条
文件大小:832KB
文件格式:ZIP
更新时间:2022-01-31 08:24:10
qwt timeline qt 基于qwt-6.1实现的时间轴滑动条,主要是slider参数设置技巧,设定起始结束日期,自动绘制时间轴,qwt请自行下载编译,qt我用的版本是5.7.1,vs2013。主要代码如下: QDateTime starData = QDateTime::fromString(dataS, "yyyy-MM-dd"); QDateTime endData = QDateTime::fromString(dataE, "yyyy-MM-dd"); int dayCount = starData.daysTo(endData); _qwtSlider->setScale( QwtDate::toDouble(starData), QwtDate::toDouble(endData) ); _qwtSlider->setTotalSteps(dayCount); _qwtSlider->setPageSteps(30); double space = QwtDate::toDouble(endData) - QwtDate::toDouble(starData); _qwtSlider->setScaleStepSize(space/12); _qwtSlider->setScaleDraw(_qwtDsd); _qwtSlider->setHandleSize(QSize(20, 10));
【文件预览】:
test12
----test12.qrc(66B)
----Debug()
--------test12.tlog()
--------moc_test12.obj(383KB)
--------vc120.pdb(1.76MB)
--------qrc_test12.obj(5KB)
--------moc_qhhtimelines.obj(176KB)
--------test12.log(3KB)
--------main.obj(385KB)
--------test12.Build.CppClean.log(2KB)
--------qhhtimelines.obj(388KB)
--------test12.obj(474KB)
----Resources()
----test12.vcxproj.filters(3KB)
----test12.cpp(2KB)
----qhhtimelines.ui(544B)
----GeneratedFiles()
--------Debug()
--------ui_test12.h(7KB)
--------ui_qhhtimelines.h(1KB)
--------Release()
--------qrc_test12.cpp(1KB)
----main.cpp(203B)
----qhhtimelines.cpp(5KB)
----test12.ui(6KB)
----test12.vcxproj.user(751B)
----test12.h(317B)
----qhhtimelines.h(1KB)
----test12.vcxproj(14KB)
test12.v12.suo
test12.sln

网友评论