Changeset View
Changeset View
Standalone View
Standalone View
src/elementdataviewer.cpp
Context not available. | |||||
18 | #include <kplotaxis.h> | 18 | #include <kplotaxis.h> | ||
---|---|---|---|---|---|
19 | #include <kplotobject.h> | 19 | #include <kplotobject.h> | ||
20 | 20 | | |||
21 | #include <klocale.h> | | |||
22 | #include <kactioncollection.h> | | |||
23 | #include <kstandardaction.h> | | |||
24 | #include <ktoolinvocation.h> | | |||
25 | #include <kunitconversion/converter.h> | | |||
26 | #include "prefs.h" | 21 | #include "prefs.h" | ||
22 | #include <KActionCollection> | ||||
27 | #include <KConfig> | 23 | #include <KConfig> | ||
28 | #include <KConfigWidgets/khelpclient.h> | 24 | #include <KConfigGroup> | ||
25 | #include <KHelpClient> | ||||
26 | #include <KStandardAction> | ||||
27 | #include <KToolInvocation> | ||||
28 | #include <KUnitConversion/Converter> | ||||
29 | 29 | | |||
30 | //QT-Includes | 30 | //QT-Includes | ||
31 | #include <QDebug> | ||||
32 | #include <QDialogButtonBox> | ||||
31 | #include <QKeyEvent> | 33 | #include <QKeyEvent> | ||
32 | #include <QPen> | 34 | #include <QPen> | ||
35 | #include <QPushButton> | ||||
33 | #include <QTimer> | 36 | #include <QTimer> | ||
34 | #include <QDebug> | 37 | #include <QVBoxLayout> | ||
35 | 38 | | |||
36 | AxisData::AxisData(AXISTYPE type) : currentDataType(-1) | 39 | AxisData::AxisData(AXISTYPE type) : currentDataType(-1) | ||
37 | { | 40 | { | ||
Context not available. | |||||
49 | 52 | | |||
50 | 53 | | |||
51 | ElementDataViewer::ElementDataViewer(QWidget *parent) | 54 | ElementDataViewer::ElementDataViewer(QWidget *parent) | ||
52 | : KDialog(parent), | 55 | : QDialog(parent), | ||
53 | m_yData(new AxisData(AxisData::Y)), | 56 | m_yData(new AxisData(AxisData::Y)), | ||
54 | m_xData(new AxisData(AxisData::X)) | 57 | m_xData(new AxisData(AxisData::X)) | ||
55 | { | 58 | { | ||
56 | setCaption(i18n("Plot Data")); | 59 | setWindowTitle(i18n("Plot Data")); | ||
57 | setButtons(Help | Close); | 60 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Help|QDialogButtonBox::Close); | ||
58 | setDefaultButton(Close); | 61 | QWidget *mainWidget = new QWidget(this); | ||
62 | QVBoxLayout *mainLayout = new QVBoxLayout; | ||||
63 | setLayout(mainLayout); | ||||
64 | mainLayout->addWidget(mainWidget); | ||||
65 | connect(buttonBox, &QDialogButtonBox::accepted, this, &ElementDataViewer::accept); | ||||
66 | connect(buttonBox, &QDialogButtonBox::rejected, this, &ElementDataViewer::reject); | ||||
67 | mainLayout->addWidget(buttonBox); | ||||
68 | buttonBox->button(QDialogButtonBox::Close)->setDefault(true); | ||||
59 | 69 | | |||
60 | KalziumDataObject *kdo = KalziumDataObject::instance(); | 70 | KalziumDataObject *kdo = KalziumDataObject::instance(); | ||
61 | 71 | | |||
62 | ui.setupUi(mainWidget()); | 72 | ui.setupUi(mainWidget); | ||
63 | 73 | | |||
64 | m_timer = new QTimer(this); | 74 | m_timer = new QTimer(this); | ||
65 | m_timer->setSingleShot(true); | 75 | m_timer->setSingleShot(true); | ||
Context not available. | |||||
75 | m_actionCollection = new KActionCollection (this); | 85 | m_actionCollection = new KActionCollection (this); | ||
76 | KStandardAction::quit(this, SLOT(close()), m_actionCollection); | 86 | KStandardAction::quit(this, SLOT(close()), m_actionCollection); | ||
77 | 87 | | |||
78 | connect(m_timer, SIGNAL(timeout()), | 88 | connect(m_timer, &QTimer::timeout, | ||
79 | this, SLOT(drawPlot())); | 89 | this, &ElementDataViewer::drawPlot); | ||
80 | connect(ui.KCB_y, SIGNAL(activated(int)), | 90 | connect(ui.KCB_y, QOverload<int>::of(&KComboBox::activated), | ||
81 | this, SLOT(rangeChanged())); | 91 | this, &ElementDataViewer::rangeChanged); | ||
82 | connect(ui.KCB_x, SIGNAL(activated(int)), | 92 | connect(ui.KCB_x, QOverload<int>::of(&KComboBox::activated), | ||
83 | this, SLOT(rangeChanged())); | 93 | this, &ElementDataViewer::rangeChanged); | ||
84 | connect(ui.comboElementLabels, SIGNAL(activated(int)), | 94 | connect(ui.comboElementLabels, QOverload<int>::of(&KComboBox::activated), | ||
85 | this, SLOT(rangeChanged())); | 95 | this, &ElementDataViewer::rangeChanged); | ||
86 | connect(ui.comboElementType,SIGNAL(activated(int)), | 96 | connect(ui.comboElementType, QOverload<int>::of(&KComboBox::activated), | ||
87 | this, SLOT(rangeChanged())); | 97 | this, &ElementDataViewer::rangeChanged); | ||
88 | connect(ui.from, SIGNAL(valueChanged(int)), | 98 | connect(ui.from, QOverload<int>::of(&QSpinBox::valueChanged), | ||
89 | this, SLOT(rangeChanged())); | 99 | this, &ElementDataViewer::rangeChanged); | ||
90 | connect(ui.to, SIGNAL(valueChanged(int)), | 100 | connect(ui.to, QOverload<int>::of(&QSpinBox::valueChanged), | ||
91 | this, SLOT(rangeChanged())); | 101 | this, &ElementDataViewer::rangeChanged); | ||
92 | connect(this, SIGNAL(helpClicked()), | 102 | connect(buttonBox->button(QDialogButtonBox::Help), &QPushButton::clicked, | ||
93 | this, SLOT(slotHelp())); | 103 | this, &ElementDataViewer::slotHelp); | ||
94 | connect(ui.full, SIGNAL(clicked()), | 104 | connect(ui.full, &QPushButton::clicked, | ||
95 | this, SLOT(fullRange())); | 105 | this, &ElementDataViewer::fullRange); | ||
96 | drawPlot(); | 106 | drawPlot(); | ||
97 | 107 | | |||
98 | resize(650, 500); | 108 | resize(650, 500); | ||
Context not available. |