Warning, file /office/calligra/libs/widgets/KoTableView.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * Copyright (C) 2015 Boudewijn Rempt <boud@valdyas.org> 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Library General Public 0006 * License as published by the Free Software Foundation; either 0007 * version 2 of the License, or (at your option) any later version. 0008 * 0009 * This library is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 * Library General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Library General Public License 0015 * along with this library; see the file COPYING.LIB. If not, write to 0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 #ifndef KOTABLEVIEW_H 0020 #define KOTABLEVIEW_H 0021 0022 #include <QTableView> 0023 0024 #include "kowidgets_export.h" 0025 0026 class QEvent; 0027 class QModelIndex; 0028 0029 /** 0030 * @brief The KoTableView class provides a QTableView with fixed columns or rows 0031 */ 0032 class KOWIDGETS_EXPORT KoTableView: public QTableView 0033 { 0034 Q_OBJECT 0035 0036 public: 0037 enum ViewMode { 0038 FIXED_COLUMNS, /// The number of columns is fixed 0039 FIXED_ROWS /// The number of rows is fixed 0040 }; 0041 0042 explicit KoTableView(QWidget *parent = nullptr); 0043 ~KoTableView() override = default; 0044 0045 /** reimplemented 0046 * This will draw a number of rows based on the number of columns if m_viewMode is FIXED_COLUMS 0047 * And it will draw a number of columns based on the number of rows if m_viewMode is FIXED_ROWS 0048 */ 0049 void resizeEvent(QResizeEvent *event) override; 0050 0051 0052 void setViewMode(ViewMode mode); 0053 0054 void updateView(); 0055 0056 Q_SIGNALS: 0057 0058 void sigSizeChanged(); 0059 0060 private: 0061 ViewMode m_viewMode; 0062 }; 0063 0064 #endif // KOTABLEVIEW_H