Stellarium
24.3
|
Reimplement a QGraphicsView for Stellarium. More...
#include <StelMainView.hpp>
Data Structures | |
struct | GLInfo |
Contains some basic info about the OpenGL context used. More... | |
Public Slots | |
void | setFullScreen (bool) |
Set whether fullscreen is activated or not. | |
void | focusSky () |
Return focus to the sky item. To be used when we close a dialog. | |
void | saveScreenShot (const QString &filePrefix="stellarium-", const QString &saveDir="", const bool overwrite=false) |
Save a screen shot. More... | |
void | setScreenshotFormat (const QString filetype) |
QString | getScreenshotFormat () const |
bool | getFlagInvertScreenShotColors () const |
Get whether colors are inverted when saving screenshot. | |
void | setFlagInvertScreenShotColors (bool b) |
Set whether colors should be inverted when saving screenshot. | |
bool | getFlagScreenshotDateFileName () const |
Get whether date and time should be used for screenshot naming. | |
void | setFlagScreenshotDateFileName (bool b) |
Set whether date and time should be used for screenshot naming. | |
void | setScreenshotFileMask (const QString filemask) |
QString | getScreenshotFileMask () const |
bool | getFlagOverwriteScreenShots () const |
Get whether existing files are overwritten when saving screenshot. | |
void | setFlagOverwriteScreenShots (bool b) |
Set whether existing files are overwritten when saving screenshot. | |
bool | getFlagUseCustomScreenshotSize () const |
Get whether custom size should be used for screenshots. | |
void | setFlagUseCustomScreenshotSize (bool b) |
Set whether custom size should be used for screenshots. | |
int | getCustomScreenshotWidth () const |
Get custom screenshot width. | |
void | setCustomScreenshotWidth (int width) |
Set custom width for screenshots. | |
int | getCustomScreenshotHeight () const |
Get custom screenshot height. | |
void | setCustomScreenshotHeight (int height) |
Set custom height for screenshots. | |
int | getScreenshotDpi () const |
Get screenshot DPI. This is only an entry in the screenshot image metadata. The raster content is not influenced. | |
void | setScreenshotDpi (int dpi) |
Set screenshot DPI. This is only an entry in the screenshot image metadata. The raster content is not influenced. | |
float | getCustomScreenshotMagnification () const |
Get screenshot magnification. More... | |
bool | getFlagCursorTimeout () const |
Get the state of the mouse cursor timeout flag. | |
void | setFlagCursorTimeout (bool b) |
Set the state of the mouse cursor timeout flag. | |
double | getCursorTimeout () const |
Get the mouse cursor timeout in seconds. | |
void | setCursorTimeout (double t) |
Set the mouse cursor timeout in seconds. | |
void | setMinFps (float m) |
Set the minimum frames per second. More... | |
float | getMinFps () const |
Get the current minimum frames per second. | |
void | setMaxFps (float m) |
Set the maximum frames per second. More... | |
float | getMaxFps () const |
Get the current maximum frames per second. | |
void | setMinTimeBetweenFrames (int m) |
Set the minimum time between frames (in milliseconds). More... | |
int | getMinTimeBetweenFrames () const |
Get the current minimum time between frames. | |
void | thereWasAnEvent () |
Notify that an event was handled by the program and therefore the FPS should be maximized for a couple of seconds. | |
bool | needsMaxFPS () const |
Determines if we should render as fast as possible, or limit the FPS. More... | |
void | setSkyBackgroundColor (Vec3f color) |
Set the sky background color. (Actually forwards to the StelRootItem.) Everything else than black creates a work of art! | |
Vec3f | getSkyBackgroundColor () const |
Get the sky background color. (Actually retrieves from the StelRootItem.) Everything else than black creates a work of art! | |
Signals | |
void | sizeChanged (const QSize &sz) |
emitted when window size has changed | |
void | screenshotRequested (void) |
emitted when saveScreenShot is requested with saveScreenShot(). More... | |
void | fullScreenChanged (bool b) |
void | reloadShadersRequested () |
Emitted when the "Reload shaders" action is performed Interested objects should subscribe to this signal and reload their shaders when this is emitted. | |
void | updateIconsRequested () |
void | flagInvertScreenShotColorsChanged (bool b) |
void | flagOverwriteScreenshotsChanged (bool b) |
void | flagUseCustomScreenshotSizeChanged (bool use) |
void | flagScreenshotDateFileNameChanged (bool flag) |
void | customScreenshotWidthChanged (int width) |
void | customScreenshotHeightChanged (int height) |
void | screenshotDpiChanged (int dpi) |
void | screenshotFormatChanged (QString format) |
void | screenshotFileMaskChanged (QString format) |
void | skyBackgroundColorChanged (Vec3f color) |
void | flagCursorTimeoutChanged (bool b) |
void | cursorTimeoutChanged (double t) |
void | minFpsChanged (int fps) |
void | maxFpsChanged (int fps) |
void | minTimeBetweenFramesChanged (int tbf) |
Public Member Functions | |
StelMainView (QSettings *settings) | |
void | init () |
Start the main initialization of Stellarium. | |
void | deinit () |
void | initTitleI18n () |
Set the application title for the current language. More... | |
void | deinitGL () |
Delete openGL textures (to call before the GLContext disappears) | |
QGraphicsWidget * | getGuiWidget () const |
Return the parent gui widget, this should be used as parent to all the StelDialog instances. | |
QPoint | getMousePos () const |
Return mouse position coordinates. | |
QOpenGLContext * | glContext () const |
Returns the main application OpenGL context, which should be used for all drawing Stellarium does. More... | |
void | glContextMakeCurrent () |
Make the main GL context (the one returned from glContext()) current on the main view surface. | |
void | glContextDoneCurrent () |
Releases the main GL context. | |
const GLInfo & | getGLInformation () const |
Returns the information about the GL context, this does not require the context to be active. | |
QRectF | setWindowSize (int width, int height) |
Set image size in windowed mode. More... | |
Static Public Member Functions | |
static StelMainView & | getInstance () |
Get the StelMainView singleton instance. | |
static QSurfaceFormat | getDesiredGLFormat (QSettings *configuration) |
Returns the desired OpenGL format settings. | |
Protected Member Functions | |
void | moveEvent (QMoveEvent *event) override |
Hack to determine current monitor pixel ratio. More... | |
void | closeEvent (QCloseEvent *event) override |
Handle window closed event, calling StelApp::quit() | |
void | resizeEvent (QResizeEvent *event) override |
Handle window resized events, and change the size of the underlying QGraphicsScene to be the same. | |
void | mouseMoveEvent (QMouseEvent *event) override |
Wake up mouse cursor (if it was hidden) | |
bool | eventFilter (QObject *obj, QEvent *event) override |
Properties | |
bool | fullScreen |
bool | flagInvertScreenShotColors |
bool | flagScreenshotDateFileName |
QString | screenShotFileMask |
file type like "png" or "jpg". | |
bool | flagOverwriteScreenshots |
if set to true, screenshot is named by date and time format | |
bool | flagUseCustomScreenshotSize |
if set to true, screenshot is named exactly screenShotPrefix.png and overwrites existing file | |
int | customScreenshotWidth |
if true, the next 2 values are observed for screenshots. | |
int | customScreenshotHeight |
used when flagCustomResolutionScreenshots==true | |
int | screenshotDpi |
used when flagCustomResolutionScreenshots==true | |
QString | screenShotFormat |
bool | flagCursorTimeout |
double | cursorTimeout |
Vec3f | skyBackgroundColor |
int | minFps |
int | maxFps |
int | minTimeBetweenFrames |
The minimum desired time between frames, in milliseconds. | |
Friends | |
class | StelGuiItem |
class | StelRootItem |
class | StelGraphicsScene |
class | NightModeGraphicsEffect |
Reimplement a QGraphicsView for Stellarium.
It is the class creating the singleton GL Widget, the main StelApp instance as well as the main GUI.
struct StelMainView::GLInfo |
Contains some basic info about the OpenGL context used.
|
inlineslot |
Get screenshot magnification.
This should be used by StarMgr, text drawing and other elements which may want to enlarge their output in screenshots to keep them visible.
QOpenGLContext* StelMainView::glContext | ( | ) | const |
Returns the main application OpenGL context, which should be used for all drawing Stellarium does.
void StelMainView::initTitleI18n | ( | ) |
Set the application title for the current language.
This is useful for e.g. chinese.
|
overrideprotected |
Hack to determine current monitor pixel ratio.
|
slot |
Determines if we should render as fast as possible, or limit the FPS.
This depends on the time the last user event happened.
|
slot |
Save a screen shot.
The format of the file, and hence the filename extension depends on the architecture and build type.
|
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.
|
inlineslot |
Set the maximum frames per second.
m | the new maximum fps setting. |
|
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.
m | the new minimum fps setting. |
|
inlineslot |
Set the minimum time between frames (in milliseconds).
m | the new setting. |
|
slot |
QRectF StelMainView::setWindowSize | ( | int | width, |
int | height | ||
) |
Set image size in windowed mode.
Leaves fullScreen if necessary. This is required for externally accessing Stellarium from other programs, do not delete!