-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathascii_table.cpp
71 lines (56 loc) · 1.62 KB
/
ascii_table.cpp
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "ascii_table.h"
#include "ui_ascii_table.h"
ASCII_Table::ASCII_Table(QWidget *parent) :
QWidget(parent),
ui(new Ui::ASCII_Table)
{
ui->setupUi(this);
}
ASCII_Table::~ASCII_Table()
{
delete ui;
}
void ASCII_Table::on_lineedit_findControlASCII_textChanged(const QString &arg1)
{
int row = ui->tab_controlASCII->rowCount();
//全显
if( arg1 == ""){
for(int i = 0; i < row ;i++){
ui->tab_controlASCII->setRowHidden(i,false);
}
}else{
QList<QTableWidgetItem *> item = ui->tab_controlASCII->findItems(arg1,Qt::MatchContains);
//全隐
for(int i = 0; i < row; i++){
ui->tab_controlASCII->setRowHidden(i,true);
}
//匹配则显
if(!item.isEmpty()){
for(int i = 0; i < item.count(); i++){
ui->tab_controlASCII->setRowHidden(item.at(i)->row(),false);
}
}
}
}
void ASCII_Table::on_lineEdit_findDisplayASCII_textChanged(const QString &arg1)
{
int row = ui->tab_displayASCII->rowCount();
//全显
if( arg1 == ""){
for(int i = 0; i < row ;i++){
ui->tab_displayASCII->setRowHidden(i,false);
}
}else{
QList<QTableWidgetItem *> item = ui->tab_displayASCII->findItems(arg1,Qt::MatchContains);
//全隐
for(int i = 0; i < row; i++){
ui->tab_displayASCII->setRowHidden(i,true);
}
//匹配则显
if(!item.isEmpty()){
for(int i = 0; i < item.count(); i++){
ui->tab_displayASCII->setRowHidden(item.at(i)->row(),false);
}
}
}
}