LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2013, 07:13 AM   #1
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
QT - Spreadsheet like tabular widget


Hi,
I am writing an app in QT and I need to accept user input in the form of a table. The number of columns will be fixed (determined at runtime) however the number of rows (whilst initially can be set to a fixed number) will vary. So the user might want to enter 100 rows or 1000 rows of data, either by pasting in, or typing.
Now I know I can (when pasting) work out how many extra lines there are and add that many rows, however it would be a more flexible solution to have a solution similar to excel where the scrollbar knows whether there is data in later cells and sizes accordingly (i.e. if you have only a few rows populated it gets the look and feel of having just one page however if you have thousands then the scrollbar sizes accordingly).
So I am looking for some form of spreadsheet like widget which would achieve this. Ideally I would like to avoid having to pre-create a large number of blank rows (because it might be the user needs to use several hundred thousand).
I can add a "add rows" button but again this is a bit messy - I want the user not to have to worry about adding additional rows etc.
Does anyone have any suggestions?
 
Old 06-20-2013, 09:39 AM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,200

Rep: Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307
Use a QTableWidget. Or a QAbstractTableModel with a QTableView if a QTableWidget isn't flexible enough.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use XLSperl, xlsgrep.pl, perl-spreadsheet-read, someting else? Calc spreadsheet monsteriname Linux - Software 1 10-24-2012 06:32 AM
system froze when I clicked Save for Calc spreadsheet, now the spreadsheet is gone Stringdude Linux - Newbie 2 11-24-2010 01:05 AM
I got switched from a word process doc. into spreadsheet form. now ALL is spreadsheet 293 manzanita Linux - Newbie 1 08-04-2010 01:14 PM
Showing a widget above a widget in GTK aarontwc Programming 4 11-26-2008 11:40 AM
tabular to xml and back to tabular ebsbel Programming 3 03-14-2007 06:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration