From kde-devel Sun Dec 12 23:34:13 1999 From: Christian Esken Date: Sun, 12 Dec 1999 23:34:13 +0000 To: kde-devel Subject: KDataDisplay (was: Re: Grid for displaying database results) X-MARC-Message: https://marc.info/?l=kde-devel&m=94504049609707 On Fre, 26 Nov 1999 Tim Colgate wrote: > Hi, > > I need to work with a database and want to display results of queries in > a grid. I would also like to be able to edit data in the grid and write > it back to the database. Are there any grid controls in QT/KDE that > allow: arbitrary number of rows and columns, editing of data in cells, > sorting of rows by (double-)clicking on column headers, dynamically > resizing numbers of rows/columns? > > If such a control doesn't currently exist, is anyone working on one? If > not, any suggestions as to the best starting point? I've had a look at > KTreeList which has some useful features (e.g. the sorting), but doesn't > look easy to turn into an editable grid. QTableView however is rather > limited. Am I missing something? I am currently doing the KDataDisplay widget. It's in very early stage. Currently it is able to show data of type strings and numbers. There are other datatypes like date, datetime and time, but showing them on the screen is not supported yet. On the other hand all data types support NULL values - you REALLY want this when dealing with databases. Database connectivity is still lacking. But you can add rows and columns on the fly and retrieve the item values like this: --- cut here --- int rowNum = kdd->insertRow(0); // Insert a row at the end, returning the new row number kdd->setItem(rowNum, "name", "Konqy") QString personName; personName = kdd->getItemString(rowNum, "name"); // 1 is the row number // Now is personName == "Konqy" --- cut here --- KDataDisplay is much more flexible than a simple grid. You can place the data items in any way you like, additionaly you can add static texts, lines, rectangles. There are additional gimmicks like header and footer, which are always shown. Unfortunately editing is not supported yet. :-| Actually KDataDisplay is a report generator. After adding "editing" support, it might turn out to be very useful. BTW: it is in kdenonbeta/kdd. I can send you a small screenshot (<8KB), if you like Christian -- Is Unix ready for the desktop? See http://www.kde.org The Christian Esken |/ Desktop KDE Developer |\ Environment esken@kde.org KDE - The net transparent free Unix Desktop for everyone