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_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
|
||||
|
@ -8,15 +8,13 @@
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "./ui_mainwindow.h"
|
||||
#include <windows.h>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString verse_display();
|
||||
std::string verse_grab(int day);
|
||||
std::string verse_grab();
|
||||
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
@ -33,19 +31,14 @@ 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.
|
||||
QString verse_display()
|
||||
{
|
||||
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);
|
||||
|
||||
@ -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;
|
||||
my_verse = "Hello, this is a verse!";
|
||||
|
||||
return my_verse;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void MainWindow::on_exitButton_clicked()
|
||||
{
|
||||
QApplication::quit();
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>387</width>
|
||||
<height>600</height>
|
||||
<width>404</width>
|
||||
<height>614</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -21,7 +21,7 @@
|
||||
<widget class="QPushButton" name="exitButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<x>160</x>
|
||||
<y>490</y>
|
||||
<width>80</width>
|
||||
<height>24</height>
|
||||
@ -47,13 +47,15 @@
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<zorder>verse</zorder>
|
||||
<zorder>exitButton</zorder>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>387</width>
|
||||
<width>404</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -62,6 +64,7 @@
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionbookmark_verse"/>
|
||||
<addaction name="actionGo_to_bookmarked_verse"/>
|
||||
<addaction name="actionexit"/>
|
||||
</widget>
|
||||
<addaction name="menuDaily_Bread"/>
|
||||
@ -77,6 +80,11 @@
|
||||
<string>exit</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGo_to_bookmarked_verse">
|
||||
<property name="text">
|
||||
<string>Go to bookmarked verse</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
BIN
verses.sqlite
BIN
verses.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user