<commit_before>#include "topologicopenglwidget.h"

#include <QDebug>
#include <QOpenGLContext>

TopologicOpenGLWidget::TopologicOpenGLWidget(QWidget *parent) :
    QGLWidget(parent)
{
}

void TopologicOpenGLWidget::initializeGL()
{
    QOpenGLContext *context = QOpenGLContext::currentContext();
    qDebug() << Q_FUNC_INFO << "context =" << context;

    enum topologic::outputMode out = topologic::outGL;

    int argc = 1;
    char *argv[] = { "topologic-qt", 0 };

    if (!topologic::parseArguments (state, argc, argv, out))
    {
        std::cerr << "badness: parseArguments call failed.\n";
        // badness
    }
}

void TopologicOpenGLWidget::paintGL()
{
    QOpenGLContext *context = QOpenGLContext::currentContext();
    qDebug() << Q_FUNC_INFO << "context =" << context;

    if (state.model)
    {
        std::cerr << "have model\n";
        state.model->opengl(true);
    }
    else
    {
        std::cerr << "no model\n";
    }
}

void TopologicOpenGLWidget::resizeGL(int width, int height)
{
    QOpenGLContext *context = QOpenGLContext::currentContext();
    qDebug() << Q_FUNC_INFO << "context =" << context;

    state.width  = width;
    state.height = height;

    paintGL();
}<commit_msg>it does seem to work with Qt 5.1<commit_after>#include "topologicopenglwidget.h"

#include <QDebug>
#include <QOpenGLContext>

TopologicOpenGLWidget::TopologicOpenGLWidget(QWidget *parent) :
    QGLWidget(parent)
{
}

void TopologicOpenGLWidget::initializeGL()
{
    QOpenGLContext *context = QOpenGLContext::currentContext();
    qDebug() << Q_FUNC_INFO << "context =" << context;

    enum topologic::outputMode out = topologic::outGL;

    int argc = 1;
    char *argv[] = { "topologic-qt", 0 };

    if (!topologic::parseArguments (state, argc, argv, out))
    {
        std::cerr << "badness: parseArguments call failed.\n";
        // badness
    }
}

void TopologicOpenGLWidget::paintGL()
{
    QOpenGLContext *context = QOpenGLContext::currentContext();
    qDebug() << Q_FUNC_INFO << "context =" << context;

    if (state.model)
    {
        std::cerr << "have model\n";
        state.model->opengl(true);
    }
    else
    {
        std::cerr << "no model\n";
    }
}

void TopologicOpenGLWidget::resizeGL(int width, int height)
{
    QOpenGLContext *context = QOpenGLContext::currentContext();
    qDebug() << Q_FUNC_INFO << "context =" << context;

    state.width  = width;
    state.height = height;
}
{'fraction_non_alphanumeric': 0.14714344430743936, 'fraction_numerical': 0.002466091245376079, 'mean_word_length': 3.4825046040515653, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7307677', 'n_tokens_mistral': 843, 'n_tokens_neox': 806, 'n_words': 160}