Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
291 changes: 291 additions & 0 deletions FinanceApp/.qtcreator/CMakeLists.txt.user

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions FinanceApp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.19)

project(FinanceApp LANGUAGES CXX)


find_package(Qt6 6.5 REQUIRED COMPONENTS Core Widgets Charts)
find_package(Qt6 6.5 REQUIRED COMPONENTS Core Widgets Charts Sql)

qt_standard_project_setup()

qt_add_executable(FinanceApp
WIN32 MACOSX_BUNDLE
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
transactionwindow.h transactionwindow.cpp transactionwindow.ui
database.cpp
database.h


)

target_link_libraries(FinanceApp
PRIVATE
Qt6::Core
Qt6::Widgets
Qt6::Charts
Qt6::Sql
)

include(GNUInstallDirs)

install(TARGETS FinanceApp
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
6 changes: 6 additions & 0 deletions FinanceApp/Dashboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Run the update_translations CMake target to populate the source strings in this file.
-->
<!DOCTYPE TS>
<TS version="2.1" sourcelanguage="en"/>
Binary file added FinanceApp/Dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions FinanceApp/FIles/FinanceApp/FinanceApp_en_US.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Run the update_translations CMake target to populate the source strings in this file.
-->
<!DOCTYPE TS>
<TS version="2.1" language="en_US" sourcelanguage="en"/>
Binary file added FinanceApp/FIles/FinanceApp/pixabot-f005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions FinanceApp/Finance
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Run the update_translations CMake target to populate the source strings in this file.
-->
<!DOCTYPE TS>
<TS version="2.1" sourcelanguage="en"/>
3 changes: 3 additions & 0 deletions FinanceApp/FinanceApp_en_US.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US"></TS>
Binary file added FinanceApp/FinanceMan.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FinanceApp/QT_Design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FinanceApp/QT_Environmentpng.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions FinanceApp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# FinanceApp

A lightweight personal finance dashboard built with **C++**, **Qt 6**, **Qt Charts**, and **SQLite**. The application provides a graphical dashboard for displaying financial information and organizing transactions by category and tag.

## Description

FinanceApp is a desktop personal finance dashboard created as a contribution for issue #93 of the `All-In-One-Python-Projects` repository.

The project uses Qt Widgets for the graphical user interface and Qt Charts for financial visualization. SQLite is used through Qt's SQL module to provide local database storage.

The application includes:

- A graphical finance dashboard
- Transaction information displayed in a table
- Category and tag information for transactions
- A spending/money-allocation pie chart
- Transaction and deposit interface windows
- Local SQLite database support
- Beginning of database functions for retrieving financial totals

The dashboard was designed to provide a lightweight alternative to larger personal finance applications while keeping the interface simple and easy to understand.

## Prerequisites

The following software is required to build and run FinanceApp:

- C++ compiler
- Qt 6.5 or later
- Qt Widgets
- Qt Charts
- Qt SQL
- SQLite
- CMake 3.19 or later
- Qt Creator (recommended)

## Installing Instructions

1. Clone the repository:

```bash
git clone https://github.com/king04aman/All-In-One-Python-Projects.git
```

2. Open the `FinanceApp` directory in Qt Creator.

3. Configure the project with a Qt 6 kit and CMake.

4. Build the project.

5. Run `FinanceApp`.

The application uses an SQLite database named `finance.db` for local financial data.

## Technologies Used

- **C++** — application logic
- **Qt Widgets** — graphical user interface
- **Qt Charts** — financial data visualization
- **Qt SQL** — database interface
- **SQLite** — local data storage
- **CMake** — project configuration and build system

## Screenshot

"...\All-In-One-Python-Projects\FinanceApp\QT_Design.png"
"...\All-In-One-Python-Projects\FinanceApp\QT_Environmentpng.png"
"...\All-In-One-Python-Projects\FinanceApp\Dashboard.png"



## Author

Joshua Wilson
6 changes: 6 additions & 0 deletions FinanceApp/Tracker/Finance
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Run the update_translations CMake target to populate the source strings in this file.
-->
<!DOCTYPE TS>
<TS version="2.1" sourcelanguage="en"/>
Binary file added FinanceApp/TransactionDashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions FinanceApp/database.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#include "database.h"
#include <QSqlQuery>
#include <QSqlDatabase>
#include <QSqlError>
#include <QDebug>

Database::Database(){
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("finance.db");

if(!db.open()){
qDebug() <<"database failed: " << db.lastError().text();
return;
}
}


void Database::addTransaction(QString category, QString tag, double amount){


}


double Database::getTotal(){
query.exec(
"SELECT SUM(amount) "
"FROM transactions"
);
double total = 0;
if (query.next()) {
total = query.value(0).toDouble();

}
return total;

}

double Database::totalSpending(){
query.exec(
"SELECT SUM(amount) "
"FROM transactions"
);
double total = 0;
if (query.next()) {
total = query.value(0).toDouble();

}
return total;

}
double Database::totalGiving(){
query.exec(
"SELECT SUM(amount) "
"FROM transactions"
);
double total = 0;
if (query.next()) {
total = query.value(0).toDouble();

}
return total;

}
double Database::totalSaving(){
query.exec(
"SELECT SUM(amount) "
"FROM transactions"
);
double total = 0;
if (query.next()) {
total = query.value(0).toDouble();

}
return total;

}


void Database::createTable(){

query.exec(
"CREATE TABLE transactions ("
"id INTEGER PRImary KEY AUTOINCREMENT,"
"category TEXT,"
"tag TEXT,"
"amount REAL"
")"
);
}
23 changes: 23 additions & 0 deletions FinanceApp/database.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef DATABASE_H
#define DATABASE_H
#include <QSqlQuery>
#include <QString>

class Database{
public:
QSqlQuery query;
Database();
void createTable();
void addTransaction(QString category, QString tag, double amount);
double getTotal();
double totalSpending();
double totalGiving();
double totalSaving();

};





#endif // DATABASE_H
Binary file added FinanceApp/f005.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions FinanceApp/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "mainwindow.h"
#include "database.h"

#include <QApplication>
#include <QLocale>
#include <QTranslator>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);



QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "FinanceApp_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
MainWindow w;
w.show();
return QApplication::exec();
}
79 changes: 79 additions & 0 deletions FinanceApp/mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "transactionwindow.h"
#include <QtCharts/QChartView>
#include <QtCharts/QPieSeries>
#include <QtCharts/QChart>
#include <QMovie>
#include <QDebug>
#include <QPixmap>



MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->transactionButton, &QPushButton::clicked, this, &MainWindow::transactionbutton);
//Display:
// Title
QPixmap balanceImage("C:/Users/wilso/CLionProjects/Personal Finance Tracker/Finance Dashboard FIles/FinanceApp/title.png");
ui->giftitle->setPixmap(balanceImage);


//Gif Label
QMovie *movie = new QMovie("C:/Users/wilso/CLionProjects/Personal Finance Tracker/Finance Dashboard FIles/FinanceApp/f005.gif");

ui->giflabel->setMovie(movie);
movie->setScaledSize(QSize(50, 50));
ui->giflabel->setAlignment(Qt::AlignCenter);
ui->giflabel->setMovie(movie);
movie->start();


//Category Table
ui->categories_tableWidget->setRowCount(1);
ui->categories_tableWidget->setColumnCount(3);
ui->categories_tableWidget->setHorizontalHeaderLabels({"Category","Tag", "Amount"});

ui->categories_tableWidget->setItem(0,0, new QTableWidgetItem("Eden's Mission Trip"));
ui->categories_tableWidget->setItem(0,1, new QTableWidgetItem("Giving"));
ui->categories_tableWidget->setItem(0,2, new QTableWidgetItem("$40"));
ui->categories_tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);


//Income Pie Chart
QPieSeries *series = new QPieSeries();

series->append("Spending", 40);
series->append("Giving", 20);
series->append("Saving", 15);

QChart *chart = new QChart();

chart->addSeries(series);
chart->setTitle("Money Allocation");


ui->income_tableView->setChart(chart);
}






//Functions
void MainWindow::transactionbutton(){
transactionwindow *window = new transactionwindow(this);
window->show();
}



MainWindow::~MainWindow()
{
delete ui;
}

30 changes: 30 additions & 0 deletions FinanceApp/mainwindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
Q_OBJECT

public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow() override;

private:
Ui::MainWindow *ui;
private slots:
void transactionbutton();

//void updateChart();
//void updateIncome();
//void updateCategories();

};
#endif // MAINWINDOW_H
Loading