Stellarium 0.14.3
List of all members | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions
StelMainView Class Reference

Reimplement a QGraphicsView for Stellarium. More...

#include <StelMainView.hpp>

Public Slots

void setFullScreen (bool)
 Set whether fullscreen is activated or not. More...
 
void saveScreenShot (const QString &filePrefix="stellarium-", const QString &saveDir="", const bool overwrite=false)
 Save a screen shot. More...
 
bool getFlagInvertScreenShotColors () const
 Get whether colors are inverted when saving screenshot. More...
 
void setFlagInvertScreenShotColors (bool b)
 Set whether colors should be inverted when saving screenshot. More...
 
bool getFlagOverwriteScreenShots () const
 Get whether existing files are overwritten when saving screenshot. More...
 
void setFlagOverwriteScreenShots (bool b)
 Set whether existing files are overwritten when saving screenshot. More...
 
bool getFlagCursorTimeout ()
 Get the state of the mouse cursor timeout flag. More...
 
float getCursorTimeout () const
 Get the mouse cursor timeout in seconds. More...
 
void setFlagCursorTimeout (bool b)
 Get the state of the mouse cursor timeout flag. More...
 
void setCursorTimeout (float t)
 Set the mouse cursor timeout in seconds. More...
 
void setMinFps (float m)
 Set the minimum frames per second. More...
 
float getMinFps ()
 Get the current minimum frames per second. More...
 
void setMaxFps (float m)
 Set the maximum frames per second. More...
 
float getMaxFps ()
 Get the current maximum frames per second. More...
 
void maxFpsSceneUpdate ()
 
void updateScene ()
 Updates the scene and process all events. More...
 
void thereWasAnEvent ()
 Notify that an event was handled by the program and therefore the FPS should be maximized for a couple of seconds. More...
 

Signals

void screenshotRequested (void)
 emitted when saveScreenShot is requested with saveScreenShot(). More...
 

Public Member Functions

 StelMainView (QWidget *parent=NULL)
 
void init (class QSettings *conf)
 Start the main initialization of Stellarium. More...
 
void deinit ()
 
void initTitleI18n ()
 Set the application title for the current language. More...
 
void deinitGL ()
 Delete openGL textures (to call before the GLContext disappears) More...
 
void focusSky ()
 Return focus to the sky item. To be used when we close a dialog. More...
 
QGraphicsWidget * getGuiWidget () const
 Return the parent gui widget, this should be used as parent to all the StelDialog instances. More...
 
QPoint getMousePos ()
 Return mouse position coordinates. More...
 

Static Public Member Functions

static StelMainViewgetInstance ()
 Get the StelMainView singleton instance. More...
 

Protected Member Functions

virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void wheelEvent (QWheelEvent *wheelEvent)
 
virtual void moveEvent (QMoveEvent *event)
 
virtual void closeEvent (QCloseEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void drawBackground (QPainter *painter, const QRectF &rect)
 Update the mouse pointer state and schedule next redraw. More...
 

Detailed Description

Reimplement a QGraphicsView for Stellarium.

It is the class creating the singleton GL Widget, the main StelApp instance as well as the main GUI.

Definition at line 49 of file StelMainView.hpp.

Member Function Documentation

void StelMainView::deinitGL ( )

Delete openGL textures (to call before the GLContext disappears)

virtual void StelMainView::drawBackground ( QPainter *  painter,
const QRectF &  rect 
)
protectedvirtual

Update the mouse pointer state and schedule next redraw.

This method is called automatically by Qt.

void StelMainView::focusSky ( )

Return focus to the sky item. To be used when we close a dialog.

float StelMainView::getCursorTimeout ( ) const
inlineslot

Get the mouse cursor timeout in seconds.

Definition at line 109 of file StelMainView.hpp.

bool StelMainView::getFlagCursorTimeout ( )
inlineslot

Get the state of the mouse cursor timeout flag.

Definition at line 107 of file StelMainView.hpp.

bool StelMainView::getFlagInvertScreenShotColors ( ) const
inlineslot

Get whether colors are inverted when saving screenshot.

Definition at line 97 of file StelMainView.hpp.

bool StelMainView::getFlagOverwriteScreenShots ( ) const
inlineslot

Get whether existing files are overwritten when saving screenshot.

Definition at line 102 of file StelMainView.hpp.

QGraphicsWidget* StelMainView::getGuiWidget ( ) const
inline

Return the parent gui widget, this should be used as parent to all the StelDialog instances.

Definition at line 77 of file StelMainView.hpp.

static StelMainView& StelMainView::getInstance ( )
inlinestatic

Get the StelMainView singleton instance.

Definition at line 69 of file StelMainView.hpp.

float StelMainView::getMaxFps ( )
inlineslot

Get the current maximum frames per second.

Definition at line 126 of file StelMainView.hpp.

float StelMainView::getMinFps ( )
inlineslot

Get the current minimum frames per second.

Definition at line 121 of file StelMainView.hpp.

QPoint StelMainView::getMousePos ( )

Return mouse position coordinates.

void StelMainView::init ( class QSettings *  conf)

Start the main initialization of Stellarium.

void StelMainView::initTitleI18n ( )

Set the application title for the current language.

This is useful for e.g. chinese.

void StelMainView::saveScreenShot ( const QString &  filePrefix = "stellarium-",
const QString &  saveDir = "",
const bool  overwrite = false 
)
slot

Save a screen shot.

The format of the file, and hence the filename extension depends on the architecture and build type.

  • filePrefix changes the beginning of the file name
  • saveDir changes the directory where the screenshot is saved If saveDir is "" then StelFileMgr::getScreenshotDir() will be used
  • overwrite if true,
  • filePrefix is used as filename, and existing file will be overwritten.
void StelMainView::screenshotRequested ( void  )
signal

emitted when saveScreenShot is requested with saveScreenShot().

doScreenshot() does the actual work (it has to do it in the main thread, where as saveScreenShot() might get called from another one.

void StelMainView::setCursorTimeout ( float  t)
inlineslot

Set the mouse cursor timeout in seconds.

Definition at line 113 of file StelMainView.hpp.

void StelMainView::setFlagCursorTimeout ( bool  b)
inlineslot

Get the state of the mouse cursor timeout flag.

Definition at line 111 of file StelMainView.hpp.

void StelMainView::setFlagInvertScreenShotColors ( bool  b)
inlineslot

Set whether colors should be inverted when saving screenshot.

Definition at line 99 of file StelMainView.hpp.

void StelMainView::setFlagOverwriteScreenShots ( bool  b)
inlineslot

Set whether existing files are overwritten when saving screenshot.

Definition at line 104 of file StelMainView.hpp.

void StelMainView::setFullScreen ( bool  )
slot

Set whether fullscreen is activated or not.

void StelMainView::setMaxFps ( float  m)
inlineslot

Set the maximum frames per second.

Parameters
mthe new maximum fps setting.

Definition at line 124 of file StelMainView.hpp.

void StelMainView::setMinFps ( float  m)
inlineslot

Set the minimum frames per second.

Usually this minimum will be switched to after there are no user events for some seconds to save power. However, if can be useful to set this to a high value to improve playing smoothness in scripts.

Parameters
mthe new minimum fps setting.

Definition at line 119 of file StelMainView.hpp.

void StelMainView::thereWasAnEvent ( )
slot

Notify that an event was handled by the program and therefore the FPS should be maximized for a couple of seconds.

void StelMainView::updateScene ( )
slot

Updates the scene and process all events.


The documentation for this class was generated from the following file: