×

Discussion Board

Results 1 to 6 of 6

Hybrid View

  1. #1
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    6

    QVideoWidget & own view finder

    Is it possible to overlay graphics on top of QVideoWidget? (I'm using QVideoWidget with QCamera and would like to add graphics to Camera's view finder.)

    I tried to inherit own class from QVideoWidget and override paintEvent() method:

    void OwnVideoWidget:aintEvent(QPaintEvent * ev)
    {
    QVideoWidget:aintEvent( ev );
    QPainter painter(this);
    painter.setPen(Qt::blue);
    painter.setFont(QFont("Arial", 30));
    painter.drawText(rect(), Qt::AlignCenter, "Qt");
    }
    But this does not work (S60 5.x platform). Do you have any ideas how to achieve this kind of functionality?

    Thanks, Veikko

  2. #2
    Registered User
    Join Date
    Dec 2008
    Posts
    6

    Re: QVideoWidget & own view finder

    any news about this one?

  3. #3
    Registered User
    Join Date
    Nov 2010
    Posts
    32

    Re: QVideoWidget & own view finder

    This applies to Symbian^3 only:

    Create a top-level-widget (i.e. widget without a parent).
    You cannot add that to the layout of your application, but at least it should be visible as long as it's on top of the viewfinder in z-order (e.g. you can call raise() for it to be sure it's on top).
    Last edited by witsku; 2011-03-14 at 11:31.

  4. #4
    Registered User
    Join Date
    Feb 2009
    Posts
    1

    Re: QVideoWidget & own view finder

    I tried to derive a class from QCameraViewfinder to add some overlay (like VEIKKO99) in PaintEvent, it does work in Qt Simulator on PC (draws stuff on image) but doesn't work on real Meego device, the graphics only blinks for a split of second and then the image preview is shown. It seems that the device somehow moves video data directly from camera to the display and thus showing image over anything that was drawn.

    I also tried to create a QLabel without a parent and raise() it to the top of the Z-indexed items as witsku suggested, but the result is the same - the image is shown, the label isn't.

    I was also thinking about capturing single frames from camera to QImage in a timer and drawing on top of them like suggested here http://discussion.forum.nokia.com/fo...-using-QCamera, but I'm getting only black images. I'm not sure if I'm doing it correctly, because the original code from the forum thread had this:
    m_camera = new QCamera;
    m_videoWidget= new QVideoWidget(m_camera);
    but I tried to use it in a different manner, because the QVideoWidget in the constructor accepts QWidget * parent, and the QCamera isn't derived from QWidget., so I tried this instead:
    videoWidget = new QVideoWidget();
    camera->setViewfinder(videoWidget);
    Hoping that the setViewfinder(...) will redirect the stream to that videoWidget and the videoWidget thus be able to render() the image to QImage... But it didn't....

    Could you please give me some hints which way to go, or where did I go wrong? I'm using Qt Mobility 1.1.
    Best regards,
    Miro

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    4

    Re: QVideoWidget & own view finder

    Does anyone have a solution how to draw on top of QCameraViewfinder on the device?
    I tried few things, without any success so for. The only thing that I get visible is the viewfinder.
    thanks,
    Vesa

  6. #6
    Registered User
    Join Date
    Nov 2010
    Posts
    32

    Re: QVideoWidget & own view finder

    Sorry nohajmi, my reply was for Symbian^3 only.
    I'll add that to my comment as well to avoid any more confusion...

Similar Threads

  1. Replies: 0
    Last Post: 2010-02-16, 12:21
  2. Replies: 4
    Last Post: 2009-11-30, 15:18
  3. Replies: 3
    Last Post: 2009-11-27, 07:42
  4. Camera view finder
    By Karliski in forum Symbian
    Replies: 1
    Last Post: 2007-07-07, 21:59
  5. Replies: 2
    Last Post: 2004-08-04, 09:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •