DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DA::DAChartSettingWidget类 参考

绘图设置窗口 更多...

#include <DAChartSettingWidget.h>

类 DA::DAChartSettingWidget 继承关系图:

class  PrivateData
 

Public 类型

enum  SettingWidgetType {
  SettingPlot = 0 , SettingCanvas , SettingYLeftScale , SettingYRightScale ,
  SettingXBottomScale , SettingXTopScale , SettingPlotItems
}
 固定选择区域,固定选择区域是combobox比较固定的选中区域,用于识别combobox选中后能知道选中了什么内容
 
enum  ComboBoxRole { RolePlotItemPtr = Qt::UserRole + 1 }
 

Public 成员函数

 DAChartSettingWidget (QWidget *parent=nullptr)
 
void setPlot (QwtPlot *plot)
 设置绘图
 
QwtPlot * getPlot () const
 获取当前管理的绘图指针
 
void updateUI ()
 更新界面
 
void setCurrentPlotItem (QwtPlotItem *item)
 
QwtPlotItem * getCurrentPlotItem () const
 
void setSelection (const DAFigureElementSelection &sel)
 设置选中内容
 
void showSettingWidget (SettingWidgetType widType)
 显示对应设置窗口, 不会设置combobox的index
 
void showPlotSetting ()
 
void showCanvasSetting ()
 
void showScaleYLeftSetting ()
 
void showScaleYRightSetting ()
 
void showScaleXBottomSetting ()
 
void showScaleXTopSetting ()
 
void showPlotItemSetting (QwtPlotItem *item)
 显示plotitem需要注意,如果传入的plotitem
 
DAChartPlotSettingWidgetgetChartPlotSettingWidget () const
 
DAChartCanvasSettingWidgetgetChartCanvasSettingWidget () const
 
DAChartAxisSetWidgetgetChartAxisSetWidget (int axisId) const
 
DAChartCommonItemsSettingWidgetgetChartCommonItemsSettingWidget () const
 

Protected 槽

void onComboBoxItemIndexChanged (int index)
 
void onItemAttached (QwtPlotItem *plotItem, bool on)
 
void resetComboBox ()
 

Protected 成员函数

void changeEvent (QEvent *e)
 
int findComboBoxIndexFromPlotItem (const QwtPlotItem *item) const
 通过plotitem,从combobox找到对应的索引
 
void appendPlotItemToComboBox (const QwtPlotItem *item)
 
QwtPlotItem * getPlotItemFromComboBox (int index) const
 
void removePlotItemFromComboBox (const QwtPlotItem *item)
 

详细描述

绘图设置窗口

绘图设置窗口主要由两个部分组成

  1. 绘图对象选择框:一个combobox,把所有涉及的可设置的绘图对象列举出来
  2. stackwidget,对应combobox的显示的窗口

由于每个设置窗口管理的对象都不一样,因此此窗口统一设置一个qwtplot指针

注解
对于寄生绘图,此窗口不会做过多的复杂操作,仅仅把它当做一个普通的qwtplot来处理,但寄生绘图有些参数是不可设置, 因此寄生绘图的设置需要外部窗口让用户选中寄生绘图的绘图对象来进行设置
此窗口不处理QwtFigure相关参数,最大单元是QwtPlot

成员枚举类型说明

◆ ComboBoxRole

枚举值
RolePlotItemPtr 

存放plotitem指针的角色

成员函数说明

◆ findComboBoxIndexFromPlotItem()

int DA::DAChartSettingWidget::findComboBoxIndexFromPlotItem ( const QwtPlotItem *  item) const
protected

通过plotitem,从combobox找到对应的索引

参数
item
返回
找不到返回-1

◆ getPlot()

QwtPlot * DA::DAChartSettingWidget::getPlot ( ) const

获取当前管理的绘图指针

返回

◆ onComboBoxItemIndexChanged

void DA::DAChartSettingWidget::onComboBoxItemIndexChanged ( int  index)
protectedslot
注解
注意,这里不要调用setCurrentItem函数
参数
i

◆ setPlot()

void DA::DAChartSettingWidget::setPlot ( QwtPlot *  plot)

设置绘图

参数
plot

◆ setSelection()

void DA::DAChartSettingWidget::setSelection ( const DAFigureElementSelection sel)

设置选中内容

DAFigureElementSelection一般有绘图结构树传递过来

参数
sel

◆ showPlotItemSetting()

void DA::DAChartSettingWidget::showPlotItemSetting ( QwtPlotItem *  item)

显示plotitem需要注意,如果传入的plotitem

参数
item

◆ showSettingWidget()

void DA::DAChartSettingWidget::showSettingWidget ( SettingWidgetType  widType)

显示对应设置窗口, 不会设置combobox的index

参数
widType

该类的文档由以下文件生成: