Question about setting up document within Kdevelop's MDI project

JJoopy at aol.com JJoopy at aol.com
Wed May 10 03:50:50 BST 2000


Please don't let the AOL address fool you all.  I have recently moved south 
to San Antonio, TX and am waiting for my cable modem to be installed.  AOL 
was simply free basic access until then.

Anyway, I think I understand pretty well the whole document / view model that 
Kdevelop provides.  The view consists of the methods used to manipulate the 
document and I assume it also consists of the application GUI surrounding the 
document.  The document is just that.  The area that contains your data.  Now 
I admit when I first read that I first thought of a paper document.  But I 
think that the document could consist of any set of widgets to hold your data 
however you see fit.  Do I understand the basics correctly?  Now I have read 
through the initial code generated by Kdevelop and think I have a basic grasp 
of it all.  For my project my document needs to consist of a KListView widget 
to contain my data.  So I have included klistview.h in myappdoc.h and in this 
same file I did a KListView *mylistview under the protect section of the 
header file toward the bottom.  Then I went into the myappdoc.cpp file and 
found the newdocument() function where there was a comment telling me to put 
my init stuff here.  This is where I did a mylistview = new KListView(param1, 
param2).  This is where my problem is.  I know from looking at the 
constructor of KListView that the first param is basically what window to 
stuff this listview into.  I have tried a number of things and the only thing 
that works is if I code a KListView(0, 0).  The result is really as I would 
expect.  When I run the app I get my main window so I click on file->new and 
along with my new doc within the main app MDI window i get another window 
outside of the main app window that contains the listview.  I have read more 
about C than C++ so this is a working while i learn sort of thing.  It seems 
that the listview needs to be given a parent related to the document class 
since that is what I am setting up but as I said everything I've stuck in 
that first param causes an error to the effect that my mylistview = new 
klistview(?,?) doesn't match up to any known functions.

So have I lost everybody?  Have I asked another newbie stupid question?  
Sorry if the answer to either of those two is yes.  Otherwise, could anyone 
offer a kind word or two of advice on what to stick in for the first param?  
Or if I have missed the boat on my understanding could someone help clear me 
up?  If you need more info I will do my best.  Thank you for any and all 
help.  I have many an idea I would like to code in KDE as after evaluating 
KDE and gnome and gtk I have decided to focus all my devel efforts in KDE.  
And I have a lot of grand plans / ideas / dreams that I would like to code 
for KDE.  So you could consider this helping a child get off to a good start. 
 Thanks again.

--Jason




More information about the KDevelop mailing list