Stellarium 0.11.2
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions
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

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.

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.

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
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.

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

Set the maximum frames per second.

mthe new maximum fps setting.
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.

mthe new minimum fps setting.