diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-12-09 08:00:02 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-01-04 14:18:21 (GMT) |
commit | dd72b151b500838475f2ec40695449a37acd3922 (patch) | |
tree | daa27dee60c6cf94bd630d4947b37bdd57cd2ddb /src/opengl | |
parent | 337f75854883fb93e1b4f41e10c79dc7c352f4a6 (diff) | |
download | Qt-dd72b151b500838475f2ec40695449a37acd3922.zip Qt-dd72b151b500838475f2ec40695449a37acd3922.tar.gz Qt-dd72b151b500838475f2ec40695449a37acd3922.tar.bz2 |
Remove Lighthouse specific code in QGLWidget constructor
truth to be told, I can't remember why I decided that it was a good idea
to have the code there. But clearly now I don't think so anymore. Such
initialisation should happen in qgl_qpa.cpp chooseContext.
If we tear down the window and the context then that has to be solved
elsewhere.
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/opengl.pro.user.2.1pre1 | 83 | ||||
-rw-r--r-- | src/opengl/qgl.cpp | 34 | ||||
-rw-r--r-- | src/opengl/qgl_qpa.cpp | 5 |
3 files changed, 83 insertions, 39 deletions
diff --git a/src/opengl/opengl.pro.user.2.1pre1 b/src/opengl/opengl.pro.user.2.1pre1 new file mode 100644 index 0000000..0c38724 --- /dev/null +++ b/src/opengl/opengl.pro.user.2.1pre1 @@ -0,0 +1,83 @@ +<!DOCTYPE QtCreatorProject> +<qtcreator> + <data> + <variable>ProjectExplorer.Project.ActiveTarget</variable> + <value type="int">0</value> + </data> + <data> + <variable>ProjectExplorer.Project.EditorSettings</variable> + <valuemap type="QVariantMap"> + <value key="EditorConfiguration.Codec" type="QByteArray">UTF-8</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.Target.0</variable> + <valuemap type="QVariantMap"> + <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value> + <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value> + <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value> + <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value> + <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap"> + <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap"> + <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value> + <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value> + <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"> + <value type="QString">QMAKE_ABSOLUTE_SOURCE_PATH=/home/jlind/dev/qt/lighthouse-master/src/opengl</value> + </valuelist> + </valuemap> + <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap"> + <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value> + <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value> + <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value> + <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"> + <value type="QString">-j9</value> + </valuelist> + <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value> + </valuemap> + <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value> + <valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap"> + <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value> + <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value> + <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value> + <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"> + <value type="QString">clean</value> + </valuelist> + <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value> + </valuemap> + <value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value> + <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value> + <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/> + <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value> + <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value> + <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jlind/builds/master-lighthouse/src/opengl</value> + <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">23</value> + <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value> + <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value> + </valuemap> + <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">1</value> + <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap"> + <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">headers</value> + <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value> + <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value> + <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/> + <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">../../../../../builds/master-lighthouse/include/QtOpenGL/headers.pri</value> + <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value> + <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value> + <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/> + <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value> + <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value> + <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value> + </valuemap> + <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.TargetCount</variable> + <value type="int">1</value> + </data> + <data> + <variable>ProjectExplorer.Project.Updater.FileVersion</variable> + <value type="int">4</value> + </data> +</qtcreator> diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index e9e8880..dac00dc 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3772,24 +3772,7 @@ QGLWidget::QGLWidget(QWidget *parent, const QGLWidget* shareWidget, Qt::WindowFl setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_NoSystemBackground); setAutoFillBackground(true); // for compatibility -#ifdef Q_WS_QPA - QPlatformWindowFormat platformFormat = QGLFormat::toPlatformWindowFormat(QGLFormat::defaultFormat()); - platformFormat.setUseDefaultSharedContext(false); - if (shareWidget && shareWidget->d_func()->glcx) { - QPlatformGLContext *sharedPlatformContext = shareWidget->d_func()->glcx->d_func()->platformContext; - platformFormat.setSharedContext(sharedPlatformContext); - } - setPlatformWindowFormat(platformFormat); - winId(); // create window; - QGLContext *glContext = 0; - if (platformWindow()) - glContext = QGLContext::fromPlatformGLContext(platformWindow()->glContext()); - if (glContext){ - d->init(glContext,shareWidget); - } -#else d->init(new QGLContext(QGLFormat::defaultFormat(), this), shareWidget); -#endif } @@ -3829,24 +3812,7 @@ QGLWidget::QGLWidget(const QGLFormat &format, QWidget *parent, const QGLWidget* setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_NoSystemBackground); setAutoFillBackground(true); // for compatibility -#ifdef Q_WS_QPA - QPlatformWindowFormat platformFormat = QGLFormat::toPlatformWindowFormat(format); - platformFormat.setUseDefaultSharedContext(false); - if (shareWidget && shareWidget->d_func()->glcx) { - QPlatformGLContext *sharedPlatformContext = shareWidget->d_func()->glcx->d_func()->platformContext; - platformFormat.setSharedContext(sharedPlatformContext); - } - setPlatformWindowFormat(platformFormat); - winId(); // create window; - QGLContext *glContext = 0; - if (platformWindow()) - glContext = QGLContext::fromPlatformGLContext(platformWindow()->glContext()); - if (glContext){ - d->init(glContext,shareWidget); - } -#else d->init(new QGLContext(format, this), shareWidget); -#endif } /*! diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 415e915..52eb57f 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -325,11 +325,6 @@ void QGLWidget::setMouseTracking(bool enable) bool QGLWidget::event(QEvent *e) { Q_D(QGLWidget); - if (e->type() == QEvent::WinIdChange) { - if (platformWindow()) { - d->glcx = QGLContext::fromPlatformGLContext(platformWindow()->glContext()); - } - } return QWidget::event(e); } |