Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
skylivex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
astronomy
skylivex
Commits
d594b24b
Commit
d594b24b
authored
Feb 16, 2013
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Communication between mainwindow and core
established by using signals/slot
parent
64ecb4dc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
5 deletions
+37
-5
skylivex.pro
skylivex.pro
+1
-1
main.cpp
src/main.cpp
+3
-0
mainwin.cpp
src/mainwin.cpp
+9
-0
mainwin.h
src/mainwin.h
+11
-3
skylivex.cpp
src/skylivex.cpp
+9
-0
skylivex.h
src/skylivex.h
+4
-1
No files found.
skylivex.pro
View file @
d594b24b
...
...
@@ -6,7 +6,7 @@ HEADERS = src/skylivex.h \
src
/
mainwin
.
h
\
src
/
pluginsinterfaces
.
h
QT
+=
network
webkitwidgets
widgets
QT
+=
core
network
webkitwidgets
widgets
OTHER_FILES
+=
\
gui
/
splash
.
html
\
...
...
src/main.cpp
View file @
d594b24b
...
...
@@ -76,6 +76,9 @@ int main(int argc, char *argv[])
QObject
::
connect
(
skxprocess
,
SIGNAL
(
timeout
()),
skx
,
SLOT
(
process
()));
skxprocess
->
start
();
// connect core with the mainwin
QObject
::
connect
(
skx
,
SIGNAL
(
msgForMainWin
(
std
::
string
&
)),
&
mainw
,
SLOT
(
msgFromCore
(
std
::
string
&
)));
// and then.. go!
return
skylivexapp
.
exec
();
...
...
src/mainwin.cpp
View file @
d594b24b
...
...
@@ -33,9 +33,11 @@
*
*/
#include "mainwin.h"
#include <QWebView>
#include <QFile>
#include <QDir>
#include <QPalette>
#include <iostream>
MainWin
::
MainWin
(
QFile
&
htmlfile
)
:
QWebView
(
0
)
...
...
@@ -54,9 +56,16 @@ MainWin::MainWin(QFile &htmlfile)
setHtml
(
htmlFileName
,
baseUrl
);
resize
(
250
,
200
);
}
MainWin
::~
MainWin
()
{
}
void
MainWin
::
msgFromCore
(
std
::
string
&
msg
)
{
std
::
cout
<<
"Message from core: "
<<
msg
<<
std
::
endl
;
}
src/mainwin.h
View file @
d594b24b
...
...
@@ -39,6 +39,7 @@
#include <QUrl>
#include <QFile>
#include <QString>
#include <QObject>
/*
* class MainWin
...
...
@@ -47,13 +48,20 @@
*/
class
MainWin
:
public
QWebView
{
QUrl
baseurl
;
QFile
htmlfile
;
QString
htmlFileName
;
Q_OBJECT
QUrl
baseurl
;
QFile
htmlfile
;
QString
htmlFileName
;
public
:
MainWin
(
QFile
&
htmlfile
);
~
MainWin
();
public
slots
:
void
msgFromCore
(
std
::
string
&
msg
);
};
...
...
src/skylivex.cpp
View file @
d594b24b
...
...
@@ -43,6 +43,7 @@
#include <iostream>
// Load and initialize plugins and shared memory communication
void
SkyliveX
::
initialize
()
{
...
...
@@ -55,6 +56,8 @@ void SkyliveX::initialize()
void
SkyliveX
::
process
()
{
//std::cout << "process" << std::endl;
std
::
string
sarca
(
"ANTANI!"
);
sendMsgToMainWin
(
sarca
);
}
...
...
@@ -93,3 +96,9 @@ void SkyliveX::initializePlugin(QObject *plugin, QString filename)
// now the plugin can be initialized and used
}
}
void
SkyliveX
::
sendMsgToMainWin
(
std
::
string
&
msg
)
{
//std::cout << "Send To MainWin: " << msg << std::endl;
emit
msgForMainWin
(
msg
);
}
src/skylivex.h
View file @
d594b24b
...
...
@@ -38,6 +38,8 @@
#include <QObject>
#include <QString>
#include "pluginsinterfaces.h"
#include <iostream>
#include <string>
/*
* class SkyliveX
...
...
@@ -61,10 +63,11 @@ class SkyliveX : public QObject
public
slots
:
void
initialize
();
void
process
();
void
sendMsgToMainWin
(
std
::
string
&
msg
);
signals
:
void
finished
();
void
msgForMainWin
(
std
::
string
&
msg
);
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment