Compare commits
9 Commits
master
...
windows_ve
Author | SHA1 | Date | |
---|---|---|---|
|
bb97304508 | ||
|
25badb424d | ||
|
8a283a1034 | ||
|
7b1359c1e7 | ||
|
2d2c59a2f1 | ||
|
5668857327 | ||
|
5f10105990 | ||
|
89778cea08 | ||
|
08d97563fb |
@ -6,7 +6,7 @@ set(CMAKE_AUTOUIC ON)
|
|||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
|
||||||
|
@ -8,15 +8,13 @@
|
|||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "./ui_mainwindow.h"
|
#include "./ui_mainwindow.h"
|
||||||
|
#include <windows.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <random>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QString verse_display();
|
QString verse_display();
|
||||||
std::string verse_grab(int day);
|
std::string verse_grab();
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
@ -33,19 +31,14 @@ MainWindow::~MainWindow()
|
|||||||
delete ui;
|
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.
|
//This is the function that will load the verse into the program.
|
||||||
QString verse_display()
|
QString verse_display()
|
||||||
{
|
{
|
||||||
std::string verse_text;
|
std::string verse_text;
|
||||||
int verse_day = random_verse();
|
|
||||||
verse_text = verse_grab(verse_day);
|
verse_text = verse_grab();
|
||||||
|
|
||||||
QString returned_string = QString::fromStdString(verse_text);
|
QString returned_string = QString::fromStdString(verse_text);
|
||||||
|
|
||||||
@ -53,17 +46,23 @@ QString verse_display()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string verse_grab(int day){
|
std::string verse_grab(){
|
||||||
|
|
||||||
|
//Windows way of getting current month and time.
|
||||||
|
SYSTEMTIME st = {0};
|
||||||
|
GetLocalTime(&st);
|
||||||
|
int cur_day = st.wDay;
|
||||||
|
int cur_month = st.wMonth;
|
||||||
|
|
||||||
|
std::string my_query = "select ";
|
||||||
std::string my_verse;
|
std::string my_verse;
|
||||||
my_verse = "Hello, this is a verse!";
|
|
||||||
return my_verse;
|
return my_verse;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_exitButton_clicked()
|
void MainWindow::on_exitButton_clicked()
|
||||||
{
|
{
|
||||||
QApplication::quit();
|
QApplication::quit();
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>387</width>
|
<width>404</width>
|
||||||
<height>600</height>
|
<height>614</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<widget class="QPushButton" name="exitButton">
|
<widget class="QPushButton" name="exitButton">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>150</x>
|
<x>160</x>
|
||||||
<y>490</y>
|
<y>490</y>
|
||||||
<width>80</width>
|
<width>80</width>
|
||||||
<height>24</height>
|
<height>24</height>
|
||||||
@ -47,13 +47,15 @@
|
|||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<zorder>verse</zorder>
|
||||||
|
<zorder>exitButton</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menubar">
|
<widget class="QMenuBar" name="menubar">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>387</width>
|
<width>404</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -62,6 +64,7 @@
|
|||||||
<string>File</string>
|
<string>File</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionbookmark_verse"/>
|
<addaction name="actionbookmark_verse"/>
|
||||||
|
<addaction name="actionGo_to_bookmarked_verse"/>
|
||||||
<addaction name="actionexit"/>
|
<addaction name="actionexit"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuDaily_Bread"/>
|
<addaction name="menuDaily_Bread"/>
|
||||||
@ -77,6 +80,11 @@
|
|||||||
<string>exit</string>
|
<string>exit</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionGo_to_bookmarked_verse">
|
||||||
|
<property name="text">
|
||||||
|
<string>Go to bookmarked verse</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
BIN
verses.sqlite
BIN
verses.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user