plot: remove ssDot item from point shape option

This commit is contained in:
schdub
2015-05-22 04:26:00 +03:00
parent bd0df70329
commit 8a4abcf9da
3 changed files with 236 additions and 242 deletions

View File

@@ -1629,7 +1629,10 @@ void MainWindow::updatePlot(SqliteTableModel *model, bool update)
// some styling
graph->setData(xdata, ydata);
graph->setLineStyle((QCPGraph::LineStyle) ui->comboLineType->currentIndex());
graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)ui->comboPointShape->currentIndex(), 5));
// WARN: ssDot is removed
int shapeIdx = ui->comboPointShape->currentIndex();
if (shapeIdx > 0) shapeIdx += 1;
graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)shapeIdx, 5));
// gather Y label column names
yAxisLabels << model->headerData(y, Qt::Horizontal).toString();
@@ -2131,6 +2134,8 @@ void MainWindow::on_comboLineType_currentIndexChanged(int index)
void MainWindow::on_comboPointShape_currentIndexChanged(int index)
{
// WARN: because ssDot point shape is removed
if (index > 0) index += 1;
Q_ASSERT(index >= QCPScatterStyle::ssNone &&
index < QCPScatterStyle::ssPixmap);
QCPScatterStyle::ScatterShape shape = (QCPScatterStyle::ScatterShape) index;

View File

@@ -22,7 +22,7 @@
<item>
<widget class="QTabWidget" name="mainTab">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="structure">
<attribute name="title">
@@ -324,7 +324,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>472</width>
<width>311</width>
<height>531</height>
</rect>
</property>
@@ -1008,253 +1008,242 @@
<widget class="QWidget" name="dockWidgetContents_2">
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QVBoxLayout" name="verticalLayout_8">
<widget class="QSplitter" name="splitterForPlot">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QTreeWidget" name="treePlotColumns">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="columnCount">
<number>4</number>
</property>
<attribute name="headerDefaultSectionSize">
<number>100</number>
</attribute>
<column>
<property name="text">
<string>Columns</string>
</property>
</column>
<column>
<property name="text">
<string>X</string>
</property>
</column>
<column>
<property name="text">
<string>Y</string>
</property>
</column>
<column>
<property name="text">
<string>_</string>
</property>
</column>
</widget>
<widget class="QCustomPlot" name="plotWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>8</verstretch>
</sizepolicy>
</property>
</widget>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QSplitter" name="splitterForPlot">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Line type:</string>
</property>
<widget class="QTreeWidget" name="treePlotColumns">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="columnCount">
<number>4</number>
</property>
<attribute name="headerDefaultSectionSize">
<number>100</number>
</attribute>
<column>
<property name="text">
<string>Columns</string>
</property>
</column>
<column>
<property name="text">
<string>X</string>
</property>
</column>
<column>
<property name="text">
<string>Y</string>
</property>
</column>
<column>
<property name="text">
<string>_</string>
</property>
</column>
</widget>
<widget class="QCustomPlot" name="plotWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>8</verstretch>
</sizepolicy>
</property>
</widget>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
<widget class="QComboBox" name="comboLineType">
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>None</string>
</property>
<property name="topMargin">
<number>0</number>
</item>
<item>
<property name="text">
<string>Line</string>
</property>
<property name="rightMargin">
<number>0</number>
</item>
<item>
<property name="text">
<string>StepLeft</string>
</property>
<property name="bottomMargin">
<number>0</number>
</item>
<item>
<property name="text">
<string>StepRight</string>
</property>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Line type:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboLineType">
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Line</string>
</property>
</item>
<item>
<property name="text">
<string>StepLeft</string>
</property>
</item>
<item>
<property name="text">
<string>StepRight</string>
</property>
</item>
<item>
<property name="text">
<string>StepCenter</string>
</property>
</item>
<item>
<property name="text">
<string>Impulse</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Point shape:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboPointShape">
<property name="currentIndex">
<number>5</number>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Dot</string>
</property>
</item>
<item>
<property name="text">
<string>Cross</string>
</property>
</item>
<item>
<property name="text">
<string>Plus</string>
</property>
</item>
<item>
<property name="text">
<string>Circle</string>
</property>
</item>
<item>
<property name="text">
<string>Disc</string>
</property>
</item>
<item>
<property name="text">
<string>Square</string>
</property>
</item>
<item>
<property name="text">
<string>Diamond</string>
</property>
</item>
<item>
<property name="text">
<string>Star</string>
</property>
</item>
<item>
<property name="text">
<string>Triangle</string>
</property>
</item>
<item>
<property name="text">
<string>TriangleInverted</string>
</property>
</item>
<item>
<property name="text">
<string>CrossSquare</string>
</property>
</item>
<item>
<property name="text">
<string>PlusSquare</string>
</property>
</item>
<item>
<property name="text">
<string>CrossCircle</string>
</property>
</item>
<item>
<property name="text">
<string>PlusCircle</string>
</property>
</item>
<item>
<property name="text">
<string>Peace</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="butSavePlot">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Save current plot...&lt;/p&gt;&lt;p&gt;File format chosen by extension (png, jpg, pdf, bmp)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="statusTip">
<string>Save current plot...</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/save_table</normaloff>:/icons/save_table</iconset>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<property name="text">
<string>StepCenter</string>
</property>
</item>
<item>
<property name="text">
<string>Impulse</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Point shape:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboPointShape">
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Cross</string>
</property>
</item>
<item>
<property name="text">
<string>Plus</string>
</property>
</item>
<item>
<property name="text">
<string>Circle</string>
</property>
</item>
<item>
<property name="text">
<string>Disc</string>
</property>
</item>
<item>
<property name="text">
<string>Square</string>
</property>
</item>
<item>
<property name="text">
<string>Diamond</string>
</property>
</item>
<item>
<property name="text">
<string>Star</string>
</property>
</item>
<item>
<property name="text">
<string>Triangle</string>
</property>
</item>
<item>
<property name="text">
<string>TriangleInverted</string>
</property>
</item>
<item>
<property name="text">
<string>CrossSquare</string>
</property>
</item>
<item>
<property name="text">
<string>PlusSquare</string>
</property>
</item>
<item>
<property name="text">
<string>CrossCircle</string>
</property>
</item>
<item>
<property name="text">
<string>PlusCircle</string>
</property>
</item>
<item>
<property name="text">
<string>Peace</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="butSavePlot">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Save current plot...&lt;/p&gt;&lt;p&gt;File format chosen by extension (png, jpg, pdf, bmp)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="statusTip">
<string>Save current plot...</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/save_table</normaloff>:/icons/save_table</iconset>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>

View File

@@ -309,7 +309,7 @@ QVariant PreferencesDialog::getSettingsDefaultValue(const QString& group, const
// QCPScatterStyle::ssDisk
if(name == "pointShape")
return 5;
return 4;
}
// Unknown combination of group and name? Return an invalid QVariant!