Commit c5791512 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Qt5 compat fixes.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18905 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 42d59c76
......@@ -43,14 +43,7 @@
#ifndef BASEINTERFACE_HH
#define BASEINTERFACE_HH
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
#include <QtPlugin>
#include <OpenFlipper/common/Types.hh>
#include "WhatsThisGenerator.hh"
......
......@@ -51,7 +51,7 @@
#include <OpenFlipper/common/Types.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QGLWidget>
//#include <QGLWidget>
#include <../ObjectTypes/TriangleMesh/TriangleMesh.hh>
#include <../ObjectTypes/PolyMesh/PolyMesh.hh>
......
......@@ -71,6 +71,7 @@
#include <QMessageBox>
#include <QFile>
#include <QSettings>
#include <QGLFormat>
#include <QPluginLoader>
#include "OpenFlipper/BasePlugin/BaseInterface.hh"
......
......@@ -228,7 +228,7 @@ bool LicenseManager::authenticate() {
if ( (currentMac.count(":") == 5) &&
( pCurrAddresses->IfType == IF_TYPE_IEEE80211 || pCurrAddresses->IfType == IF_TYPE_ETHERNET_CSMACD ) ) {
// Cleanup and remember mac adress
currentMac = currentMac.toAscii().toUpper();
currentMac = currentMac.toUtf8().toUpper();
currentMac = currentMac.remove(":");
macHashes.push_back(currentMac);
}
......@@ -262,7 +262,7 @@ bool LicenseManager::authenticate() {
}
// Cleanup mac adress
QString currentMac = netInterface.hardwareAddress().toAscii().toUpper();
QString currentMac = netInterface.hardwareAddress().toUtf8().toUpper();
currentMac = currentMac.remove(":");
macHashes.push_back(currentMac);
......@@ -276,7 +276,7 @@ bool LicenseManager::authenticate() {
// generate hashes
for (int i = 0 ; i < macHashes.size(); ++i )
macHashes[i] = QCryptographicHash::hash ( macHashes[i].toAscii() , QCryptographicHash::Sha1 ).toHex();
macHashes[i] = QCryptographicHash::hash ( macHashes[i].toUtf8() , QCryptographicHash::Sha1 ).toHex();
// ===============================================================================================
// Compute hash of processor information
......@@ -327,7 +327,7 @@ bool LicenseManager::authenticate() {
}
#endif
QString cpuHash = QCryptographicHash::hash ( processor.toAscii() , QCryptographicHash::Sha1 ).toHex();
QString cpuHash = QCryptographicHash::hash ( processor.toUtf8() , QCryptographicHash::Sha1 ).toHex();
// ===============================================================================================
// Get windows product id
......@@ -342,7 +342,7 @@ bool LicenseManager::authenticate() {
QString productId = "-";
#endif
QString productHash = QCryptographicHash::hash ( productId.toAscii() , QCryptographicHash::Sha1 ).toHex();
QString productHash = QCryptographicHash::hash ( productId.toUtf8() , QCryptographicHash::Sha1 ).toHex();
// ===============================================================================================
// Check License or generate request
......@@ -370,7 +370,7 @@ bool LicenseManager::authenticate() {
for ( int i = 1 ; i < elements.size(); ++i )
license += elements[i];
license += saltPost;
QString licenseHash = QCryptographicHash::hash ( license.toAscii() , QCryptographicHash::Sha1 ).toHex();
QString licenseHash = QCryptographicHash::hash ( license.toUtf8() , QCryptographicHash::Sha1 ).toHex();
bool signatureOk = licenseHash == elements[0];
// Check expiry date
......@@ -433,7 +433,7 @@ bool LicenseManager::authenticate() {
authstring_ += macHashes[i] +"\n";
QString keyRequest = saltPre + pluginFileName() + coreHash + pluginHash + cpuHash + productHash + macHashes.join("") + saltPost;
QString requestSig = QCryptographicHash::hash ( keyRequest.toAscii() , QCryptographicHash::Sha1 ).toHex();
QString requestSig = QCryptographicHash::hash ( keyRequest.toUtf8() , QCryptographicHash::Sha1 ).toHex();
authstring_ += requestSig + "\n";
authenticated_ = false;
......
......@@ -48,6 +48,8 @@
#include <QtGui>
#endif
#include <QMessageBox>
#include "keygenWidget.hh"
#include <iostream>
......@@ -74,7 +76,7 @@ QString KeyGen::computeSignature() const {
QString keyRequest = saltPre + name + coreHash + pluginHash + cpuHash
+ productHash + macHashes.join("") + saltPost;
QString requestSigCheck =
QCryptographicHash::hash(keyRequest.toAscii(),
QCryptographicHash::hash(keyRequest.toUtf8(),
QCryptographicHash::Sha1).toHex();
return requestSigCheck;
......@@ -94,7 +96,7 @@ QString KeyGen::Generate(QString expiryDate) const
ADD_SALT_POST(saltPost);
QString keyRequest = saltPre + name + coreHash + pluginHash + cpuHash + productHash + macHashes.join("") + saltPost;
QString requestSigCheck = QCryptographicHash::hash ( keyRequest.toAscii() , QCryptographicHash::Sha1 ).toHex();
QString requestSigCheck = QCryptographicHash::hash ( keyRequest.toUtf8() , QCryptographicHash::Sha1 ).toHex();
if ( requestSig != requestSigCheck ){
return "ERROR";
......@@ -112,7 +114,7 @@ QString KeyGen::Generate(QString expiryDate) const
license_ += macHashes.join("\n") + "\n";
QString licenseTmp = saltPre + expiryDate + name + coreHash + pluginHash + cpuHash + productHash + macHashes.join("") + saltPost;
QString licenseHash = QCryptographicHash::hash ( licenseTmp.toAscii() , QCryptographicHash::Sha1 ).toHex();
QString licenseHash = QCryptographicHash::hash ( licenseTmp.toUtf8() , QCryptographicHash::Sha1 ).toHex();
// Prepend signature
license_ = licenseHash + "\n" + license_;
......
......@@ -45,6 +45,7 @@
// Mainwindow
#include "OpenFlipper/Core/Core.hh"
#include "common/glew_wrappers.hh"
// Qt
#include <QApplication>
......@@ -78,7 +79,6 @@
#include <omp.h>
#endif
/* ==========================================================
*
* Stackwalker code. Used to get a backtrace if OpenFlipper
......@@ -458,12 +458,7 @@ int main(int argc, char **argv)
w->init();
#ifndef __APPLE__
GLenum err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
}
initGlew();
#endif
for ( int i = 0 ; i < args.FileCount(); ++i )
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 18440 $ *
* $LastChangedBy: moebius $ *
* $Date: 2014-04-08 08:26:27 +0200 (Tue, 08 Apr 2014) $ *
* *
\*===========================================================================*/
#include <GL/glew.h>
#include <stdio.h>
void initGlew() {
GLenum err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
}
}
const char *getGlewVersion() {
return (const char *)glewGetString(GLEW_VERSION);
}
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 18440 $ *
* $LastChangedBy: moebius $ *
* $Date: 2014-04-08 08:26:27 +0200 (Tue, 08 Apr 2014) $ *
* *
\*===========================================================================*/
#ifndef GLEW_WRAPPERS_HH_
#define GLEW_WRAPPERS_HH_
void initGlew();
const char *getGlewVersion();
#endif /* GLEW_WRAPPERS_HH_ */
......@@ -52,6 +52,7 @@
//== INCLUDES =================================================================
#include <common/glew_wrappers.hh>
#include "CoreWidget.hh"
#include <OpenFlipper/common/FileTypes.hh>
......@@ -604,7 +605,7 @@ void CoreWidget::showAboutWidget( ) {
aboutWidget_->OpenFlipperAbout->append(tr("GLEW Specific Info:"));
aboutWidget_->OpenFlipperAbout->setCurrentFont(standardFont);
QString glewVersion = QString((const char *)glewGetString(GLEW_VERSION));
QString glewVersion = QString(getGlewVersion());
aboutWidget_->OpenFlipperAbout->append(tr("GLEW Version:\t") + glewVersion);
#endif
......
......@@ -72,6 +72,7 @@
// -------------------- Qt event Includes
#include <QEvent>
#include <QWhatsThisClickedEvent>
#include <QGLFormat>
#define WIDGET_HEIGHT 800
#define WIDGET_WIDTH 800
......
......@@ -69,6 +69,28 @@
#include <string>
#include <cassert>
#include <QGLFormat>
#include <QBoxLayout>
#include <QtNetwork/QUdpSocket>
#include <QWheelEvent>
#include <QDropEvent>
#include <QContextMenuEvent>
#include <QDragEnterEvent>
#include <QMouseEvent>
#include <QAction>
#include <QKeyEvent>
#include <QSize>
#include <QMap>
#include <QString>
#include <QMenu>
#include <QToolBar>
#include <QTime>
#include <QTimer>
#include <QGraphicsWidget>
#include <QGraphicsSceneDragDropEvent>
#include <QPropertyAnimation>
#include <QOpenGLFramebufferObject>
#include <QMimeData>
#include <QToolButton>
#include <QFrame>
......@@ -110,13 +132,7 @@
#include <QImageWriter>
#if QT_VERSION < 0x050000
#include <QGLFramebufferObject>
#else // QT_VERSION > 0x050000
#undef QT_NO_OPENGL
#include <QOpenGLFramebufferObject>
#define QT_NO_OPENGL
#endif //QT_VERSION < 0x050000
#include <QGLFramebufferObject>
#ifdef max
# undef max
......@@ -707,10 +723,10 @@ void glViewer::drawScene()
// =================================================================================
// unbind vbo for qt log window
glBindBuffer(GL_ARRAY_BUFFER, 0);
ACG::GLState::bindBuffer(GL_ARRAY_BUFFER, 0);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);
ACG::GLState::activeTexture(GL_TEXTURE0);
ACG::GLState::bindTexture(GL_TEXTURE_2D, 0);
// fbo.release();
//
......@@ -2470,24 +2486,6 @@ void glViewer::strafeRight() {
}
void glViewer::readBackBuffer(ACG::GLState* _glstate)
{
GLint curFbo = 0;
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &curFbo);
ACG::GLState::bindFramebuffer(GL_READ_FRAMEBUFFER, curFbo);
ACG::GLState::bindFramebuffer(GL_DRAW_FRAMEBUFFER, readBackFbo_.getFboID());
glBlitFramebuffer(0, 0, readBackFbo_.width(), readBackFbo_.height(),
0, 0, readBackFbo_.width(), readBackFbo_.height(),
GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST);
checkGLError();
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER, curFbo);
}
void glViewer::updatePostProcessingBufs(int _width, int _height)
{
ACG::FBO* fbos[] = {postProcessFBO_, postProcessFBO_ + 1, &readBackFbo_};
......
......@@ -65,42 +65,25 @@
#include <ACG/ShaderUtils/GLSLShader.hh>
#include <ACG/GL/globjects.hh>
#undef QT_NO_OPENGL
#include <QGLFormat>
#define QT_NO_OPENGL
#include <QBoxLayout>
#include <QtNetwork/QUdpSocket>
#include <QWheelEvent>
#include <QDropEvent>
#include <QContextMenuEvent>
#include <QDragEnterEvent>
#include <QMouseEvent>
#include <QAction>
#include <QKeyEvent>
#include <QSize>
#include <QMap>
#include <QString>
#include <QMenu>
#include <QToolBar>
#include <QTime>
#include <QTimer>
#include <QGraphicsWidget>
#include <QGraphicsSceneDragDropEvent>
#include <QPropertyAnimation>
#include <vector>
#include <string>
#include <limits>
#include <QGraphicsWidget>
#include <QTimer>
#include <QMouseEvent>
#include <QTime>
//== FORWARDDECLARATIONS ======================================================
class QPushButton;
class QToolButton;
class QSplitter;
class QTimer;
class QImage;
class QSocketNotifier;
class QPropertyAnimation;
class QGLWidget;
struct PostProcessorInput;
......
......@@ -53,6 +53,7 @@
//== INCLUDES =================================================================
#include "QtBaseViewer.hh"
#include <QPropertyAnimation>
//== NAMESPACES ===============================================================
......
......@@ -57,12 +57,10 @@
#include "QtGLGraphicsView.hh"
#if QT_VERSION < 0x050000
#include <QGLFramebufferObject>
#else // QT_VERSION > 0x050000
#undef QT_NO_OPENGL
#include <QOpenGLFramebufferObject>
#define QT_NO_OPENGL
#endif //QT_VERSION < 0x050000
#include <QGLFramebufferObject>
#else
#include <QOpenGLFramebufferObject>
#endif
//== NAMESPACES ===============================================================
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 18692 $ *
* $LastChangedBy: moeller $ *
* $Date: 2014-05-21 15:31:54 +0200 (Wed, 21 May 2014) $ *
* *
\*===========================================================================*/
#include <GL/glew.h>
#include <ACG/GL/GLError.hh>
#include "QtBaseViewer.hh"
/**
* @file The intention of this file is to split QtBaseViewer up into two
* compile units, one including glew.h and one including Qt. This is
* necessary as glew and Qt5 conflict.
*/
void glViewer::readBackBuffer(ACG::GLState* _glstate)
{
GLint curFbo = 0;
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &curFbo);
ACG::GLState::bindFramebuffer(GL_READ_FRAMEBUFFER, curFbo);
ACG::GLState::bindFramebuffer(GL_DRAW_FRAMEBUFFER, readBackFbo_.getFboID());
glBlitFramebuffer(0, 0, readBackFbo_.width(), readBackFbo_.height(),
0, 0, readBackFbo_.width(), readBackFbo_.height(),
GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST);
checkGLError();
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER, curFbo);
}
......@@ -51,6 +51,7 @@
//== INCLUDES =================================================================
#include <GL/glew.h>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include "QtGLGraphicsScene.hh"
#include "QtMultiViewLayout.hh"
......
......@@ -51,6 +51,7 @@
//== INCLUDES =================================================================
#include <GL/glew.h>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
......
......@@ -55,9 +55,7 @@
#include <OpenFlipper/common/ViewerProperties.hh>
#include <OpenFlipper/common/GlobalDefines.hh>
#include <QGraphicsView>
#undef QT_NO_OPENGL
#include <QGLFormat>
#define QT_NO_OPENGL
......
......@@ -54,6 +54,8 @@
#include <OpenFlipper/common/RendererInfo.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QMenu>
PostProcessorDialog::PostProcessorDialog(QWidget *_parent)
: QDialog(_parent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment