Bug 72731 (pvbrowser)
Summary: | QWebHitTestResult and SVG rendering with QWebFrame | ||
---|---|---|---|
Product: | WebKit | Reporter: | pvbrowser <lehrig> |
Component: | WebKit Qt | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, mmaxfield, rniwa |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
URL: | http://pvbrowser.org |
pvbrowser
I want to know which graphical object within a SVG is clicked.
It is done like that:
QWebFrame *wf = ... which i use ...;
QWebHitTestResult result = wf->hitTestContent(QPoint(x,y)); // x,y from mouse event
QWebElement e = result.element();
QRect r = result.boundingRect();
printf("WebKit hitTestResult: xy=%d,%d wh=%d,%d isNull=%d\n", r.x(), r.y(), r.width(), r.height(), e.isNull());
It works on rectangles, circles ...
But not on text. There the QWebElement isNull.
Probably this is because the XML for the text has no width and height attribute as other objects have.
<g
id="MyIdentifier"
inkscape:label="#g5029">
<rect
y="42.362183"
x="467"
height="33"
width="87"
id="rect5009"
style="fill:#999999;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;" />
<text
sodipodi:linespacing="125%"
id="text5016"
y="63.362183"
x="486"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans;"
xml:space="preserve"><tspan
y="63.362183"
x="486"
id="tspan5018"
sodipodi:role="line">MyText</tspan></text>
</g>
If the mouse is clicked above the <rect i can identify "MyIdentifier"
But if the mouse is clicked above <text a NULL element is returned although the result.boundingRect() is correctly returned.
Since there is no width and height attribute on the text the style fontsize etc... should be used.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
Qt Framework Webkit builds are not supported anymore and there is no build bot of these as such as well.
I think this can be marked as "RESOLVED WONTFIX". Thanks!