Relative Content

Tag Archive for openglwindowqt6

QT OpenGL Trying to set the background of the window to black using QT OpenGL but failing

#include “mainwindow.h” #include “ui_mainwindow.h” #include<opencv2/opencv.hpp> #include <QtOpenGL> #include <QOpenGLFunctions> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::initializeGL() { QOpenGLFunctions asxf; asxf.initializeOpenGLFunctions(); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); } void MainWindow::resizeGL(int w, int h) { glViewport(0, 0, w, h); } void MainWindow::paintGL() { glClear(GL_COLOR_BUFFER_BIT); } I want to use […]