filmov
tv
Pocket Persons — My CS50P final project

Показать описание
Create and store fictional characters using Pocket Persons.
Features
Fully CRUD-capable database. You can view all characters, add a new one, delete one of them, or update their descriptions.
Using this program, you'll encounter three core types of windows: main window, a window for adding a character, and a window for viewing and updating a character.
The main window shows all the characters in the database as a grid of posters, with generic pictures, their names, and a delete button.
When you first launch the program, it creates an empty database for you. Depending on your platform, it is somewhere in the home directory. You can add a character by using "Add Character" button at the very bottom of the window. This'll open up a new window. Specify character name and description and click the button "Add" at the bottom. This'll close the window. Add as many characters as you like and return to the main window.
If you click on one of them, you'll open up a window that shows the character in more detail, and here you can read their description. You can also update it, and no need to hit CTRL+S or any "SAVE" button, changes are saved automatically!
Developing this project
I had no idea on what to make. I thought about a simple command line script that converts video files, but it seemed too simple. Then I remembered that recently I started working on a novel and it'd be nice to have a piece of software where I can put my characters in. I had more ambitions for this project, but learning Qt framework took longer than expected.
Main entry point of my project. Sets up app data folder, opens the main window. It has functions that work with sqlite database and fetch, edit, add characters using SQL and custom data type Character. The main window consists of top bar, characters grid, and control bar. Top bar just welcomes the user. Character grid displays character portrays in a grid with a width of 4, it is also scrollable. Control bar has a single button "Add Character"
This file has a single custom data type class named Character. A Character has id, name, description, and created_at properties.
This is where most of the work went to. 4 custom Qt widgets, each inheriting QtWidgets.QWidget.
CharacterPoster is a vertical and minimal representation of a character. It displays a photo, a name, and a button for deletion.
CharacterDossier is a horizontal widget that displays pretty much all info about a character. It also let's you edit the description.
Characters is a grid of CharacterPoster widgets that supports adding characters and refreshing.
AddCharacter is a widget for adding a character. You input name and description, other fields (id and created_at) are handled automatically.
Module with 2 custom functions to initialize database. It connects to a sqlite3 file and creates characters table if it doesn't exist.
Features
Fully CRUD-capable database. You can view all characters, add a new one, delete one of them, or update their descriptions.
Using this program, you'll encounter three core types of windows: main window, a window for adding a character, and a window for viewing and updating a character.
The main window shows all the characters in the database as a grid of posters, with generic pictures, their names, and a delete button.
When you first launch the program, it creates an empty database for you. Depending on your platform, it is somewhere in the home directory. You can add a character by using "Add Character" button at the very bottom of the window. This'll open up a new window. Specify character name and description and click the button "Add" at the bottom. This'll close the window. Add as many characters as you like and return to the main window.
If you click on one of them, you'll open up a window that shows the character in more detail, and here you can read their description. You can also update it, and no need to hit CTRL+S or any "SAVE" button, changes are saved automatically!
Developing this project
I had no idea on what to make. I thought about a simple command line script that converts video files, but it seemed too simple. Then I remembered that recently I started working on a novel and it'd be nice to have a piece of software where I can put my characters in. I had more ambitions for this project, but learning Qt framework took longer than expected.
Main entry point of my project. Sets up app data folder, opens the main window. It has functions that work with sqlite database and fetch, edit, add characters using SQL and custom data type Character. The main window consists of top bar, characters grid, and control bar. Top bar just welcomes the user. Character grid displays character portrays in a grid with a width of 4, it is also scrollable. Control bar has a single button "Add Character"
This file has a single custom data type class named Character. A Character has id, name, description, and created_at properties.
This is where most of the work went to. 4 custom Qt widgets, each inheriting QtWidgets.QWidget.
CharacterPoster is a vertical and minimal representation of a character. It displays a photo, a name, and a button for deletion.
CharacterDossier is a horizontal widget that displays pretty much all info about a character. It also let's you edit the description.
Characters is a grid of CharacterPoster widgets that supports adding characters and refreshing.
AddCharacter is a widget for adding a character. You input name and description, other fields (id and created_at) are handled automatically.
Module with 2 custom functions to initialize database. It connects to a sqlite3 file and creates characters table if it doesn't exist.