File indexing completed on 2024-05-12 15:27:58
0001 /*************************************************************************** 0002 File : CursorDock.cpp 0003 Project : LabPlot 0004 Description : This dock represents the data from the cursors in the cartesian plots 0005 -------------------------------------------------------------------- 0006 Copyright : (C) 2019 Martin Marmsoler (martin.marmsoler@gmail.com) 0007 Copyright : (C) 2019-2020 Alexander Semke (alexander.semke@web.de) 0008 0009 ***************************************************************************/ 0010 0011 /*************************************************************************** 0012 * * 0013 * This program is free software; you can redistribute it and/or modify * 0014 * it under the terms of the GNU General Public License as published by * 0015 * the Free Software Foundation; either version 2 of the License, or * 0016 * (at your option) any later version. * 0017 * * 0018 * This program is distributed in the hope that it will be useful, * 0019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0021 * GNU General Public License for more details. * 0022 * * 0023 * You should have received a copy of the GNU General Public License * 0024 * along with this program; if not, write to the Free Software * 0025 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 0026 * Boston, MA 02110-1301 USA * 0027 * * 0028 ***************************************************************************/ 0029 0030 #ifndef CURSORDOCK_H 0031 #define CURSORDOCK_H 0032 0033 #include <QWidget> 0034 0035 namespace Ui { 0036 class CursorDock; 0037 } 0038 class Worksheet; 0039 class CartesianPlot; 0040 0041 /*! 0042 * \brief The CursorDock class 0043 * This class represents the data from the cursors from the cartesian plots in a treeview 0044 */ 0045 class CursorDock : public QWidget { 0046 Q_OBJECT 0047 0048 public: 0049 explicit CursorDock(QWidget* parent = nullptr); 0050 ~CursorDock(); 0051 void setWorksheet(Worksheet*); 0052 0053 public slots: 0054 void plotCursor0EnableChanged(bool); 0055 void plotCursor1EnableChanged(bool); 0056 0057 private: 0058 void collapseAll(); 0059 void expandAll(); 0060 void cursor0EnableChanged(bool); 0061 void cursor1EnableChanged(bool); 0062 bool eventFilter(QObject*, QEvent*) override; 0063 0064 Ui::CursorDock* ui; 0065 bool m_initializing{false}; 0066 QVector<CartesianPlot*> m_plotList; 0067 CartesianPlot* m_plot{nullptr}; 0068 QList<QMetaObject::Connection> selectedPlotsConnection; 0069 0070 private slots: 0071 void contextMenuRequested(QPoint); 0072 void resultCopy(); 0073 void resultCopyAll(); 0074 }; 0075 0076 #endif // CURSORDOCK_H