set up sqlite func and passed int to determine verse to pull
This commit is contained in:
parent
e59f08a746
commit
e343f2e819
@ -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 <iostream>
|
||||
#include <random>
|
||||
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();
|
||||
|
@ -34,15 +34,18 @@
|
||||
<widget class="QLabel" name="verse">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>170</x>
|
||||
<y>90</y>
|
||||
<width>49</width>
|
||||
<height>16</height>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>361</width>
|
||||
<height>161</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
|
Loading…
Reference in New Issue
Block a user