[PATCH] KJanusWidget compatibility with QTabWidget

Ravikiran Rajagopal ravi at ee.eng.ohio-state.edu
Thu Nov 21 19:42:03 GMT 2002


Hello,
  Currently, the only way to remove a page from KJanusWidget is to actually 
delete it. This is undesirable for two reasons:

1. The widget may need to be reused. In particular, one may want to switch 
from IconList view or Tab view to TreeList view when the number of pages 
becomes large (primary reason for existence of KJanusWidget). One would then 
want to decouple all pages from the current KJanusWidget, create a new one 
with a different view, and reattach all pages. This is even more important if 
the page widgets are dynamically generated.

2. KJanusWidget essentially provides a nicer QTabWidget, and there is no 
analogue of QTabWidget::removePage() which is extremely useful.

Since the code for removing a page from KJanusWidget already exists in its 
implementation, it is easy to create a new member function. Please see the 
attached diff. My only qualm is in actually making the new removePage() 
function public, but I don't see why not since the widget can be deleted in 
public. This also fixes a crash with Qt >= 3.1 reported earlier. (I am not 
the only person experiencing this crash; Pavel Troller patrol at sinus.cz does 
too.)

Could someone please take a look at this? If this patch is not acceptable, I 
would greatly appreciate an explanation. AFAICS, the patch is binary 
compatible.

Thanks,
Ravi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kjanuswidget.diff
Type: text/x-diff
Size: 3467 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20021121/21c9f380/attachment.diff>


More information about the kde-core-devel mailing list