MCPcopy Create free account
hub / github.com/cxasm/notepad-- / FindWin

Method FindWin

src/findwin.cpp:28–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26const int MAX_RECORD_KEY_LENGTH = 20;
27
28FindWin::FindWin(QWidget *parent):QMainWindow(parent), m_editTabWidget(nullptr), m_isFindFirst(true), m_findHistory(nullptr), \
29 pEditTemp(nullptr), m_curEditWin(nullptr), m_isStatic(false), m_isReverseFind(false), m_pMainPad(parent)
30{
31 ui.setupUi(this);
32
33 //默认值要与界面初始值一样。
34 m_BackwardDir = false;
35 m_matchWhole = false;
36 m_matchCase = false;
37 m_matchWrap = true;
38 m_extend = false;
39 m_searchMode = 1;
40
41 m_re = false;
42 m_cs = false;
43 m_wo = false;
44 m_wrap = true;
45 m_forward = true;;//是否向前查找。注意如果向后,要为false
46 m_extend = false;
47 m_isFound = false;
48
49
50 connect(ui.findModeRegularBt, &QRadioButton::toggled, this, &FindWin::slot_findModeRegularBtChange);
51 connect(ui.replaceModeRegularBt, &QRadioButton::toggled, this, &FindWin::slot_replaceModeRegularBtChange);
52 connect(ui.dealFileType, &QCheckBox::stateChanged, this,&FindWin::slot_dealFileTypeChange);
53 connect(ui.skipDir, &QCheckBox::stateChanged, this, &FindWin::slot_skipDirChange);
54 connect(ui.clearBt, &QAbstractButton::clicked, this, &FindWin::sign_clearResult);
55 connect(ui.findClearBt, &QAbstractButton::clicked, this, &FindWin::sign_clearResult);
56 connect(ui.findinfilesTab, &QTabWidget::currentChanged, this, &FindWin::slot_tabIndexChange);
57
58
59#if 0 //这样是无效的,记住一下,不删除,避免后面再做无用功
60 Qt::WindowFlags m_flags = windowFlags();
61 //这样使得窗口在上面,不至于总是到后面被挡住。
62#if defined (Q_MAC_OS)
63 setWindowFlags(m_flags | Qt::WindowStaysOnTopHint);
64#endif
65#endif
66 raise();
67 setFocusPolicy(Qt::StrongFocus);
68 setFocus();
69
70 ui.findinfilesTab->setAttribute(Qt::WA_StyledBackground);
71
72 ui.findComboBox->installEventFilter(this);
73}
74
75FindWin::~FindWin()
76{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected