这个小部件类,对于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解读的更多相关文章

  1. Qt第三方库----QCustomPlot

    一.软件下载 下载地址:http://www.qcustomplot.com/index.php/download 这里推荐下载第一个链接的内容: 注:这里的第三方库要放在非中文目录下. 二.配置 ( ...

  2. Qt第三方库libvlc-qt——ubuntu上编译、安装,测试

      cmake 3.0编译安装(最低版本要求): sudo apt-get install ncurses-dev sudo apt-get install build-essential 下载cma ...

  3. 基于QT开发的第三方库

    基于Qt开发的第三方库 分类: Qt2014-02-12 11:34 1738人阅读 评论(0) 收藏 举报 QT第三方库   目录(?)[+]   文章来源:http://blog.csdn.net ...

  4. 基于Qt的第三方库和控件

    ====================== 基于Qt的第三方库和控件 ======================     libQxt --------   http://dev.libqxt.o ...

  5. Qt编程可不可以结合其他的第三方库和本土API?(有zeroMQ的Qt封装,还可轻易使用Python的库)

    作者:渡世白玉链接:http://www.zhihu.com/question/29030777/answer/59378712来源:知乎著作权归作者所有,转载请联系作者获得授权. 可以,十分可以,你 ...

  6. Qt使用第三方库

    简述 在 Qt 中经常会用到第三方库,例如:FFmpeg.OpenCV 等.第三方库的使用比较简单,只需要一些基本的配置就可以搞定,一起来看看吧! 简述 第三方库 源代码 库文件 目标目录 第三方库 ...

  7. Qt使用第三方库3rdparty

    简述 在 Qt 中经常会用到第三方库,例如:FFmpeg.OpenCV 等.第三方库的使用比较简单,只需要一些基本的配置就可以搞定,一起来看看吧! 简述 第三方库 源代码 库文件 目标目录 第三方库 ...

  8. Qt笔记——连接第三方库&用libZPlay库获取音频文件的艺术家、专辑等信息

    连接第三方库libZPlay 概述 需要.a/.lib ,.h , .dll 三个文件 官网下载 http://libzplay.sourceforge.net/ import .h 链接 .a 放入 ...

  9. qt .pro文件和cmakelists.txt配置第三方库

    .pro文件引用第三方库文件和头文件路径 1.库文件(LIBS添加的是共享库文件,-L添加目录,-l指定共享库名称) LIBS += -L/usr/local/lib -lmath LIBS的使用就是 ...

随机推荐

  1. An Easy Introduction to CUDA C and C++

    An Easy Introduction to CUDA C and C++ This post is the first in a series on CUDA C and C++, which i ...

  2. 卸载Anaconda

    conda install anaconda-clean anaconda-clean --yes Anaconda 安装的时候在 .bash_profile中添加了变量: export PATH=& ...

  3. MySQL事务调优

    原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/11429239.html 数据库事务 数据库事务是数据库系统执行过程中的一个逻辑处理单元,保证一个数据库 ...

  4. mui.min.js:7 Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load

    mui框架做的微信公众号网页,在上传数据的时候报了这个错,async: true,//将false改为true就可以了 https://blog.csdn.net/liuzp111/article/d ...

  5. hdu 5860 Death Sequence(递推+脑洞)

    Problem Description You may heard of the Joseph Problem, the story comes from a Jewish historian liv ...

  6. c#将数据导出到excel中

    DataTable   dt = new BLL.T_Expiry().GetAllList().Tables[0];//查询数据 string FileName = "T_Users.xl ...

  7. Linux系统之-TCP-IP链路层

    一.基本 网络层协议的数据单元是 IP 数据报 ,而数据链路层的工作就是把网络层交下来的 IP 数据报 封装为 帧(frame)发送到链路上,以及把接收到的帧中的数据取出并上交给网络层. 为达到这一目 ...

  8. docker容器管理-含静态Ip(10)

    docker run命令详解 docker run -t #表示分配一个伪终端 -i #表示让容器的标准输入打开,不跟这个参数容器启不来 -d #后台运行 -P #dockerfile中EXPOSE ...

  9. BZOJ 4545

    bzoj 4545 给定一个踹树,支持几种操作. 本质不同子串询问 加入子树 询问字符串\(S\) 在树上的出现次数. 好码好码 重点就是维护\(parent\) 树,考虑用\(LCT\)维护此树. ...

  10. 【Java架构:基础技术】一篇文章搞掂:Gradle

    前言 Gradle是什么: Gradle提供了一个域特定语言(DSL),用于描述构建 它使用 Groovy 语言,使其更容易来形容和构建 Gradle 中的每一个构建脚本使用UTF-8进行编码保存,并 ...