Results 1 to 3 of 3

Thread: multiple interfaces to the screen driver plugin

  1. #1
    Join Date
    Oct 2010
    Posts
    14
    Qt products
    Qt4 Qt/Embedded

    Default multiple interfaces to the screen driver plugin

    I am porting a reading app to an arm-based low refresh rate e-paper device. There is an existing Qt screen driver plugin already had been developed for this platform. A class derived from QLinuxFbScreen provides the screen update services.There are several views implemented in the app and there is a class that eventually calls repaint() and does the drawing inside the paintEvent().

    I have a problem with the refresh on this device. All e-paper screens produce artifacts, so they have to do a special full screen refresh to avoid them. I only want to do this kind of refresh when the full page has been turned in the app. I want to do partial refresh if a hyperlink was highlighted or a small dialog box has been displayed.
    So, do I need to invent fullRepaint() and fullPaintEvent() (by analogy to repaint/paintEvent), derive from QLinuxFbScreen and have a special blit for full refresh? Is there a simple more elegant way?

    I have also posted this questions in another forum, but did not receive any replies so far.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: multiple interfaces to the screen driver plugin

    (by analogy to repaint/paintEvent)
    You probably mean repaint()/update().
    (since repaint() triggers a paintEvent)

    The question is, how the paintEvent() is implemented for this device - that is, how the region to be repainted is calculated.
    Since you are dealing with Qt objects, which I assumer are QWidget descendants, then you might try using update(const QRect & rect ); or update(const QRegion & rgn ); and the repaint() equivalents.
    With those you can specify the region to be updated.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Oct 2010
    Posts
    14
    Qt products
    Qt4 Qt/Embedded

    Default Re: multiple interfaces to the screen driver plugin

    Quote Originally Posted by high_flyer View Post
    You probably mean repaint()/update().
    (since repaint() triggers a paintEvent).
    I meant a pair, a new repaint and a new paintEvent. So if I will call fullRepaint then it will trigger fullPaintEvent, which in turn will trigger a new fullBlit function in the driver plugin which will call a different low level ioctl in order to do a special refresh of the screen.


    Quote Originally Posted by high_flyer View Post
    The question is, how the paintEvent() is implemented for this device - that is, how the region to be repainted is calculated.
    Since you are dealing with Qt objects, which I assumer are QWidget descendants, then you might try using update(const QRect & rect ); or update(const QRegion & rgn ); and the repaint() equivalents.
    With those you can specify the region to be updated.
    Well, if I would use repaint() or any flavour of update() it will in the end call blit on the driver side wich will call a low level partial update routine from the driver.

    In other words I need two different types of repaint to be mapped to two different types of blit in the driver, so my app will trigger the one that is required.

    Yes, my app is QWidget based, but drawing from the the paintEvent will be passed to the driver's blit function that calls partial refresh. I do not have any criteria on how to trigger the full refresh in the driver itslelf, because the trigger for it is the user action -> page turned. I was thinking of checking the size of the rect being updated and if it is large enough then trigger full refresh, but it is unreliable.

    Currently I use QPainter for drawing from the paintEvent. Is it possible to somehow redirect QPainter into a different low level routine?

    Hmm, stumbled upon QPaintEngine class, shouldn't I think of re-implementing it?
    It seams I do not need to change anythng on a widget side, but maybe derive from QPainter. implement a new method similar to drawPixmap which will use the new class derived from QPaintEngine? I think my head is starting to boil at this point .
    Last edited by Dzha; 22nd October 2010 at 16:35.

Similar Threads

  1. Object and multiple inheritance for interfaces
    By brcain in forum Qt Programming
    Replies: 8
    Last Post: 29th June 2021, 15:29
  2. multiple exported interfaces in one plugin - how to?
    By QPlace in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2009, 19:20
  3. Plugin interfaces, signals and slots
    By QPlace in forum Qt Programming
    Replies: 8
    Last Post: 9th August 2007, 21:19
  4. QVariant and Plugin interfaces
    By QPlace in forum Qt Programming
    Replies: 9
    Last Post: 6th August 2007, 00:04
  5. Plugin Interfaces
    By Paul Drummond in forum Qt Programming
    Replies: 1
    Last Post: 27th February 2006, 13:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.