44 lines
783 B
C++
44 lines
783 B
C++
#include "mainwindow.h"
|
|
#include "./ui_mainwindow.h"
|
|
#include <iostream>
|
|
#include <random>
|
|
void verse_display();
|
|
|
|
MainWindow::MainWindow(QWidget *parent)
|
|
: QMainWindow(parent)
|
|
, ui(new Ui::MainWindow)
|
|
{
|
|
ui->setupUi(this);
|
|
ui->verse->setText("This is a test.");
|
|
}
|
|
|
|
MainWindow::~MainWindow()
|
|
{
|
|
|
|
delete ui;
|
|
}
|
|
|
|
//As name implies, randomly chooses a number between 1 and 100.
|
|
int random_verse(){
|
|
std::random_device rd;
|
|
std:: uniform_int_distribution<int> dist(1, 100);
|
|
return dist(rd);
|
|
}
|
|
|
|
//This is the function that will load the verse into the program.
|
|
void verse_display()
|
|
{
|
|
std::string verse_text;
|
|
int verse_day = random_verse();
|
|
std::cout << verse_day << "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_exitButton_clicked()
|
|
{
|
|
QApplication::quit();
|
|
}
|
|
|