mirror of https://github.com/CGAL/cgal
Remove deprecated Qt version checks
This commit is contained in:
parent
926dab060e
commit
1286d8b636
|
|
@ -67,11 +67,7 @@ void GridGraphicsItem::setSpacing(int spacing_)
|
||||||
static inline qreal
|
static inline qreal
|
||||||
horizontalAdvance(const QFontMetrics& fm, const QString& text)
|
horizontalAdvance(const QFontMetrics& fm, const QString& text)
|
||||||
{
|
{
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
|
||||||
return fm.horizontalAdvance(text);
|
return fm.horizontalAdvance(text);
|
||||||
#else
|
|
||||||
return fm.boundingRect(text).width();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GridGraphicsItem::paint(
|
void GridGraphicsItem::paint(
|
||||||
|
|
|
||||||
|
|
@ -478,6 +478,13 @@ public:
|
||||||
qreal bufferTextureMaxU() const { return bufferTextureMaxU_; }
|
qreal bufferTextureMaxU() const { return bufferTextureMaxU_; }
|
||||||
/*! Same as bufferTextureMaxU(), but for the v texture coordinate. */
|
/*! Same as bufferTextureMaxU(), but for the v texture coordinate. */
|
||||||
qreal bufferTextureMaxV() const { return bufferTextureMaxV_; }
|
qreal bufferTextureMaxV() const { return bufferTextureMaxV_; }
|
||||||
|
// These methods are part of the QGLWidget public API.
|
||||||
|
// As of version 2.7.0, the use of QOpenGLWidget instead means that they have
|
||||||
|
// to be provided for backward compatibility.
|
||||||
|
void renderText(int x, int y, const QString &str,
|
||||||
|
const QFont &font = QFont());
|
||||||
|
void renderText(double x, double y, double z, const QString &str,
|
||||||
|
const QFont &font = QFont());
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void copyBufferToTexture(GLint, GLenum = GL_NONE);
|
void copyBufferToTexture(GLint, GLenum = GL_NONE);
|
||||||
|
|
|
||||||
|
|
@ -720,6 +720,28 @@ CGAL_INLINE_FUNCTION
|
||||||
void CGAL::QGLViewer::drawLight(GLenum, qreal ) const {
|
void CGAL::QGLViewer::drawLight(GLenum, qreal ) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGAL_INLINE_FUNCTION
|
||||||
|
void CGAL::QGLViewer::renderText(int x, int y, const QString &str,
|
||||||
|
const QFont &font) {
|
||||||
|
QColor fontColor = QColor(0, 0,
|
||||||
|
0, 255);
|
||||||
|
|
||||||
|
// Render text
|
||||||
|
QPainter painter(this);
|
||||||
|
painter.setPen(fontColor);
|
||||||
|
painter.setFont(font);
|
||||||
|
painter.drawText(x, y, str);
|
||||||
|
painter.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
CGAL_INLINE_FUNCTION
|
||||||
|
void CGAL::QGLViewer::renderText(double x, double y, double z, const QString &str,
|
||||||
|
const QFont &font) {
|
||||||
|
using CGAL::qglviewer::Vec;
|
||||||
|
const Vec proj = camera_->projectedCoordinatesOf(Vec(x, y, z));
|
||||||
|
renderText(int(proj.x), int(proj.y), str, font);
|
||||||
|
}
|
||||||
|
|
||||||
/*! Draws \p text at position \p x, \p y (expressed in screen coordinates
|
/*! Draws \p text at position \p x, \p y (expressed in screen coordinates
|
||||||
pixels, origin in the upper left corner of the widget).
|
pixels, origin in the upper left corner of the widget).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@ int& code_to_call_before_creation_of_QCoreApplication(int& i) {
|
||||||
fmt.setOption(QSurfaceFormat::DebugContext);
|
fmt.setOption(QSurfaceFormat::DebugContext);
|
||||||
QSurfaceFormat::setDefaultFormat(fmt);
|
QSurfaceFormat::setDefaultFormat(fmt);
|
||||||
|
|
||||||
|
// for windows
|
||||||
|
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -663,6 +663,12 @@ void MainWindow::loadPlugins()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QString env_path = qgetenv("LAB_DEMO_PLUGINS_PATH");
|
QString env_path = qgetenv("LAB_DEMO_PLUGINS_PATH");
|
||||||
|
QChar separator = QDir::listSeparator();
|
||||||
|
#if defined(_WIN32)
|
||||||
|
QChar separator = ';';
|
||||||
|
#else
|
||||||
|
QChar separator = ':';
|
||||||
|
#endif
|
||||||
if(!env_path.isEmpty()) {
|
if(!env_path.isEmpty()) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
QString path = qgetenv("PATH");
|
QString path = qgetenv("PATH");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue