diff --git a/src/main.cpp b/src/main.cpp --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,5 @@ /* - Copyright © 2015 Hasan Yavuz Özderya + Copyright © 2017 Hasan Yavuz Özderya This file is part of serialplot. @@ -24,16 +24,6 @@ #include "tooltipfilter.h" #include "version.h" -// test code -#include -#include -#include -#include "channelinfomodel.h" -#include "utils.h" - -#include "color_selector.hpp" -#include "color_dialog.hpp" - MainWindow* pMainWindow; void messageHandler(QtMsgType type, const QMessageLogContext &context, @@ -60,43 +50,5 @@ int main(int argc, char *argv[]) w.show(); - // test code - ChannelInfoModel cim(2, &a); - QTableView tv; - QSpinBox cb; - - QObject::connect(&cb, SELECT::OVERLOAD_OF(&QSpinBox::valueChanged), [&cim](int value) - { - cim.setNumOfChannels(value); - }); - - tv.setModel(&cim); - - tv.show(); - // cb.show(); - - cim.setNumOfChannels(3); - cim.setNumOfChannels(7); - cim.setNumOfChannels(10); - - - color_widgets::ColorSelector cpicker; - cpicker.setColor(QColor("red")); - cpicker.show(); - - QObject::connect(tv.selectionModel(), &QItemSelectionModel::currentRowChanged, - [&cim, &cpicker](const QModelIndex ¤t, const QModelIndex &previous) - { - cpicker.setColor(cim.data(current, Qt::ForegroundRole).value()); - }); - - QObject::connect(&cpicker, &color_widgets::ColorSelector::colorChanged, - [&cim, &tv](QColor color) - { - auto index = tv.selectionModel()->currentIndex(); - index = index.sibling(index.row(), 0); - cim.setData(index, color, Qt::ForegroundRole); - }); - return a.exec(); }