StelMainGraphicsView.cpp   StelMainGraphicsView.cpp 
skipping to change at line 96 skipping to change at line 96
#endif #endif
#ifdef USE_STATIC_PLUGIN_OCULARS #ifdef USE_STATIC_PLUGIN_OCULARS
Q_IMPORT_PLUGIN(Oculars) Q_IMPORT_PLUGIN(Oculars)
#endif #endif
#ifdef USE_STATIC_PLUGIN_TELESCOPECONTROL #ifdef USE_STATIC_PLUGIN_TELESCOPECONTROL
Q_IMPORT_PLUGIN(TelescopeControl) Q_IMPORT_PLUGIN(TelescopeControl)
#endif #endif
#ifdef USE_STATIC_PLUGIN_SOLARSYSTEMEDITOR
Q_IMPORT_PLUGIN(SolarSystemEditor)
#endif
#ifdef USE_STATIC_PLUGIN_TIMEZONECONFIGURATION
Q_IMPORT_PLUGIN(TimeZoneConfiguration)
#endif
// Initialize static variables // Initialize static variables
StelMainGraphicsView* StelMainGraphicsView::singleton = NULL; StelMainGraphicsView* StelMainGraphicsView::singleton = NULL;
class StelQGLWidget : public QGLWidget class StelQGLWidget : public QGLWidget
{ {
public: public:
StelQGLWidget(QGLContext* ctx, QWidget* parent) : QGLWidget(ctx, par ent) StelQGLWidget(QGLContext* ctx, QWidget* parent) : QGLWidget(ctx, par ent)
{ {
setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_PaintOnScreen);
setAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_NoSystemBackground);
setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_OpaquePaintEvent);
//setAutoFillBackground(false); //setAutoFillBackground(false);
setBackgroundRole(QPalette::Window); setBackgroundRole(QPalette::Window);
} }
protected: protected:
virtual void initializeGL() virtual void initializeGL()
{ {
qDebug() << "OpenGL supported version: " << QString((char*)g
lGetString(GL_VERSION));
QGLWidget::initializeGL(); QGLWidget::initializeGL();
if (!format().stencil()) if (!format().stencil())
qWarning("Could not get stencil buffer; results will be suboptimal"); qWarning("Could not get stencil buffer; results will be suboptimal");
if (!format().depth()) if (!format().depth())
qWarning("Could not get depth buffer; results will b e suboptimal"); qWarning("Could not get depth buffer; results will b e suboptimal");
if (!format().doubleBuffer()) if (!format().doubleBuffer())
qWarning("Could not get double buffer; results will be suboptimal"); qWarning("Could not get double buffer; results will be suboptimal");
QString paintEngineStr; QString paintEngineStr;
skipping to change at line 207 skipping to change at line 217
} }
void StelMainGraphicsView::init(QSettings* conf) void StelMainGraphicsView::init(QSettings* conf)
{ {
Q_ASSERT(glWidget->isValid()); Q_ASSERT(glWidget->isValid());
glWidget->makeCurrent(); glWidget->makeCurrent();
// Create the main widget for stellarium, which in turn creates the main StelApp instance. // Create the main widget for stellarium, which in turn creates the main StelApp instance.
mainSkyItem = new StelAppGraphicsWidget(); mainSkyItem = new StelAppGraphicsWidget();
mainSkyItem->setZValue(-10); mainSkyItem->setZValue(-10);
mainSkyItem->setContentsMargins(0,0,0,0);
QGraphicsGridLayout* l = new QGraphicsGridLayout(backItem); QGraphicsGridLayout* l = new QGraphicsGridLayout(backItem);
l->setContentsMargins(0,0,0,0);
l->setSpacing(0); l->setSpacing(0);
l->setContentsMargins(0,0,0,0);
l->addItem(mainSkyItem, 0, 0); l->addItem(mainSkyItem, 0, 0);
backItem->setLayout(l);
scene()->addItem(backItem); scene()->addItem(backItem);
// Activate the resizing caused by the layout // Activate the resizing caused by the layout
QCoreApplication::processEvents(); QCoreApplication::processEvents();
mainSkyItem->setFocus(); mainSkyItem->setFocus();
flagInvertScreenShotColors = conf->value("main/invert_screenshots_co lors", false).toBool(); flagInvertScreenShotColors = conf->value("main/invert_screenshots_co lors", false).toBool();
setFlagCursorTimeout(conf->value("gui/flag_mouse_cursor_timeout", fa lse).toBool()); setFlagCursorTimeout(conf->value("gui/flag_mouse_cursor_timeout", fa lse).toBool());
setCursorTimeout(conf->value("gui/mouse_cursor_timeout", 10.f).toFlo at()); setCursorTimeout(conf->value("gui/mouse_cursor_timeout", 10.f).toFlo at());
skipping to change at line 268 skipping to change at line 280
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
QString startupScript; QString startupScript;
if (qApp->property("onetime_startup_script").isValid()) if (qApp->property("onetime_startup_script").isValid())
qApp->property("onetime_startup_script").toString(); qApp->property("onetime_startup_script").toString();
else else
startupScript = conf->value("scripts/startup_script", "start up.ssc").toString(); startupScript = conf->value("scripts/startup_script", "start up.ssc").toString();
scriptMgr->runScript(startupScript); scriptMgr->runScript(startupScript);
#endif #endif
QThread::currentThread()->setPriority(QThread::HighestPriority); QThread::currentThread()->setPriority(QThread::HighestPriority);
StelPainter::setQPainter(NULL); StelPainter::setQPainter(NULL);
startMainLoop(); startMainLoop();
} }
void StelMainGraphicsView::thereWasAnEvent() void StelMainGraphicsView::thereWasAnEvent()
{ {
lastEventTimeSec = StelApp::getTotalRunTime(); lastEventTimeSec = StelApp::getTotalRunTime();
} }
void StelMainGraphicsView::drawBackground(QPainter*, const QRectF&) void StelMainGraphicsView::drawBackground(QPainter*, const QRectF&)
{ {
skipping to change at line 329 skipping to change at line 341
minFpsTimer = new QTimer(this); minFpsTimer = new QTimer(this);
connect(minFpsTimer, SIGNAL(timeout()), scene(), SLOT(update())); connect(minFpsTimer, SIGNAL(timeout()), scene(), SLOT(update()));
minFpsTimer->start((int)(1./getMinFps()*1000.)); minFpsTimer->start((int)(1./getMinFps()*1000.));
} }
void StelMainGraphicsView::resizeEvent(QResizeEvent* event) void StelMainGraphicsView::resizeEvent(QResizeEvent* event)
{ {
scene()->setSceneRect(QRect(QPoint(0, 0), event->size())); scene()->setSceneRect(QRect(QPoint(0, 0), event->size()));
backItem->setGeometry(0,0,event->size().width(),event->size().height ()); backItem->setGeometry(0,0,event->size().width(),event->size().height ());
QGraphicsView::resizeEvent(event); QGraphicsView::resizeEvent(event);
} }
void StelMainGraphicsView::mouseMoveEvent(QMouseEvent* event) void StelMainGraphicsView::mouseMoveEvent(QMouseEvent* event)
{ {
thereWasAnEvent(); // Refresh screen ASAP thereWasAnEvent(); // Refresh screen ASAP
QGraphicsView::mouseMoveEvent(event); QGraphicsView::mouseMoveEvent(event);
} }
void StelMainGraphicsView::mousePressEvent(QMouseEvent* event) void StelMainGraphicsView::mousePressEvent(QMouseEvent* event)
{ {
 End of changes. 8 change blocks. 
2 lines changed or deleted 16 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/