Request for move of KHexEdit2 lib etc.
Friedrich W. H. Kossebau
Friedrich.W.H at Kossebau.de
Mon Sep 29 19:09:34 BST 2003
Am Montag, 29. September 2003 19:38 schrieb Adriaan de Groot:
> On Monday 29 September 2003 17:47, Friedrich W. H. Kossebau wrote:
> > please move the according parts of KHexEdit2 from kdenonbeta,
> > like written in the feature plan:
> >
> > __the complete directory "lib" of the widget library itself:
> > from: kdenonbeta/khexedit2/src
> > to: kdeutils/khexedit
>
> KPilot wants to use this widget library as well, if possible. KPilot has
> been instrumented to use it if possible, but if it's in a different and
> non-dependent CVS module, then the dependency gets a little convoluted.
As some thought (well, David F. and Coolo said so in N7Y, and I agreed) that
this widget is a too special one for inclusion in kdelibs, it was decided to
treat it the same way kregexpeditor is treated: making it a runtime
dependency using service types and interfaces. In KPilot you try to create
that service type by (a call delivered in the interface header)
QWidget *BytesEditWidget =
KHE::createBytesEditWidget( this, "BytesEditWidget" );
// was khexedit2 installed, so the widget could be found?
if( BytesEditWidget )
{
and than use it via interfaces:
// fetch the editor interface
KHE::BytesEditInterface *BytesEdit =
KHE::bytesEditInterface( BytesEditWidget );
Q_ASSERT( BytesEdit ); // This should not fail!
// now use the editor.
BytesEdit->setData( Buffer, BufferSize, -1 );
BytesEdit->setMaxDataSize( BufferSize );
BytesEdit->setReadOnly( false );
BytesEdit->setAutoDelete( true );
KHE::HexColumnInterface *HexColumn =
KHE::hexColumnInterface( BytesEditWidget );
if( HexColumn )
{
HexColumn->setCoding( KHE::HexColumnInterface::BinaryCoding );
HexColumn->setByteSpacingWidth( 2 );
HexColumn->setNoOfGroupedBytes( 4 );
HexColumn->setGroupSpacingWidth( 12 );
}
and so on with the already available interfaces.
There are dis-/advantages of course. But it should work for now. If it really
doesn't KDE 4 is close enough to have a perspective ;)
Let's simply try a new concept...
Friedrich
More information about the kde-core-devel
mailing list