Stellarium 0.11.4 | |||
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
Base class for all the GUI windows in Stellarium. More...
#include <StelDialog.hpp>
Public Slots | |
virtual void | retranslate ()=0 |
Retranslate the content of the dialog. | |
void | setVisible (bool) |
On the first call with "true" populates the window contents. | |
void | close () |
Closes the window (the window widget is not deleted, just not visible). | |
Signals | |
void | visibleChanged (bool) |
Public Member Functions | |
StelDialog (QObject *parent=NULL) | |
bool | visible () const |
Protected Member Functions | |
virtual void | createDialogContent ()=0 |
Initialize the dialog widgets and connect the signals/slots. | |
Protected Attributes | |
QWidget * | dialog |
The main dialog. | |
class CustomProxy * | proxy |
Base class for all the GUI windows in Stellarium.
Windows in Stellarium are actually basic QWidgets that have to be wrapped in a QGraphicsProxyWidget (CustomProxy) to be displayed by StelMainGraphicsView (which is derived from QGraphicsView). See the Qt documentation for details.
The base widget needs to be populated with controls in the implementation of the createDialogContent() function. This can be done either manually, or by using a .ui file. See the Qt documentation on using Qt Designer .ui files for details.
The createDialogContent() function itself is called automatically the first time setVisible() is called with "true".
Moving a window is done by dragging its title bar, defined in the BarFrame class. Every derived window class needs a BarFrame object - it has to be either included in a .ui file, or manually instantiated in createDialogContent().
void StelDialog::close | ( | ) | [slot] |
Closes the window (the window widget is not deleted, just not visible).
Reimplemented in DateTimeDialog.
virtual void StelDialog::createDialogContent | ( | ) | [protected, pure virtual] |
Initialize the dialog widgets and connect the signals/slots.
Implemented in AddRemoveLandscapesDialog, AtmosphereDialog, ConfigurationDialog, DateTimeDialog, HelpDialog, LocationDialog, ScriptConsole, SearchDialog, and ViewDialog.
virtual void StelDialog::retranslate | ( | ) | [pure virtual, slot] |
Retranslate the content of the dialog.
Needs to be connected to StelApp::languageChanged(). At the very least, if the window is based on a Qt Designer file (.ui), the implementation needs to call the generated class' retranslateUi() method, like this:
Implemented in AddRemoveLandscapesDialog, AtmosphereDialog, ConfigurationDialog, DateTimeDialog, HelpDialog, LocationDialog, ScriptConsole, SearchDialog, and ViewDialog.
void StelDialog::setVisible | ( | bool | ) | [slot] |
On the first call with "true" populates the window contents.
Reimplemented in AddRemoveLandscapesDialog, and SearchDialog.
QWidget* StelDialog::dialog [protected] |
The main dialog.