Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

StelMainGraphicsView Class Reference

Reimplement a QGraphicsView for Stellarium. More...

#include <StelMainGraphicsView.hpp>

List of all members.

Public Slots

void saveScreenShot (const QString &filePrefix="stellarium-", const QString &saveDir="")
bool getFlagInvertScreenShotColors () const
void setFlagInvertScreenShotColors (bool b)
bool getFlagCursorTimeout ()
float getCursorTimeout () const
void setFlagCursorTimeout (bool b)
void setCursorTimeout (float t)
void setMinFps (float m)
float getMinFps ()
void setMaxFps (float m)
float getMaxFps ()
void updateScene ()


void screenshotRequested (void)

Public Member Functions

 StelMainGraphicsView (QWidget *parent)
void init (class QSettings *conf)
void deinitGL ()
class StelAppGraphicsWidgetgetStelAppGraphicsWidget ()
QGraphicsWidget * getTopLevelGraphicsWidget ()
StelMainScriptAPIProxygetMainScriptAPIProxy ()
StelScriptMgrgetScriptMgr ()

Static Public Member Functions

static StelMainGraphicsViewgetInstance ()

Protected Member Functions

virtual void resizeEvent (QResizeEvent *event)
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 drawBackground (QPainter *painter, const QRectF &rect)

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.

Member Function Documentation

void StelMainGraphicsView::init ( class QSettings *  conf  ) 

Start the main initialization of Stellarium.

static StelMainGraphicsView& StelMainGraphicsView::getInstance (  )  [inline, static]

Get the StelMainGraphicsView singleton instance.

void StelMainGraphicsView::deinitGL (  ) 

Delete openGL textures (to call before the GLContext disappears).

class StelAppGraphicsWidget* StelMainGraphicsView::getStelAppGraphicsWidget (  )  [inline]

Return the QGraphicsWidget encapsulating the Stellarium main sky view.

Use its layout if you want to add widget on the top of the main sky view.

QGraphicsWidget* StelMainGraphicsView::getTopLevelGraphicsWidget (  )  [inline]

Return the top level QGraphicsWidget which contains the layout containing the Stellarium main sky view.

Use its layout if you want to add widget on the side of the main sky view.

StelMainScriptAPIProxy* StelMainGraphicsView::getMainScriptAPIProxy (  )  [inline]

Get the script API proxy (for signal handling).

StelScriptMgr& StelMainGraphicsView::getScriptMgr (  )  [inline]

Get the script manager.

void StelMainGraphicsView::saveScreenShot ( const QString &  filePrefix = "stellarium-",
const QString &  saveDir = "" 
) [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
  • shotDir changes the directory where the screenshot is saved If shotDir is "" then StelFileMgr::getScreenshotDir() will be used

bool StelMainGraphicsView::getFlagInvertScreenShotColors (  )  const [inline, slot]

Get whether colors are inverted when saving screenshot.

void StelMainGraphicsView::setFlagInvertScreenShotColors ( bool  b  )  [inline, slot]

Set whether colors should be inverted when saving screenshot.

bool StelMainGraphicsView::getFlagCursorTimeout (  )  [inline, slot]

Get the state of the mouse cursor timeout flag.

float StelMainGraphicsView::getCursorTimeout (  )  const [inline, slot]

Get the mouse cursor timeout in seconds.

void StelMainGraphicsView::setFlagCursorTimeout ( bool  b  )  [inline, slot]

Get the state of the mouse cursor timeout flag.

void StelMainGraphicsView::setCursorTimeout ( float  t  )  [inline, slot]

Set the mouse cursor timeout in seconds.

void StelMainGraphicsView::setMinFps ( float  m  )  [inline, slot]

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.

m the new minimum fps setting.

float StelMainGraphicsView::getMinFps (  )  [inline, slot]

Get the current minimum frames per second.

void StelMainGraphicsView::setMaxFps ( float  m  )  [inline, slot]

Set the maximum frames per second.

m the new maximum fps setting.

float StelMainGraphicsView::getMaxFps (  )  [inline, slot]

Get the current maximum frames per second.

void StelMainGraphicsView::updateScene (  )  [inline, slot]

Updates the scene and process all events.

virtual void StelMainGraphicsView::drawBackground ( QPainter *  painter,
const QRectF &  rect 
) [protected, virtual]

Update the mouse pointer state and schedule next redraw.

This method is called automatically by Qt.

void StelMainGraphicsView::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.

Generated on Wed Jun 2 13:11:14 2010 for Stellarium by  doxygen 1.5.5