Interactive Mandelbrot viewer with Qt and OpenGL.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

41 lines
848 B

#include <QVBoxLayout>
#include <QSlider>
#include <iostream>
#include "../headers/MainWindow.h"
MainWindow::MainWindow() {
buildUI();
}
void MainWindow::buildUI() {
resize(700, 700);
auto iterationsSlider = new QSlider(Qt::Horizontal);
iterationsSlider->setRange(5, 300);
QSlider::connect(
iterationsSlider,
&QSlider::valueChanged,
this->outputWidget->getMandelbrot(),
&Mandelbrot::setIterations
);
QSlider::connect(
iterationsSlider,
&QSlider::valueChanged,
this,
&MainWindow::iterationsSliderChanged
);
iterationsSlider->setValue(100);
auto controls = new QGridLayout;
controls->addWidget(iterationsSlider);
auto lyt = new QVBoxLayout(this);
lyt->addWidget(outputWidget);
lyt->addLayout(controls);
}
void MainWindow::iterationsSliderChanged(int newValue) {
//TODO update text label
update();
}