Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Лидия Ладыгина
qt_nodepad
Commits
98cb1911
Commit
98cb1911
authored
4 years ago
by
Лидия Ладыгина
Browse files
Options
Download
Patches
Plain Diff
Add new file
parent
69e81e9f
master
No related merge requests found
Pipeline
#1442
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xmlreader.cpp
+68
-0
xmlreader.cpp
with
68 additions
and
0 deletions
+68
-0
xmlreader.cpp
0 → 100644
+
68
−
0
View file @
98cb1911
#include
"xmlreader.h"
#include
<QtXml>
#include
<QtWidgets>
#include
"xmlparser.h"
/*
void sltTree();
void sltExecute();
void sltLoadXq();
*/
XmlReader
::
XmlReader
(
QWidget
*
parent
)
:
QMainWindow
(
parent
)
{
f_mainParser
=
new
XmlParser
(
this
);
QMenu
*
menuFile
=
new
QMenu
(
"File"
,
this
);
f_menuTree
=
new
QMenu
(
"Tree"
,
this
);
QMenu
*
menuQuery
=
new
QMenu
(
"Query"
,
this
);
menuFile
->
addAction
(
"Open..."
,
f_mainParser
,
&
XmlParser
::
sltLoad
,
QKeySequence
(
"CTRL+O"
));
menuFile
->
addAction
(
"Close All"
,
f_mainParser
,
&
XmlParser
::
sltDropAll
,
QKeySequence
(
"CTRL+D"
));
menuFile
->
addSeparator
();
menuFile
->
addAction
(
"Exit"
,
qApp
,
SLOT
(
quit
()),
QKeySequence
(
"CTRL+Q"
));
connect
(
f_menuTree
,
SIGNAL
(
aboutToShow
()),
SLOT
(
sltTree
()));
menuQuery
->
addAction
(
"Execute..."
,
this
,
&
XmlReader
::
sltExecute
,
QKeySequence
(
"CTRL+E"
));
menuQuery
->
addAction
(
"Load Query..."
,
this
,
&
XmlReader
::
sltLoadXq
,
QKeySequence
(
"CTRL+L"
));
menuBar
()
->
addMenu
(
menuFile
);
menuBar
()
->
addMenu
(
f_menuTree
);
menuBar
()
->
addMenu
(
menuQuery
);
setCentralWidget
(
f_mainParser
);
f_mainParser
->
show
();
resize
(
800
,
600
);
}
XmlReader
::~
XmlReader
()
{}
void
XmlReader
::
sltTree
()
{
f_menuTree
->
clear
();
QAction
*
pact
;
auto
rootList
=
f_mainParser
->
sltGetRootList
();
for
(
auto
it
:
*
rootList
)
{
pact
=
f_menuTree
->
addAction
(
it
->
text
());
connect
(
pact
,
SIGNAL
(
triggered
()),
f_mainParser
,
SLOT
(
sltSetCurrentRoot
()));
}
}
void
XmlReader
::
sltExecute
()
{
}
void
XmlReader
::
sltLoadXq
()
{
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets