How do I modify the default application interface?

Stephen Dzurenko dzurenko at arlut.utexas.edu
Tue Oct 29 16:09:17 GMT 2002


Stephen Dzurenko wrote:

> Caleb Tennis wrote:
>
>> On Monday 28 October 2002 08:03 pm, Stephen Dzurenko wrote:
>>  
>>
>>> Hello All,
>>>
>>> I did search the archives and found several other similar questions.
>>> However, for each email there were either no replies or non-helpful
>>> replies.
>>>
>>> I have created a Kdevelop project and written several classes.  After
>>> getting a successful build, I ran my application.  Now I would like to
>>> customize the main window menu.  And this I cannot figure out how to 
>>> do.
>>> Can anyone tell me how to modify the default application interface?
>>>   
>>
>>
>>
>> Is this a KDE application?  Are you using KMainWindow?  If so, there 
>> should be a menuBar() method that returns a pointer to a KMenuBar 
>> that you can modify.
>>
> Not sure on either question.  I assume it's a KDE app.  Whatever one 
> gets by default when one creates a new project is probably what I 
> have. I will check on both these questions this evening. 
> Regardless, it appears to me that you are suggesting I modify the menu 
> bar programmatically.  Is this the preferred method?  Is there not a 
> way to do this via Kdevelop/Qt Designer? 

It appears that I do NOT have a KDE app.  I have not modified the 
generated code yet.  My main application class, SonarApp, inherits from 
QMainWindow.  The SonarApp constructor calls a number of init* methods. 
 Among them is initMenuBar() and initToolBar().

Looking in the initMenuBar method, there is a line that says "EDIT YOUR 
APPLICATION SPECIFIC MENUENTRIES HERE."  So I would assume this is where 
I would make my application-specific additions to the main menu bar.

However, what if I want to remove or change the existing menu entries? 
 It seems silly to "undo" the effects of previous code.  For example, 
the SonarApp class has as members the widgets that make up the edit 
menu.  The initMenuBar method adds the edit menu to the menu bar.  Am I 
supposed to then remove the menu bar 10 lines of code later??

Can't I interactively customize the main menu via KDevelop?  There must 
be a way to toggle the inclusion of menus and change menu and button 
properties.

I haven't used Qt Designer for this project yet.  So I assume all of the 
Qt code was generated by KDevelop.  If I modify the application 
interface via Q Designer, how will the KDevelop code generator pick up 
those changes?  

Thank you again.

-Steve

>
>
> Thanks.
>
> -Steve
>
>>
>> If it's just a Qt Application, look at QMenuBar.
>>
>> If you want to do it via XMLGUI, there is information at 
>> http://developer.kde.org
>>
>> Caleb
>>
>>
>>  
>>
>
>


-- 
--
Stephen Dzurenko
Research Engineer / Scientist Associate

Advanced Sonar Division / Advanced Technology Laboratory

Applied Research Laboratories
The University of Texas at Austin
P.O. Box 8029
Austin, Texas  78713-8029
10000 Burnet Road 78758-4423




-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list