20 #ifndef _STELMAINGRAPHICSVIEW_HPP_
21 #define _STELMAINGRAPHICSVIEW_HPP_
23 #include <QDeclarativeView>
24 #include <QCoreApplication>
26 #include <QOpenGLContext>
31 #define STEL_USE_NEW_OPENGL_WIDGETS 0
33 class QDeclarativeItem;
34 #if STEL_USE_NEW_OPENGL_WIDGETS
36 class StelQOpenGLWidget;
52 friend class StelGuiItem;
53 friend class StelSkyItem;
55 Q_PROPERTY(
bool fullScreen READ isFullScreen WRITE
setFullScreen)
62 void init(
class QSettings* conf);
94 void saveScreenShot(
const QString& filePrefix=
"stellarium-",
const QString& saveDir=
"");
123 void maxFpsSceneUpdate();
132 virtual void mouseMoveEvent(QMouseEvent* event);
133 virtual void mousePressEvent(QMouseEvent* event);
134 virtual void mouseReleaseEvent(QMouseEvent* event);
135 virtual void keyPressEvent(QKeyEvent* event);
136 virtual void keyReleaseEvent(QKeyEvent* event);
137 virtual void wheelEvent(QWheelEvent* wheelEvent);
138 virtual void moveEvent(QMoveEvent* event);
139 virtual void closeEvent(QCloseEvent* event);
143 virtual void drawBackground(QPainter* painter,
const QRectF &rect);
153 void doScreenshot(
void);
155 void minFpsChanged();
159 void startMainLoop();
162 void dumpOpenGLdiagnostics()
const;
165 #if STEL_USE_NEW_OPENGL_WIDGETS
166 void processOpenGLdiagnosticsAndWarnings(QSettings *conf, StelQOpenGLWidget* glWidget)
const;
168 void processOpenGLdiagnosticsAndWarnings(QSettings *conf, StelQGLWidget* glWidget)
const;
176 QGraphicsWidget *guiWidget;
177 QDeclarativeItem* skyItem;
180 #if STEL_USE_NEW_OPENGL_WIDGETS
181 StelQOpenGLWidget* glWidget;
183 StelQGLWidget* glWidget;
188 bool flagInvertScreenShotColors;
190 QString screenShotPrefix;
191 QString screenShotDir;
195 bool flagCursorTimeout;
197 double lastEventTimeSec;
200 bool flagMaxFpsUpdatePending;
208 #endif // _STELMAINGRAPHICSVIEW_HPP_
void focusSky()
Return focus to the sky item. To be used when we close a dialog.
void setFlagCursorTimeout(bool b)
Get the state of the mouse cursor timeout flag.
QPoint getMousePos()
Return mouse position coordinates.
void setCursorTimeout(float t)
Set the mouse cursor timeout in seconds.
void updateScene()
Updates the scene and process all events.
void setMinFps(float m)
Set the minimum frames per second.
void screenshotRequested(void)
emitted when saveScreenShot is requested with saveScreenShot().
static StelMainView & getInstance()
Get the StelMainView singleton instance.
void initTitleI18n()
Set the application title for the current language.
Abstract class defining the base interface for all GUIs.
virtual void drawBackground(QPainter *painter, const QRectF &rect)
Update the mouse pointer state and schedule next redraw.
bool getFlagInvertScreenShotColors() const
Get whether colors are inverted when saving screenshot.
float getCursorTimeout() const
Get the mouse cursor timeout in seconds.
bool getFlagCursorTimeout()
Get the state of the mouse cursor timeout flag.
void setMaxFps(float m)
Set the maximum frames per second.
Reimplement a QGraphicsView for Stellarium.
void setFullScreen(bool)
Set whether fullscreen is activated or not.
void init(class QSettings *conf)
Start the main initialization of Stellarium.
void deinitGL()
Delete openGL textures (to call before the GLContext disappears)
void setFlagInvertScreenShotColors(bool b)
Set whether colors should be inverted when saving screenshot.
float getMaxFps()
Get the current maximum frames per second.
QGraphicsWidget * getGuiWidget() const
Return the parent gui widget, this should be used as parent to all the StelDialog instances...
Singleton main Stellarium application class.
void saveScreenShot(const QString &filePrefix="stellarium-", const QString &saveDir="")
Save a screen shot.
void thereWasAnEvent()
Notify that an event was handled by the program and therefore the FPS should be maximized for a coupl...
float getMinFps()
Get the current minimum frames per second.