PDA

View Full Version : Design opinions needed



scott_hollen
22nd February 2011, 19:29
Afternoon all (at least it's afternoon here)

I have a question for the designers out there -- not worried so much about the coding specifics right yet...I'm needing to do the following:

1) Prompt user for entering new data or retrieving a set of data from a database
2) Assuming new data, then I need to prompt for

a) A unique identifier for this data

b) Number of sets of data for this identifier

c) Number of rows of data per set

e) The actual data

For example, there's a large group of data with it's own name called FLOWPATH, which consists of, say, 3 sets of data, each with it's own unique name (FLOWPATH_1, FLOWPATH_2, FLOWPATH_3), and then each set has, say 5 rows of data with 8 data elements per row.

I've tried a couple of different iterations with Designer to handle all of this but I'm not happy with anything I've done. I've been looking for dialog examples of anything similar but again, not with much luck. Has anyone ever done anything similar and if so do you have widget/layout recommendations?

The DB table design consists of a primary key (the initial name) in a parent table along with the number of data sets and number of rows per set, then the child table holds 2 indexes, one for the data set and one for the row of data within the set along with the data items, so I thought I could leverage that with maybe a combo box...

Any suggestions welcomed!

scott

ChrisW67
23rd February 2011, 02:09
So you have an arbitrary number of data sets in each of an arbitrary number of groups. You need to be able to add and name groups and data sets within groups. When a data set is selected you to display/edit that set. This sounds like a shallow tree (QTreeWidget) to me with a few buttons to add new groups, or data sets within groups.

I'd be inclined to use a QTableView on the data table to display and/or edit the data through a QSqlTableModel. Place it in a splitter beside the tree and other controls and change the filter as the user selects data sets.

scott_hollen
23rd February 2011, 12:14
A lot more concise, yes -- two sets of arbitrary numbers...To help illustrate this a bit more, the data is currently being read in from a flat file (we're wanting to get it from my new app instead), and this is the way it's written in the file:

3
Flowpath_1
4
6.5 8 .....
6.5 5.2 ...
6.4 1...
8.0 9...
Flowpath_2
4
6.5 4 .....
3 5.2 ...
4 1...
8.0 9...
Flowpath_3
4
6.5 8 .....
6.5 5.2 ...
6.4 1...
8.0 9...

Right now the program we're using is just working down the file so the "3" is telling it how many sets follow, and the "4" is rows per set (and is fixed so that all sets will have 4 rows)...The number of items per row, if it helps any, is static at 7...The "3" and the "4" are arbitrary...

QSqlTableModel/QTableViews is what I was trying to make work (that's how I'm allowing an Admin user modify user privileges), but it wasn't coming out the way I wanted (probably due to my lack of experience)...I went that way because of editing existing data, but I wanted a little more control over the actual input...It had crossed my mind to maybe after taking the two arbitrary numbers as inputs to using them to generate a spreadsheet (which, in theory is what this is)...My example above would be 12 rows by 8 columns (column one with Flowpath_1/2/3, prepopulated)...

Hadn't thought about a QTreeWidget...I can see how that has possibilities, too...


scott

BalaQT
23rd February 2011, 12:59
I'd be inclined to use a QTableView on the data table to display and/or edit the data through a QSqlTableModel. Place it in a splitter beside the tree and other controls and change the filter as the user selects data sets.
I also try the same as chris said.

Bala

scott_hollen
23rd February 2011, 16:45
Yea -- I've been sitting here at my other job (ssshhhhhh) thinking about this, and I think ya'll are right...

I think I'm in over my head :)

ChrisW67
23rd February 2011, 22:15
Is the flat text file the desired end result of entering data into a blank structure through your program, or the source of data that needs to be loaded, edited, and replaced by your program?

scott_hollen
24th February 2011, 00:44
Well, that's a good question...The flat file is being created right now manually, but what we're trying to do is take that data from the user via the Qt app, store it in the database, and have a C++ app that is currently using the flat file retrieve the data from the database instead...The user needs to be able to create a new set of data in a blank structure, or pull back a previously saved set of data and modify it before the hit GO and kick off the C++ app (which we'd be incorporating)...

The other option is to have the new Qt app generate a flat file and have the C++ app work as it currently does, but we haven't gotten that far...


scott

ps -- I have 2 other data sets to deal with too; the 2nd set is very, very similar to this one and the 3rd is more spreadsheet-like