-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditordialog.cpp
executable file
·79 lines (56 loc) · 1.53 KB
/
editordialog.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
72
73
74
75
76
77
78
79
#include "editordialog.h"
#include "ui_editordialog.h"
#include "searchdialog.h"
#include<QClipboard>
#include <QMessageBox>
#ifdef Q_OS_LINUX
int edos=0;
#elif defined(Q_OS_WIN)
int edos=1;
#elif defined(Q_OS_MAC)
int edos=2;
#endif
QClipboard *edclipboard = QApplication::clipboard();
editorDialog::editorDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::editorDialog)
{
ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
}
editorDialog::~editorDialog()
{
delete ui;
}
/////////////////////////////////////////////////////////////
void editorDialog::seteditor(const QString &xmlfile)
{
ui->editorBrowser->setText(xmlfile);
}
void editorDialog::on_copyButton_clicked()
{
edclipboard->setText(ui->editorBrowser->toPlainText());
}
///////////////////////////////////////////////////
QString editorDialog::xmlfile() {
return ui->editorBrowser->toPlainText();
}
///////////////////////////////////////////////////
void editorDialog::setfilename(const QString &filename)
{
ui->editorfilename->setText(filename);
}
///////////////////////////////////////////
void editorDialog::on_searchButton_clicked()
{
searchDialog sdialog;
sdialog.setModal(true);
if(sdialog.exec() == QDialog::Accepted)
{
QString fstring = sdialog.esearch1();
QString rstring = sdialog.esearch2();
QString tempstring = ui->editorBrowser->toPlainText();
tempstring.replace(fstring,rstring);
ui->editorBrowser->setText(tempstring);
}
}