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.

42 lines
848 B

#include <QVBoxLayout>
#include <QSlider>
#include <iostream>
#include "../headers/MainWindow.h"
3 years ago
MainWindow::MainWindow() {
buildUI();
}
void MainWindow::buildUI() {
3 years ago
resize(700, 700);
3 years ago
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;
3 years ago
controls->addWidget(iterationsSlider);
3 years ago
auto lyt = new QVBoxLayout(this);
lyt->addWidget(outputWidget);
lyt->addLayout(controls);
}
3 years ago
void MainWindow::iterationsSliderChanged(int newValue) {
//TODO update text label
update();
}