func:替换添加所有页选项。
This commit is contained in:
20
MainWidget.h
20
MainWidget.h
@@ -11,9 +11,17 @@
|
||||
#include "src/attribute_edit.h"
|
||||
|
||||
struct SElement_t {
|
||||
SElement_t(Element_t* e, const std::string& s);
|
||||
Element_t* ele{};
|
||||
std::string str{};
|
||||
SElement_t(Element_t* e, std::string& s);
|
||||
Element_t* ele;
|
||||
std::string str;
|
||||
};
|
||||
|
||||
enum ReplaceArea { AREA_SELECT, AREA_ALL_PAGE, AREA_CUR_PAGE, AREA_ALL };
|
||||
|
||||
struct OperElement {
|
||||
OperElement(Element_t* ele, int row);
|
||||
Element_t* element_{};
|
||||
int row_{0};
|
||||
};
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -37,7 +45,7 @@ public:
|
||||
|
||||
private:
|
||||
void read(const QString& file_path);
|
||||
void search();
|
||||
void search(const QString& key);
|
||||
void item_changed_handle(QTableWidgetItem* item);
|
||||
void save();
|
||||
void copy_select_line();
|
||||
@@ -60,6 +68,10 @@ protected:
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void replace_str(const QString& pre, const QString& after, Element_t* ele);
|
||||
void replace_str(Element_t* ele, const QString& rg, const QString& after);
|
||||
|
||||
private:
|
||||
void get_related_elements(std::vector<OperElement*>& out, ReplaceArea area);
|
||||
|
||||
private:
|
||||
Element_t* get_element_by_key(const QString& key);
|
||||
Element_t* get_element_by_row(int row);
|
||||
|
||||
Reference in New Issue
Block a user