Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KStars
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Education
KStars
Commits
631e95e5
Commit
631e95e5
authored
Jul 02, 2012
by
Samikshan Bairagya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option in details-view to view next sky-object.
parent
1b1cd29d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
8 deletions
+67
-8
kstars/tools/WhatsInteresting/Base.qml
kstars/tools/WhatsInteresting/Base.qml
+25
-0
kstars/tools/WhatsInteresting/WIView.cpp
kstars/tools/WhatsInteresting/WIView.cpp
+16
-3
kstars/tools/WhatsInteresting/WIView.h
kstars/tools/WhatsInteresting/WIView.h
+6
-4
kstars/tools/WhatsInteresting/modelmanager.cpp
kstars/tools/WhatsInteresting/modelmanager.cpp
+18
-0
kstars/tools/WhatsInteresting/modelmanager.h
kstars/tools/WhatsInteresting/modelmanager.h
+1
-0
kstars/tools/WhatsInteresting/skyobjlistmodel.h
kstars/tools/WhatsInteresting/skyobjlistmodel.h
+1
-1
No files found.
kstars/tools/WhatsInteresting/Base.qml
View file @
631e95e5
...
...
@@ -228,6 +228,31 @@ Rectangle {
}
}
}
Text
{
id
:
nextObjText
objectName
:
"
nextObj
"
x
:
195
y
:
276
width
:
101
height
:
15
color
:
"
#ffffff
"
text
:
qsTr
(
"
Next sky-object
"
)
visible
:
true
verticalAlignment
:
Text
.
AlignBottom
horizontalAlignment
:
Text
.
AlignRight
font.bold
:
true
font.underline
:
true
font.pixelSize
:
11
signal
nextObjTextClicked
()
MouseArea
{
id
:
mouse_area2
anchors.fill
:
parent
onClicked
:
nextObjText
.
nextObjTextClicked
()
}
}
}
}
}
kstars/tools/WhatsInteresting/WIView.cpp
View file @
631e95e5
...
...
@@ -40,6 +40,8 @@ WIView::WIView ( QObject *parent) : QObject(parent)
connect
(
soListObj
,
SIGNAL
(
soListItemClicked
(
QString
,
int
)),
this
,
SLOT
(
onSoListItemClicked
(
QString
,
int
)));
detailsViewObj
=
baseObj
->
findChild
<
QObject
*>
(
"container"
)
->
findChild
<
QObject
*>
(
"detailsViewObj"
);
nextObj
=
baseObj
->
findChild
<
QObject
*>
(
"nextObj"
);
connect
(
nextObj
,
SIGNAL
(
nextObjTextClicked
()),
this
,
SLOT
(
onNextObjTextClicked
()));
// planetaryListView->setSource(QUrl::fromLocalFile("WIPlanetaryListView.qml"));
...
...
@@ -133,16 +135,27 @@ void WIView::onSoListItemClicked(QString type, int index)
}
soListObj
->
setProperty
(
"visible"
,
false
);
loadDetailsView
(
soitem
);
loadDetailsView
(
soitem
,
index
);
}
void
WIView
::
loadDetailsView
(
SkyObjItem
*
soitem
)
void
WIView
::
loadDetailsView
(
SkyObjItem
*
soitem
,
int
index
)
{
QObject
*
sonameObj
=
detailsViewObj
->
findChild
<
QObject
*>
(
"sonameObj"
);
QObject
*
posTextObj
=
detailsViewObj
->
findChild
<
QObject
*>
(
"posTextObj"
);
QObject
*
descTextObj
=
detailsViewObj
->
findChild
<
QObject
*>
(
"descTextObj"
);
sonameObj
->
setProperty
(
"text"
,
soitem
->
getName
());
posTextObj
->
setProperty
(
"text"
,
soitem
->
getPosition
());
detailsViewObj
->
setProperty
(
"visible"
,
true
);
descTextObj
->
setProperty
(
"text"
,
soitem
->
getDesc
());
detailsViewObj
->
setProperty
(
"visible"
,
true
);
curSoItem
=
soitem
;
curIndex
=
index
;
}
void
WIView
::
onNextObjTextClicked
()
{
int
modelSize
=
m
->
returnModel
(
curSoItem
->
getType
())
->
rowCount
();
SkyObjItem
*
nextItem
=
m
->
returnModel
(
curSoItem
->
getType
())
->
getSkyObjItem
((
curIndex
+
1
)
%
modelSize
);
loadDetailsView
(
nextItem
,
(
curIndex
+
1
)
%
modelSize
);
}
kstars/tools/WhatsInteresting/WIView.h
View file @
631e95e5
...
...
@@ -16,6 +16,7 @@
***************************************************************************/
#include "QtDeclarative/QDeclarativeView"
#include "QtDeclarative/QDeclarativeContext"
#include "QModelIndex"
#include "skyobject.h"
#include "modelmanager.h"
...
...
@@ -31,24 +32,25 @@ public:
WIView
(
QObject
*
parent
=
0
);
~
WIView
();
void
manageViews
(
int
TYPE
);
//display view
void
loadDetailsView
(
SkyObjItem
*
soitem
);
void
loadDetailsView
(
SkyObjItem
*
soitem
,
int
index
);
public
slots
:
// void loadModel ( int TYPE );
// void skyObjectItemClicked(QModelIndex index);
void
onCatListItemClicked
(
QString
);
void
onSoListItemClicked
(
QString
,
int
index
);
void
onNextObjTextClicked
();
private:
QObject
*
baseObj
,
*
catListObj
,
*
soListObj
,
*
detailsViewObj
;
QObject
*
baseObj
,
*
catListObj
,
*
soListObj
,
*
detailsViewObj
,
*
nextObj
;
QDeclarativeContext
*
ctxt
;
QDeclarativeView
*
baseListView
;
QDeclarativeView
*
planetaryListView
;
QDeclarativeView
*
deepSkyListView
;
QDeclarativeView
*
skyObjListView
;
QDeclarativeView
*
planetDetailsView
;
QDeclarativeView
*
satelliteDetailsView
;
QDeclarativeView
*
deepSkyDetailsView
;
ModelManager
*
m
;
SkyObjItem
*
curSoItem
;
int
curIndex
;
};
\ No newline at end of file
kstars/tools/WhatsInteresting/modelmanager.cpp
View file @
631e95e5
...
...
@@ -165,6 +165,24 @@ SkyObjListModel* ModelManager::returnModel(ModelManager::LIST_TYPE Type)
return
(
new
SkyObjListModel
());
}
SkyObjListModel
*
ModelManager
::
returnModel
(
QString
Type
)
{
if
(
Type
==
"Planet"
)
return
planetsModel
;
else
if
(
Type
==
"Star"
)
return
starsModel
;
else
if
(
Type
==
"Galaxy"
)
return
galModel
;
else
if
(
Type
==
"Constellation"
)
return
conModel
;
// else if (Type == Star_Clusters)
// return starClustModel;
// else if (Type == Nebulae)
// return nebModel;
return
(
new
SkyObjListModel
());
}
QStringList
ModelManager
::
returnCatListModel
(
ModelManager
::
LIST_TYPE
Type
)
{
if
(
Type
==
BaseList
)
...
...
kstars/tools/WhatsInteresting/modelmanager.h
View file @
631e95e5
...
...
@@ -32,6 +32,7 @@ public:
//QStandardItemModel* returnModel ( int TYPE );
SkyObjListModel
*
returnModel
(
LIST_TYPE
Type
);
SkyObjListModel
*
returnModel
(
QString
type
);
QStringList
returnCatListModel
(
LIST_TYPE
Type
);
bool
isVisible
(
GeoLocation
*
geo
,
dms
*
lst
,
SkyObject
*
so
);
...
...
kstars/tools/WhatsInteresting/skyobjlistmodel.h
View file @
631e95e5
...
...
@@ -32,7 +32,7 @@ public:
int
rowCount
(
const
QModelIndex
&
parent
=
QModelIndex
())
const
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
;
QList
<
SkyObjItem
*>
getSkyObjItems
();
SkyObjItem
*
getSkyObjItem
(
int
index
);
SkyObjItem
*
getSkyObjItem
(
int
index
);
private:
QList
<
SkyObjItem
*>
soItemList
;
...
...
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