StelDialog.hpp   StelDialog.hpp 
skipping to change at line 77 skipping to change at line 77
//! - \ref connectIntProperty to connect a StelProperty to a QSpinBox or QC omboBox //! - \ref connectIntProperty to connect a StelProperty to a QSpinBox or QC omboBox
//! - \ref connectDoubleProperty to connect a StelProperty to a QDoubleSpin Box or QSlider //! - \ref connectDoubleProperty to connect a StelProperty to a QDoubleSpin Box or QSlider
//! - \ref connectBoolProperty to connect a StelProperty to a QAbstractButt on (includes QCheckBox) //! - \ref connectBoolProperty to connect a StelProperty to a QAbstractButt on (includes QCheckBox)
//! Take care that a valid property name is used and it represents a proper ty that can be converted to //! Take care that a valid property name is used and it represents a proper ty that can be converted to
//! the required data type, or the program will crash at runtime when the f unction is called //! the required data type, or the program will crash at runtime when the f unction is called
class StelDialog : public QObject class StelDialog : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visible Changed) Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visible Changed)
public: public:
StelDialog(QString dialogName="Default", QObject* parent=NULL); StelDialog(QString dialogName="Default", QObject* parent=Q_NULLPTR);
virtual ~StelDialog(); virtual ~StelDialog();
//! Returns true if the dialog contents have been constructed and ar e currently shown //! Returns true if the dialog contents have been constructed and ar e currently shown
bool visible() const; bool visible() const;
public slots: public slots:
//! Retranslate the content of the dialog. //! Retranslate the content of the dialog.
//! Needs to be connected to StelApp::languageChanged(). //! Needs to be connected to StelApp::languageChanged().
//! At the very least, if the window is //! At the very least, if the window is
//! <a href="http://doc.qt.nokia.com/stable/designer-using-a-ui-file .html"> //! <a href="http://doc.qt.nokia.com/stable/designer-using-a-ui-file .html">
skipping to change at line 102 skipping to change at line 102
//! ui->retranslateUi(dialog); //! ui->retranslateUi(dialog);
//! \endcode //! \endcode
virtual void retranslate() = 0; virtual void retranslate() = 0;
//! On the first call with "true" populates the window contents. //! On the first call with "true" populates the window contents.
void setVisible(bool); void setVisible(bool);
//! Closes the window (the window widget is not deleted, just not vi sible). //! Closes the window (the window widget is not deleted, just not vi sible).
void close(); void close();
//! Adds dialog location to config.ini; should be connected in creat eDialogContent() //! Adds dialog location to config.ini; should be connected in creat eDialogContent()
void handleMovedTo(QPoint newPos); void handleMovedTo(QPoint newPos);
//! Stores dialog sizes into config.ini; should be connected from th e proxy. //! Stores dialog sizes into config.ini; should be connected from th e proxy.
void handleDialogSizeChanged(QSizeF size); //! When a subclass needs a size-dependent update, implement such up
date in the subclass version,
//! but call StelDialog::handleDialogSizeChanged() first.
virtual void handleDialogSizeChanged(QSizeF size);
QString getDialogName(){return dialogName;} QString getDialogName(){return dialogName;}
signals: signals:
void visibleChanged(bool); void visibleChanged(bool);
protected: protected:
//! Initialize the dialog widgets and connect the signals/slots. //! Initialize the dialog widgets and connect the signals/slots.
virtual void createDialogContent()=0; virtual void createDialogContent()=0;
//! Helper function to connect a checkbox to the StelAction with the specified name //! Helper function to connect a checkbox to the StelAction with the specified name
static void connectCheckBox(QAbstractButton* checkBox,const QString& actionName); static void connectCheckBox(QAbstractButton* checkBox,const QString& actionName);
skipping to change at line 160 skipping to change at line 162
static void connectBoolProperty(QAbstractButton* checkBox, const QSt ring& propName); static void connectBoolProperty(QAbstractButton* checkBox, const QSt ring& propName);
//! The main dialog //! The main dialog
QWidget* dialog; QWidget* dialog;
class CustomProxy* proxy; class CustomProxy* proxy;
//! The name should be set in derived classes' constructors and can be used to store and retrieve the panel locations. //! The name should be set in derived classes' constructors and can be used to store and retrieve the panel locations.
QString dialogName; QString dialogName;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
//! Kinetic scrolling for lists. //! Kinetic scrolling for lists.
//! @note This has been temporarily disabled (since 0.13.2) due to a bug in Qt.
void installKineticScrolling(QList<QWidget *> addscroll); void installKineticScrolling(QList<QWidget *> addscroll);
#endif #endif
private slots: private slots:
void updateNightModeProperty(); void updateNightModeProperty();
}; };
class CustomProxy : public QGraphicsProxyWidget class CustomProxy : public QGraphicsProxyWidget
{ private: { private:
Q_OBJECT Q_OBJECT
public: public:
CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlag s = 0) : QGraphicsProxyWidget(parent, wFlags) CustomProxy(QGraphicsItem *parent = Q_NULLPTR, Qt::WindowFla gs wFlags = 0) : QGraphicsProxyWidget(parent, wFlags)
{ {
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::StrongFocus);
} }
//! Reimplement this method to add windows decorations. Curr ently there are invisible 2 px decorations //! Reimplement this method to add windows decorations. Curr ently there are invisible 2 px decorations
void paintWindowFrame(QPainter*, const QStyleOptionGraphicsI tem*, QWidget*) void paintWindowFrame(QPainter*, const QStyleOptionGraphicsI tem*, QWidget*)
{ {
/* QStyleOptionTitleBar bar; /* QStyleOptionTitleBar bar;
initStyleOption(&bar); initStyleOption(&bar);
bar.subControls = QStyle::SC_TitleBarCloseButton; bar.subControls = QStyle::SC_TitleBarCloseButton;
qWarning() << style()->subControlRect(QStyle::CC_Tit leBar, &bar, QStyle::SC_TitleBarCloseButton); qWarning() << style()->subControlRect(QStyle::CC_Tit leBar, &bar, QStyle::SC_TitleBarCloseButton);
 End of changes. 4 change blocks. 
3 lines changed or deleted 7 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/