Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
model.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#ifndef MODEL_H
5#define MODEL_H
6
7#include <QAbstractTableModel>
8#include <QStringList>
9#include <QVariant>
10
11class TableModel : public QAbstractTableModel
12{
13 Q_OBJECT
14
15public:
16 TableModel(int rows = 1, int columns = 1, QObject *parent = nullptr);
17
18 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
19 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
20 QVariant data(const QModelIndex &index, int role) const override;
21 QVariant headerData(int section, Qt::Orientation orientation,
22 int role = Qt::DisplayRole) const override;
23
24 Qt::ItemFlags flags(const QModelIndex &index) const override;
25 bool setData(const QModelIndex &index, const QVariant &value,
26 int role = Qt::EditRole) override;
27
28 bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex()) override;
29 bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex()) override;
30 bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex()) override;
31 bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex()) override;
32
33private:
34 QList<QStringList> rowList;
35};
36
37#endif
void changeHeight()
void sortAscending()
void setupTableItems()
void setupMenus()
void sortDescending()
void setupTreeItems()
void insertItem()
void setupDockWindow()
void changeWidth()
void findItems()
void averageItems()
void updateSortItems()
MainWindow(QWidget *parent=nullptr)
void sumItems()
void createMenus()
[0]
void createToolBars()
void updateText(QListWidgetItem *item)
void changeCurrent(const QModelIndex &current, const QModelIndex &previous)
[2]
Definition window.cpp:63
void updateMenus(QTreeWidgetItem *current)
void updateSelection(const QItemSelection &selected, const QItemSelection &deselected)
[0]
Definition window.cpp:41
void removeItem()
friend class QWidget
Definition qpainter.h:431