1 Star 0 Fork 1

2144/SerialWizard

forked from 码蚁丶/SerialWizard 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
DataProcessDialog.h 3.39 KB
一键复制 编辑 原始数据 按行查看 历史
//
// Created by chang on 2021/6/14.
//
#ifndef SERIALWIZARD_DATAPROCESSDIALOG_H
#define SERIALWIZARD_DATAPROCESSDIALOG_H
#include <QDialog>
class QLabel;
class QTextEdit;
class QLineEdit;
class QRadioButton;
class QCheckBox;
class QPushButton;
class DataProcessDialog : public QDialog {
Q_OBJECT
public:
explicit DataProcessDialog(const QString &text="", QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
~DataProcessDialog() override;
enum class MatchPositionType {
First = 0,
Last,
Middle,
};
enum class LineReturn {
RN = 0,
R,
N,
Space,
None,
Custom
};
QString text();
QString matchText();
int fromIndex();
bool includeMatchText();
int matchPosition();
MatchPositionType matchPositionType();
LineReturn lineReturn();
int matchLineCount();
QList<int> getMatchIndexList();
QStringList getMatchIndexTextList();
protected:
void keyPressEvent(QKeyEvent *) override;
void closeEvent(QCloseEvent *event) override;
void dropEvent(QDropEvent *event) override;
void dragEnterEvent(QDragEnterEvent *event) override;
public Q_SLOT:
void replaceLineReturn();
void splitLine();
private:
void createUi();
void readSettings();
void writeSettings();
void createConnect();
void processText(QString (*p)(DataProcessDialog *, const QString &));
void processText2(bool (*p)(DataProcessDialog *, const QString &));
QTextEdit *textEdit{nullptr};
QLabel *lineCountLabel{nullptr};
QLabel *charCountLabel{nullptr};
QPushButton *simplifiedButton;
QLineEdit *fromIndexLineEdit{nullptr};
QRadioButton *matchFirstRadioButton{nullptr};
QRadioButton *matchLastRadioButton{nullptr};
QRadioButton *matchMiddleRadioButton{nullptr};
QLineEdit *matchPositionLineEdit{nullptr};
QCheckBox *includeMatchTextCheckBox{nullptr};
QLineEdit *matchTextLineEdit{nullptr};
QLineEdit *matchTextCountLineEdit{nullptr};
QPushButton *deleteTextButton{nullptr};
QPushButton *deletePrefixButton{nullptr};
QPushButton *deleteSuffixButton{nullptr};
QPushButton *deleteBeforeButton{nullptr};
QPushButton *deleteAfterButton{nullptr};
QRadioButton *returnTypeRnRadioButton{nullptr};
QRadioButton *returnTypeRRadioButton{nullptr};
QRadioButton *returnTypeNRadioButton{nullptr};
QRadioButton *returnTypeSpaceRadioButton{nullptr};
QRadioButton *returnTypeNoneRadioButton{nullptr};
QRadioButton *returnTypeCustomRadioButton{nullptr};
QLineEdit *customReturnLineEdit{nullptr};
QPushButton *returnTypeReplaceButton{nullptr};
QLineEdit *framePrefixLineEdit{nullptr};
QLineEdit *frameSuffixLineEdit{nullptr};
QPushButton *frameSplitLineButton{nullptr};
QPushButton *deleteShorterLineButton{nullptr};
QPushButton *deleteShorterOrEqualLineButton{nullptr};
QPushButton *deleteLongerLineButton{nullptr};
QPushButton *deleteLongerOrEqualLineButton{nullptr};
QPushButton *deleteMatchTextLineButton{nullptr};
QPushButton *saveMatchTextLineButton{nullptr};
QList<QLineEdit *> indexLineEditList;
QList<QLineEdit *> matchLineEditList;
QPushButton *deleteMatchLineButton{nullptr};
QPushButton *keepMatchLineButton{nullptr};
QPushButton *saveButton{nullptr};
QPushButton *cancelButton{nullptr};
};
#endif //SERIALWIZARD_DATAPROCESSDIALOG_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/iamherer/SerialWizard.git
git@gitee.com:iamherer/SerialWizard.git
iamherer
SerialWizard
SerialWizard
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385