hi Thomas,

sorry, if my question / conditions were too unclear

On 19-12-2010 14:10, Thomas Perl wrote:
> Hi Stef,
>
> 2010/12/19 Stef Mientki <[email protected]>:
>> by double clicking on an image,
>> I can edit my image and put it back into the DOM.
>>
>> But the page I'm viewing is not refreshed.
>>
>> I don't want to reload my page (if that will be successful after all),
>> because my page will scroll away from the point of view.
>>
>> How can I force to rerender the modified image ?
> What are you using? QWebView (based on the mention of "DOM" in your
> post)? Please try to be more specific with your question. What are you
> trying to achieve? Which technologies are you using (PySide? QWebView?
> Something else?)? What is the expected outcome? Do you have some
> example code to demonstrate your problem? Is this a PySide-related
> problem or is it more related to QWebView, and might therefore be
> better suited for QtWebKit?
>
I use PySide QWebView (instance is self.web in the code below).

    * After double clicking on an image,
    * I catch the event,
    * determine what kind of image it is (from the extra tags), (in the code 
below, it's a Latex
      formula),
    * I pop-up an appropriate modal editor, which modifies the images and 
stores the changes in the
      same image file
    * then I store the modified tags in image tag
    * then I want to refresh the rendering of the screen (without reloading, so 
my view doesn't
      scroll away and will be uptodate )

as you can see, in the meanwhile we found a solution that works quiet well :

    * store the filename in the element with an extra "#' at the end
    * clear memory cache
    * store the filename again, without the "#"

anyway thanks for your reply.

cheers,
Stef


          HitTest = self.web.page().currentFrame().hitTestContent(event.pos())
          Object  = unicode(HitTest.imageUrl().toString())
          element = HitTest.element()
          Filename = Object [ 8: ]
          Formula = unicode(element.attribute('alt'))

          ## Here a modal formula editor is launched

          element.setAttribute('src',Filename +'#')
          element.setAttribute('alt',Formula)
          element.webFrame().page().settings().clearMemoryCaches()
          element.setAttribute('src',Filename)

> Thanks,
> Thomas

_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to