这个小部件类,对于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. JavaSE---Runtime类

    1.概述 1.1 Runtime类  代表 java程序运行时环境: 1.2 Runtime类  提供的类方法: getRuntime():获取Runtime实例: gc():通知垃圾回收器回收资源: ...

  2. java模式-----单例模式

    什么是单例设计模式? 单例模式,是一种常用的软件设计模式.在它的核心结构中只包含一个被称为单例的特殊类.通过单例模式可以保证系统中,应用该模式的类一个类只有一个实例.即一个类只有一个对象实例. 类结构 ...

  3. mitmproxy 代理介绍及入门

    转载请注明出处 https://www.cnblogs.com/majianming/p/11823669.html mitmproxy 是一个python 写成的代理工具,可以代理https.htt ...

  4. FTP上传脚本

    脚本名称:uploadToFtp.sh 脚本用途:上传文件到FTP服务器 脚本参数:$1:FTP服务器的路径,$2:本地文件 #!/bin/bash FTP_USER="testfile&q ...

  5. toleft时设置TabSequence属性为tsReversetoright时设置TabSequence属性为tsStandard

    使用这2人控件时,属性taborientation设为toleft时有个问题,具体如下设为toleft时tab会跑到左侧,这时的tab上的文字是反的.当设置为toright时,tab在右侧,这时的ta ...

  6. 【进阶技术】一篇文章搞掂:Spring高级编程

    本文篇幅较长,建议合理利用右上角目录进行查看(如果没有目录请刷新). 本文基于<Spring5高级编程>一书进行总结和扩展,大家也可以自行研读此书. 十一.任务调度 任务调度主要由三部分组 ...

  7. JS-layui:百科

    ylbtech-JS-layui:百科 layui,是一款采用自身模块规范编写的前端 UI 框架,遵循原生 HTML/CSS/JS 的书写与组织形式,门槛极低,拿来即用.其外在极简,却又不失饱满的内在 ...

  8. how to catch error in make error message

    make 2>&1 | grep error -C 10 -n

  9. 常用内置模块(一)——time、os、sys、random、shutil、pickle、json

    常用内置模块 一.time模块 在python中,时间分为3种       1.时间戳: timestamp,从1970年1月1日到现在的秒数, 主要用于计算两个时间的差    2.localtime ...

  10. java算法汇总(一)

    1.有一对兔子,从出生后第三个月起每个月都生一对兔子,小兔子涨到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月兔子总数为多少? 程序分析:斐波那契数列 0.1.1.2.3.5.8.13.21 ...