StelDialog.cpp   StelDialog.cpp 
skipping to change at line 43 skipping to change at line 43
#include <QStyleOptionGraphicsItem> #include <QStyleOptionGraphicsItem>
#include <QSlider> #include <QSlider>
#include <QSpinBox> #include <QSpinBox>
#include <QDoubleSpinBox> #include <QDoubleSpinBox>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <QScroller> #include <QScroller>
#endif #endif
StelDialog::StelDialog(QString dialogName, QObject* parent) StelDialog::StelDialog(QString dialogName, QObject* parent)
: QObject(parent) : QObject(parent)
, dialog(NULL) , dialog(Q_NULLPTR)
, proxy(NULL) , proxy(Q_NULLPTR)
, dialogName(dialogName) , dialogName(dialogName)
{ {
if (parent == NULL) if (parent == Q_NULLPTR)
setParent(StelMainView::getInstance().getGuiWidget()); setParent(StelMainView::getInstance().getGuiWidget());
} }
StelDialog::~StelDialog() StelDialog::~StelDialog()
{ {
} }
void StelDialog::close() void StelDialog::close()
{ {
setVisible(false); setVisible(false);
} }
bool StelDialog::visible() const bool StelDialog::visible() const
{ {
return dialog!=NULL && dialog->isVisible(); return dialog!=Q_NULLPTR && dialog->isVisible();
} }
void StelDialog::setVisible(bool v) void StelDialog::setVisible(bool v)
{ {
if(v == visible()) if(v == visible())
return; return;
if (v) if (v)
{ {
QSize screenSize = StelMainView::getInstance().size(); QSize screenSize = StelMainView::getInstance().size();
if (dialog) if (dialog)
skipping to change at line 90 skipping to change at line 90
if (newPos.x()>=screenSize.width()) if (newPos.x()>=screenSize.width())
newPos.setX(screenSize.width() - dialog->siz e().width()); newPos.setX(screenSize.width() - dialog->siz e().width());
if (newPos.y()>=screenSize.height()) if (newPos.y()>=screenSize.height())
newPos.setY(screenSize.height() - dialog->si ze().height()); newPos.setY(screenSize.height() - dialog->si ze().height());
if (newPos != dialog->pos()) if (newPos != dialog->pos())
proxy->setPos(newPos); proxy->setPos(newPos);
} }
else else
{ {
QGraphicsWidget* parent = qobject_cast<QGraphicsWidg et*>(this->parent()); QGraphicsWidget* parent = qobject_cast<QGraphicsWidg et*>(this->parent());
dialog = new QDialog(NULL); dialog = new QDialog(Q_NULLPTR);
// dialog->setParent(parent); // dialog->setParent(parent);
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getIn stance().getGui()); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getIn stance().getGui());
Q_ASSERT(gui); Q_ASSERT(gui);
//dialog->setAttribute(Qt::WA_OpaquePaintEvent, true ); //dialog->setAttribute(Qt::WA_OpaquePaintEvent, true );
connect(dialog, SIGNAL(rejected()), this, SLOT(close ())); connect(dialog, SIGNAL(rejected()), this, SLOT(close ()));
createDialogContent(); createDialogContent();
dialog->setStyleSheet(gui->getStelStyle().qtStyleShe et); dialog->setStyleSheet(gui->getStelStyle().qtStyleShe et);
// Ensure that tooltip get rendered in red in night mode. // Ensure that tooltip get rendered in red in night mode.
connect(&StelApp::getInstance(), SIGNAL(visionNightM odeChanged(bool)), this, SLOT(updateNightModeProperty())); connect(&StelApp::getInstance(), SIGNAL(visionNightM odeChanged(bool)), this, SLOT(updateNightModeProperty()));
skipping to change at line 165 skipping to change at line 165
{ {
newX=0; newX=0;
newY=0; newY=0;
} }
// resize only if number was valid and larger than d efault loaded size. // resize only if number was valid and larger than d efault loaded size.
if ( (newX>=proxy->size().width()) || (newY>=proxy-> size().height()) ) if ( (newX>=proxy->size().width()) || (newY>=proxy-> size().height()) )
{ {
//qDebug() << confNameSize << ": resize to " << storedSizeString; //qDebug() << confNameSize << ": resize to " << storedSizeString;
proxy->resize(qMax((qreal)newX, proxy->size( ).width()), qMax((qreal)newY, proxy->size().height())); proxy->resize(qMax((qreal)newX, proxy->size( ).width()), qMax((qreal)newY, proxy->size().height()));
} }
handleDialogSizeChanged(proxy->size()); // This may trigger internal updates in subclasses. E.g. LocationPanel location arrow.
// The caching is buggy on all platforms with Qt 4.5 .2 // The caching is buggy on all platforms with Qt 4.5 .2
proxy->setCacheMode(QGraphicsItem::ItemCoordinateCac he); proxy->setCacheMode(QGraphicsItem::ItemCoordinateCac he);
proxy->setZValue(100); proxy->setZValue(100);
StelMainView::getInstance().scene()->setActiveWindow (proxy); StelMainView::getInstance().scene()->setActiveWindow (proxy);
} }
proxy->setFocus(); proxy->setFocus();
} }
else else
 End of changes. 5 change blocks. 
5 lines changed or deleted 6 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/