mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:56:44 +02:00
remove unused references to QGLWidget* parent in Overlay and Overlays
This commit is contained in:
parent
a89691fc66
commit
d1e648b392
6 changed files with 6 additions and 16 deletions
|
@ -473,7 +473,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
|
|
||||||
checkVersion();
|
checkVersion();
|
||||||
|
|
||||||
_overlays.init(_glWidget); // do this before scripts load
|
_overlays.init(); // do this before scripts load
|
||||||
|
|
||||||
_runningScriptsWidget->setRunningScripts(getRunningScripts());
|
_runningScriptsWidget->setRunningScripts(getRunningScripts());
|
||||||
connect(_runningScriptsWidget, &RunningScriptsWidget::stopScriptName, this, &Application::stopScript);
|
connect(_runningScriptsWidget, &RunningScriptsWidget::stopScriptName, this, &Application::stopScript);
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QStyleOptionTitleBar>
|
#include <QStyleOptionTitleBar>
|
||||||
|
|
||||||
//#include "DependencyManager.h"
|
|
||||||
#include "Application.h"
|
|
||||||
#include "GLCanvas.h"
|
#include "GLCanvas.h"
|
||||||
|
|
||||||
#include "UIUtil.h"
|
#include "UIUtil.h"
|
||||||
|
@ -45,8 +43,6 @@ int UIUtil::getWindowTitleBarHeight(const QWidget* window) {
|
||||||
// this function at all. If you mix both you will end up with inconsistent results
|
// this function at all. If you mix both you will end up with inconsistent results
|
||||||
// across platforms.
|
// across platforms.
|
||||||
void UIUtil::scaleWidgetFontSizes(QWidget* widget) {
|
void UIUtil::scaleWidgetFontSizes(QWidget* widget) {
|
||||||
auto glCanvas = Application::getInstance()->getGLWidget();
|
|
||||||
|
|
||||||
// This is the base dpi that we are targetting. This is based on Mac OSXs default DPI,
|
// This is the base dpi that we are targetting. This is based on Mac OSXs default DPI,
|
||||||
// and is the basis for all font sizes.
|
// and is the basis for all font sizes.
|
||||||
const float BASE_DPI = 72.0f;
|
const float BASE_DPI = 72.0f;
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
|
|
||||||
Overlay::Overlay() :
|
Overlay::Overlay() :
|
||||||
_parent(NULL),
|
|
||||||
_isLoaded(true),
|
_isLoaded(true),
|
||||||
_alpha(DEFAULT_ALPHA),
|
_alpha(DEFAULT_ALPHA),
|
||||||
_glowLevel(0.0f),
|
_glowLevel(0.0f),
|
||||||
|
@ -40,7 +39,6 @@ Overlay::Overlay() :
|
||||||
}
|
}
|
||||||
|
|
||||||
Overlay::Overlay(const Overlay* overlay) :
|
Overlay::Overlay(const Overlay* overlay) :
|
||||||
_parent(NULL),
|
|
||||||
_isLoaded(overlay->_isLoaded),
|
_isLoaded(overlay->_isLoaded),
|
||||||
_alpha(overlay->_alpha),
|
_alpha(overlay->_alpha),
|
||||||
_glowLevel(overlay->_glowLevel),
|
_glowLevel(overlay->_glowLevel),
|
||||||
|
@ -60,8 +58,7 @@ Overlay::Overlay(const Overlay* overlay) :
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Overlay::init(QGLWidget* parent, QScriptEngine* scriptEngine) {
|
void Overlay::init(QScriptEngine* scriptEngine) {
|
||||||
_parent = parent;
|
|
||||||
_scriptEngine = scriptEngine;
|
_scriptEngine = scriptEngine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
Overlay();
|
Overlay();
|
||||||
Overlay(const Overlay* overlay);
|
Overlay(const Overlay* overlay);
|
||||||
~Overlay();
|
~Overlay();
|
||||||
void init(QGLWidget* parent, QScriptEngine* scriptEngine);
|
void init(QScriptEngine* scriptEngine);
|
||||||
virtual void update(float deltatime) {}
|
virtual void update(float deltatime) {}
|
||||||
virtual void render(RenderArgs* args) = 0;
|
virtual void render(RenderArgs* args) = 0;
|
||||||
|
|
||||||
|
@ -85,7 +85,6 @@ public:
|
||||||
protected:
|
protected:
|
||||||
float updatePulse();
|
float updatePulse();
|
||||||
|
|
||||||
QGLWidget* _parent;
|
|
||||||
bool _isLoaded;
|
bool _isLoaded;
|
||||||
float _alpha;
|
float _alpha;
|
||||||
float _glowLevel;
|
float _glowLevel;
|
||||||
|
|
|
@ -58,8 +58,7 @@ Overlays::~Overlays() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Overlays::init(QGLWidget* parent) {
|
void Overlays::init() {
|
||||||
_parent = parent;
|
|
||||||
_scriptEngine = new QScriptEngine();
|
_scriptEngine = new QScriptEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +201,7 @@ unsigned int Overlays::addOverlay(const QString& type, const QScriptValue& prope
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int Overlays::addOverlay(Overlay* overlay) {
|
unsigned int Overlays::addOverlay(Overlay* overlay) {
|
||||||
overlay->init(_parent, _scriptEngine);
|
overlay->init(_scriptEngine);
|
||||||
|
|
||||||
QWriteLocker lock(&_lock);
|
QWriteLocker lock(&_lock);
|
||||||
unsigned int thisID = _nextOverlayID;
|
unsigned int thisID = _nextOverlayID;
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Overlays : public QObject {
|
||||||
public:
|
public:
|
||||||
Overlays();
|
Overlays();
|
||||||
~Overlays();
|
~Overlays();
|
||||||
void init(QGLWidget* parent);
|
void init();
|
||||||
void update(float deltatime);
|
void update(float deltatime);
|
||||||
void renderWorld(bool drawFront, RenderArgs::RenderMode renderMode = RenderArgs::DEFAULT_RENDER_MODE,
|
void renderWorld(bool drawFront, RenderArgs::RenderMode renderMode = RenderArgs::DEFAULT_RENDER_MODE,
|
||||||
RenderArgs::RenderSide renderSide = RenderArgs::MONO);
|
RenderArgs::RenderSide renderSide = RenderArgs::MONO);
|
||||||
|
@ -95,7 +95,6 @@ private:
|
||||||
QMap<unsigned int, Overlay*> _overlaysWorld;
|
QMap<unsigned int, Overlay*> _overlaysWorld;
|
||||||
QList<Overlay*> _overlaysToDelete;
|
QList<Overlay*> _overlaysToDelete;
|
||||||
unsigned int _nextOverlayID;
|
unsigned int _nextOverlayID;
|
||||||
QGLWidget* _parent;
|
|
||||||
QReadWriteLock _lock;
|
QReadWriteLock _lock;
|
||||||
QReadWriteLock _deleteLock;
|
QReadWriteLock _deleteLock;
|
||||||
QScriptEngine* _scriptEngine;
|
QScriptEngine* _scriptEngine;
|
||||||
|
|
Loading…
Reference in a new issue