From e343f2e819ecf7ae56d8ad4dd64ba873b542f116 Mon Sep 17 00:00:00 2001 From: Daniel Jones <104509116+DanielReddJones@users.noreply.github.com> Date: Fri, 1 Sep 2023 15:52:30 -0500 Subject: [PATCH] set up sqlite func and passed int to determine verse to pull --- mainwindow.cpp | 31 +++++++++++++++++++++++++++---- mainwindow.ui | 11 +++++++---- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index fc4aefc..fb77688 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,15 +1,25 @@ +/*Author: Daniel Jones + *IDE: QT Creator + *Compiler: MinGW + *OS: Windows 10 + *Purpose: QT Widget that displays the verse of the day upon Windows 10 bootup. + * Last edited: 9/1/2023 + */ + #include "mainwindow.h" #include "./ui_mainwindow.h" #include #include -void verse_display(); +QString verse_display(); +std::string sqlite_func(int day); + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); - ui->verse->setText("This is a test."); + ui->verse->setText(verse_display()); } MainWindow::~MainWindow() @@ -26,16 +36,29 @@ int random_verse(){ } //This is the function that will load the verse into the program. -void verse_display() +QString verse_display() { std::string verse_text; int verse_day = random_verse(); - std::cout << verse_day << "\n"; + verse_text = sqlite_func(verse_day); + + + + return "It is receiving text from verse_display()"; +} + + +std::string sqlite_func(int day){ + + std::string my_verse; + + return my_verse; } + void MainWindow::on_exitButton_clicked() { QApplication::quit(); diff --git a/mainwindow.ui b/mainwindow.ui index ba1fb01..a4fd526 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -34,15 +34,18 @@ - 170 - 90 - 49 - 16 + 10 + 20 + 361 + 161 TextLabel + + Qt::AlignCenter +