Sunday, May 29, 2022

Upgrade 03: PyQt6 Desktop App Template

The Desktop App Template has been upgraded to include global variables(for example: username must be stored in a global variable upon successful login), the global variable(username) is displayed permanently at right-most corner of the status bar, I did some minor code refactoring of the main window by adding a separate function for configuring the right sidebar and lastly, I made the side menu bar(treeview) database driven which means the treeview items are stored in a mysql table.

The output is the same as the original screen(from Upgrade 02) with the exception of the username getting displayed permanently at the status bar.


The mysql table definition:

1
2
3
4
5
6
7
8
CREATE TABLE `tbsidebar` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `parent` varchar(25) NOT NULL,
 `node1` int(11) NOT NULL,
 `name` varchar(25) NOT NULL,
 `node_name` varchar(25) NOT NULL,
 PRIMARY KEY (`id`)
 ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1

The code:

Can be downloaded from this github repository: https://github.com/bclme/python_desktop_app_template

No comments:

Post a Comment