473,320 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How do I save user data in a file and populate the GUI/Software based on that file?

So I'm developing a GUI that consists of many widgets such as checkbox, buttons, radio-buttons, combo-box using Python Qt5. This GUI is to perform some calcualtion based on user choices. I'm trying to figure out how to go about saving all this data in a file and then repopulating those widgets when the user opens the same file.

My research lead me to QSetting class of Qt5 but that only saves the states of widgets.

For Example:

def writeSettings(self):
self.settings = QSettings("Moose Soft", "Clipper")
self.settings.beginGroup("MainWindow")
self.settings.setValue("size", self.size())
self.settings.setValue("pos", self.pos())
self.settings.endGroup()

def readSettings(self):
self.settings = QSettings("Moose Soft", "Clipper")
self.settings.beginGroup("MainWindow")
self.resize(settings.value("size", QSize(400, 400)).toSize())
self.move(settings.value("pos", QPoint(200, 200)).toPoint())
self.settings.endGroup()

But this is not doing what I want (or maybe I'm not aware of some of its functionalities?)

Summary: What I want is to have the user save the file and come back to that file after a while and the file should know which widgets was checked/used and repopulate only those. How do I approach this issue?

By the way, I'm new to GUI design :-/
Apr 26 '19 #1
0 1118

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
3
by: GMane Python | last post by:
Hello All. I have a program that downloads 'gigabytes' of Axis NetCam photos per day. Right now, I set up the process to put the images into a queue, and every 30 or so seconds, 'pop' them from...
2
by: Alexander Heimann | last post by:
I am trying to figure out how to export data out of an access databse to a .txt file to a specified folder a few times a day. the problem i have is a co worker would like to utilize some of the...
4
by: Neil10365 | last post by:
I wonder if someone can help me with a small conundrum I am having. This is what I want to achieve: Scenario -------- Each week, I import an excel spreadsheet called Week1.xls into an access...
1
by: Ryan | last post by:
can i create a link that doesnt open a browser window... a link that executes the aspx.vb code first (code that creates a file) and transfers to an opening of a dynamically created (vcs outlook)...
3
by: Patrick McGuire | last post by:
I am instantiating several custom objects from a subset of data contained in an XML file. I then might edit these objects and save the changes back to the XML file. However, I want to compare the...
2
by: ian.johns | last post by:
How would I have a vb.net app running on a client listen for a particular file download (via it's extension) then execute an old DOS ..exe that processes that type of file?
12
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD...
2
by: phpnoob | last post by:
I have a php script that processes a form and then posts the user input to a data file on the server in a comma delimited format. For simplicity call the file "data.csv." The script is working...
3
by: prashantdixit | last post by:
Hi, I have a form "FormA" which three browse button and texbox control. There two radio buttons at the top with option option1: Auto option2: Manual These option decides how to select a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.