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
mainwindow.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#ifndef MAINWINDOW_H
5#define MAINWINDOW_H
6
7#include <QMainWindow>
8
9QT_BEGIN_NAMESPACE
10
11class QWidget;
12class QAction;
13
14class QTableWidget;
15class QListWidget;
16class QTreeWidget;
17class QDockWidget;
18
19class QTableView;
20class QListView;
21
22class QTextBrowser;
23
24class QListWidgetItem;
25class QTreeWidgetItem;
26
27class QAbstractItemModel;
28class QItemSelectionModel;
29
30class MainWindow : public QMainWindow
31{
33
34public:
36 MainWindow(QWidget *parent = nullptr);
37
38 void setupContents();
39 void setupDockWindow();
40 void setupMenus();
41 void setupTableItems();
42 void setupTreeItems();
43
44 void updateText(QListWidgetItem *item);
45 void updateMenus(QTreeWidgetItem *current);
46 void updateSortItems();
47 void updateSelection(const QItemSelection &selected,
48 const QItemSelection &deselected);
49
50 void createMenus();
51 void createToolBars();
52 void createDockWidgets();
53
54 void sortAscending();
55 void sortDescending();
56
57 void insertItem();
58 void removeItem();
59
60 void changeWidth();
61 void changeHeight();
62 void changeCurrent(const QModelIndex &current,
63 const QModelIndex &previous);
64
65 void findItems();
66 void averageItems();
67 void sumItems();
68
69private:
70 void setupListItems();
71
72 void fillSelection();
73 void clearSelection();
74 void selectAll();
75
76 QTextBrowser *textBrowser;
77 QListWidget *headingList;
78 QDockWidget *contentsWindow;
79
80 QAction *insertAction;
81 QAction *removeAction;
82 QAction *ascendingAction;
83 QAction *descendingAction;
84 QAction *autoSortAction;
85 QAction *findItemsAction;
86
87 //! [0]
88 QTableWidget *tableWidget;
89 //! [0]
90
91 QTreeWidget *treeWidget;
92 QListWidget *listWidget;
93
94 QAbstractItemModel *model;
95 QItemSelectionModel *selectionModel;
96
97 QTableView *table;
98 QListView *listView;
99
100};
101
102QT_END_NAMESPACE
103
104#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