forked from dyj095/QT_tree_checkDemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
41 lines (30 loc) · 946 Bytes
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTreeWidgetItem>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
void init();
void updateParentItem(QTreeWidgetItem* item);
void setParentPartiallyChecked(QTreeWidgetItem *itm);
QTreeWidgetItem* addChildNode(QTreeWidgetItem *parent, int index, QString namePre);
QTreeWidgetItem* addChildEmpNode(QTreeWidgetItem *parent, int index);
public slots:
//申明信号与槽,当树形控件的子选项被改变时执行
void treeItemChanged(QTreeWidgetItem* item , int column);
void onItemExpanded(QTreeWidgetItem * item);
void onItemCollapsed(QTreeWidgetItem * item);
void onItemClicked(QTreeWidgetItem * item, int column);
private:
void loadStyleSheet();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H