More coding standard stuff

This commit is contained in:
Brad Davis 2015-04-22 20:16:41 -07:00
parent 44efcdf82a
commit eab4ad9ea9
5 changed files with 11 additions and 6 deletions

View file

@ -20,7 +20,7 @@ class AddressBarDialog : public OffscreenQmlDialog
QML_DIALOG_DECL
public:
AddressBarDialog(QQuickItem* parent = 0);
AddressBarDialog(QQuickItem* parent = nullptr);
protected:
void displayAddressOfflineMessage();

View file

@ -25,9 +25,9 @@ class LoginDialog : public OffscreenQmlDialog
public:
static void toggleAction();
LoginDialog(QQuickItem* parent = 0);
LoginDialog(QQuickItem* parent = nullptr);
void setStatusText(const QString& a);
void setStatusText(const QString& statusText);
QString statusText() const;
QString rootUrl() const;

View file

@ -14,5 +14,5 @@ OffscreenQmlDialog::OffscreenQmlDialog(QQuickItem* parent)
: QQuickItem(parent) { }
void OffscreenQmlDialog::hide() {
((QQuickItem*)parent())->setEnabled(false);
static_cast<QQuickItem*>(parent())->setEnabled(false);
}

View file

@ -47,7 +47,7 @@ class OffscreenQmlDialog : public QQuickItem
{
Q_OBJECT
public:
OffscreenQmlDialog(QQuickItem* parent = 0);
OffscreenQmlDialog(QQuickItem* parent = nullptr);
protected:
void hide();

View file

@ -14,6 +14,11 @@
#include <QGLWidget>
#include <QtQml>
// Time between receiving a request to render the offscreen UI actually triggering
// the render. Could possibly be increased depending on the framerate we expect to
// achieve.
static const int SMALL_INTERVAL = 5;
class OffscreenUiRoot : public QQuickItem {
Q_OBJECT
public:
@ -76,7 +81,7 @@ void OffscreenUi::create(QOpenGLContext* shareContext) {
// When Quick says there is a need to render, we will not render immediately. Instead,
// a timer with a small interval is used to get better performance.
_updateTimer.setSingleShot(true);
_updateTimer.setInterval(5);
_updateTimer.setInterval(SMALL_INTERVAL);
connect(&_updateTimer, &QTimer::timeout, this, &OffscreenUi::updateQuick);
// Now hook up the signals. For simplicy we don't differentiate between