Qt第三方库QCustomPlot——QCustomPlot解读
这个小部件类,对于QCustomPlot的所有方面都有所体现
下面阅读它的函数:
函数组织顺序为: 基本设置---添加图线---删除图线---添加额外Item---层次管理---坐标轴管理----导出图表
QCustomPlot (QWidget *parent=0)
void setViewport (const QRect &rect)//视口设置,通常就是本部件所在的长宽
void setBackground (const QPixmap &pm)//在整个视口的最底层绘制图片,用作背景
void setBackground (const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding)
void setBackground (const QBrush &brush)
void setBackgroundScaled (bool scaled)//设置setBackground 所绘的图是否进行缩放以适应Viewport
void setBackgroundScaledMode (Qt::AspectRatioMode mode)//有Qt::IgnoreAspectRatio(忽略比例,缩放至适应视口),Qt::KeepAspectRatio(保持长宽比,直到一边最大至视口边缘)Qt::KeepAspectRatioByExpanding(保持长宽比,缩放至充满视口)
void setAntialiasedElements (const QCP::AntialiasedElements &antialiasedElements)//抗锯齿效果,对于各对象,都有默认设置,可通过本函数,改变默认不抗锯齿的元素,使它也抗。
void setAntialiasedElement (QCP::AntialiasedElement antialiasedElement, bool enabled=true)//更方便的开关
void setNotAntialiasedElements (const QCP::AntialiasedElements ¬AntialiasedElements)//设置不抗
void setNotAntialiasedElement (QCP::AntialiasedElement notAntialiasedElement, bool enabled=true)
void setAutoAddPlottableToLegend (bool on)//是否自动添加图形到图例,默认是
void setInteraction (const QCP::Interaction &interaction, bool enabled=true)//设置交互方式,如是否可拖动或缩放轴,是否可选中轴或图例等。
void setInteractions (const QCP::Interactions &interactions)
void setSelectionTolerance (int pixels)//选择公差设置,在多少像素中能选中某个元素
void setNoAntialiasingOnDrag (bool enabled)//拖动时是否也抗锯齿
void setPlottingHint (QCP::PlottingHint hint, bool enabled=true)//设置其它参数,如快速绘制线(损失质量),缓存轴的lable(提高效率)
void setPlottingHints (const QCP::PlottingHints &hints)
void setMultiSelectModifier (Qt::KeyboardModifier modifier)//要多选时的按键,默认Qt::ControlModifier,即ctrl
QRect viewport () const//与上述大致对应
QPixmap background () const
bool backgroundScaled () const
Qt::AspectRatioMode backgroundScaledMode () const
QCPLayoutGrid * plotLayout () const
QCP::AntialiasedElements antialiasedElements () const
QCP::AntialiasedElements notAntialiasedElements () const
bool autoAddPlottableToLegend () const
const QCP::Interactions interactions () const
int selectionTolerance () const
bool noAntialiasingOnDrag () const
QCP::PlottingHints plottingHints () const
Qt::KeyboardModifier multiSelectModifier () const
QCPAbstractPlottable * plottable (int index)//所有添加的图线都自动加了索引,按先后顺序
QCPAbstractPlottable * plottable ()
bool addPlottable (QCPAbstractPlottable *plottable)//添加除graph线外的其它种类型的曲线或图
bool removePlottable (QCPAbstractPlottable *plottable)
bool removePlottable (int index)
int clearPlottables ()
int plottableCount () const
QList< QCPAbstractPlottable * > selectedPlottables () const//返回选中的线
QCPAbstractPlottable * plottableAt (const QPointF &pos, bool onlySelectable=false) const//返回某个点是否有图线
bool hasPlottable (QCPAbstractPlottable *plottable) const
QCPGraph * addGraph (QCPAxis *keyAxis=0, QCPAxis *valueAxis=0)//为Graph线留的特殊接口,因Graph是最常用的
bool removeGraph (QCPGraph *graph)
bool removeGraph (int index)
QCPGraph * graph (int index) const
QCPGraph * graph () const
int clearGraphs ()
int graphCount () const
QList< QCPGraph * > selectedGraphs () const
bool addItem (QCPAbstractItem *item)//添加一些附加item,如箭头等
bool removeItem (QCPAbstractItem *item)
bool removeItem (int index)
int clearItems ()
int itemCount () const
QCPAbstractItem * item (int index) const
QCPAbstractItem * item () const
QList< QCPAbstractItem * > selectedItems () const
QCPAbstractItem * itemAt (const QPointF &pos, bool onlySelectable=false) const
bool hasItem (QCPAbstractItem *item) const
QCPLayoutElement * layoutElementAt (const QPointF &pos) const
QCPLayer * layer (const QString &name) const//QCustomPlot分层的实现与管理
QCPLayer * layer (int index) const
QCPLayer * currentLayer () const
bool setCurrentLayer (const QString &name)
bool setCurrentLayer (QCPLayer *layer)
int layerCount () const
bool addLayer (const QString &name, QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove)
bool removeLayer (QCPLayer *layer)
bool moveLayer (QCPLayer *layer, QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove)
QCPAxisRect * axisRect (int index=0) const
QList< QCPAxisRect * > axisRects () const
QList< QCPAxis * > selectedAxes () const
QList< QCPLegend * > selectedLegends () const
int axisRectCount () const
bool savePdf (const QString &fileName, bool noCosmeticPen=false, int width=0, int height=0, const QString &pdfCreator="", const QString &pdfTitle="")//将图表导出成各种格式
bool savePng (const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1)
bool saveJpg (const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1)
bool saveBmp (const QString &fileName, int width=0, int height=0, double scale=1.0)
bool saveRastered (const QString &fileName, int width, int height, double scale, const char *format, int quality=-1)
QPixmap toPixmap (int width=0, int height=0, double scale=1.0)
void toPainter (QCPPainter *painter, int width=0, int height=0)
//三个槽
Q_SLOT void replot (QCustomPlot::RefreshPriority refreshPriority=QCustomPlot::rpHint)//重新生成图表
Q_SLOT void rescaleAxes (bool onlyVisiblePlottables=false)
Q_SLOT void deselectAll ()//取消选择
Qt第三方库QCustomPlot——QCustomPlot解读的更多相关文章
- Qt第三方库----QCustomPlot
一.软件下载 下载地址:http://www.qcustomplot.com/index.php/download 这里推荐下载第一个链接的内容: 注:这里的第三方库要放在非中文目录下. 二.配置 ( ...
- Qt第三方库libvlc-qt——ubuntu上编译、安装,测试
cmake 3.0编译安装(最低版本要求): sudo apt-get install ncurses-dev sudo apt-get install build-essential 下载cma ...
- 基于QT开发的第三方库
基于Qt开发的第三方库 分类: Qt2014-02-12 11:34 1738人阅读 评论(0) 收藏 举报 QT第三方库 目录(?)[+] 文章来源:http://blog.csdn.net ...
- 基于Qt的第三方库和控件
====================== 基于Qt的第三方库和控件 ====================== libQxt -------- http://dev.libqxt.o ...
- Qt编程可不可以结合其他的第三方库和本土API?(有zeroMQ的Qt封装,还可轻易使用Python的库)
作者:渡世白玉链接:http://www.zhihu.com/question/29030777/answer/59378712来源:知乎著作权归作者所有,转载请联系作者获得授权. 可以,十分可以,你 ...
- Qt使用第三方库
简述 在 Qt 中经常会用到第三方库,例如:FFmpeg.OpenCV 等.第三方库的使用比较简单,只需要一些基本的配置就可以搞定,一起来看看吧! 简述 第三方库 源代码 库文件 目标目录 第三方库 ...
- Qt使用第三方库3rdparty
简述 在 Qt 中经常会用到第三方库,例如:FFmpeg.OpenCV 等.第三方库的使用比较简单,只需要一些基本的配置就可以搞定,一起来看看吧! 简述 第三方库 源代码 库文件 目标目录 第三方库 ...
- Qt笔记——连接第三方库&用libZPlay库获取音频文件的艺术家、专辑等信息
连接第三方库libZPlay 概述 需要.a/.lib ,.h , .dll 三个文件 官网下载 http://libzplay.sourceforge.net/ import .h 链接 .a 放入 ...
- qt .pro文件和cmakelists.txt配置第三方库
.pro文件引用第三方库文件和头文件路径 1.库文件(LIBS添加的是共享库文件,-L添加目录,-l指定共享库名称) LIBS += -L/usr/local/lib -lmath LIBS的使用就是 ...
随机推荐
- 【leetcode】935. Knight Dialer
题目如下: A chess knight can move as indicated in the chess diagram below: . This time, we p ...
- 【架构】Linux结构
Linux系统一般有4个主要部分: 内核.shell.文件系统和应用程序.内核.shell和文件系统一起形成了基本的操作系统结构,它们使得用户可以运行程序.管理文件并使用系统.部分层次结构如图1-1所 ...
- parse_str()函数怎么用?
php parse_str()函数 语法 parse_str()函数怎么用? php parse_str()函数表示将字符串解析成多个变量,语法是parse_str(string,array),如果未 ...
- delphi 随意将函数执行权限提高到Ring0源代码
//随意将函数执行权限提高到Ring0源代码//Windows 2K以上的操作系统,//用途: 提供超级简单使用的APIrocessRing0(),//可将delphi中的任意函数由原來的Ring3权 ...
- Tomcat集群搭建超详细(apache+mod_jk+tomcat)
TOMCAT集群 目录 TOMCAT集群 1 1 集群 1 1.1 什么是集群 1 1.2 集群的特性 1 1.3 集群的分类 1 1.4 TOMCAT集群配置的优缺点 2 1.5 APACHE+TO ...
- php环境搭建以及优化
WampServer 配置伪静态 httpd.conf文件 搜索找到“LoadModule rewrite_module modules/mod_rewrite.so”这一行,去掉前面的“#”: 搜索 ...
- winform DataGridView的虚模式填充,CellValueNeeded事件的触发条件
虚模式填充常用来处理大量数据,某个字段的显示问题. DataGridView是.net 2.0新增的表格数据编辑和显示控件,简单的数据显示和编辑,只需直接和数据源绑定就可以了. 对于 一些特殊情况,我 ...
- ActiveX (ocx) 控件 在vs2010 上debug 的方法
1.在项目的属性中配置Debug,设置调试选项卡中的“命令”.“命令参数”.“工作目录”,“命令”为IE的路径,“命令参数”为自己写的htm页面路径(因htm中未配置ocx路径,所以直接把htm放在了 ...
- [轉]Linux kernel <2.6.29 exit_notify() local root exploit分析(2009-1337)
author : deep_pro目前网上的这个exploit(http://www.milw0rm.com/exploits/8369)的分析是有些问题的(http://forum.evilocta ...
- WPF 动态添加控件以及样式字典的引用(Style introduction)
原文:WPF 动态添加控件以及样式字典的引用(Style introduction) 我们想要达到的结果是,绑定多个Checkbox然后我们还可以获取它是否被选中,其实很简单,我们只要找到那几个关键的 ...