Presentation of a new Khtml project (and Problems with mapToGlobal in LineEditWidget)

Germain Garand germain at ebooksfrance.org
Thu Nov 19 17:49:41 GMT 2009


Le jeudi 19 novembre 2009, Eduardo Robles Elvira a écrit :
> Hello everyone,
>
> I know I've been silent for a while but that doesn't mean I haven't
> been busy working in konqi/khtml. As my final project I'm writing a
> patch for khtml for adding support of GPG encryption in forms, so that
> something like a GPG web client or a GPG web chat can be done (I'll
> prepare a django chat demo too as part of that project). This project
> is not intended to be merged in trunk (though I would love to do so
> hehe). This is project is just a test of what can be done for
> improving the security and functionality of web applications, allowing
> end-to-end encryption so that you don't need to trust the server
> meanwhile using it, so that the user can reclaim the control of the
> data he lost when giving way to web services like Gmail o Gmail chat.
> I'm using Libkleo for dealing with GPG stuff.

that's a neat idea... nice and simple way of building back a polder of 
privacy.

IIUC, you are using just a couple new attributes for this...
do you intend to submit those as a proposal to w3c, once you have worked out 
things?

anyway, down to your practical problem:

[...]
> "drop-down widget". I'm trying to use mapToGlobal(QPoint(0, height()))
> inside khtml::LineEditWidget (rendering/render_form.cpp) as a start
> point to deal with this, but I'm getting (14, 24392), when as you can
> see in [3] it should be more like.. ~ (15, 50). What can be happening
> that is making mapToGlobal go crazy?

most KHTML widgets are positioned off screen, they are painted at their 
visible position but they are not really there. This is how we control their 
stacking order among other rendering objects (cf. z-index CSS property).

I'd love to be able to just overload mapToGlobal and friends, but those aren't 
virtual, so what you need to do instead is some variation of:

    QPoint dest;
    KHTMLView* v = m_kwp->rootViewPos(dest);

within a KHTMLWidget.

|dest| will then contain the widget position, on the canvas of the root 
KHTMLView |v|.

Greetings,
Germain





More information about the kfm-devel mailing list