×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    12

    Touch/Click event over QVideoWidget

    Hi!

    I am developing a media player. I want to capture the touch/click event over the video screen to hide/show the controls.

    How is the best way to achieve this? I tried to subclass QVideoWidget, implementing mouseReleaseEvent () , but the method "setVideoOutput" in the player needs a QVideoWidget object and I cannot make it work.

    Any suggestion? thanks!

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Touch/Click event over QVideoWidget

    You can install event filter to the object. However, it's strange that subclassing didn't work for you.

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    12

    Re: Touch/Click event over QVideoWidget

    This is my header file:

    Code:
    #ifndef VIDEOSCREEN_H
    #define VIDEOSCREEN_H
    
    #include <qvideowidget.h>
    #include <qmediaplayer.h>
    
    class VideoScreen : public QVideoWidget
    {
        Q_OBJECT
    public:
        VideoScreen (QMediaPlayer *player, QWidget *parent = 0);
    };
    
    #endif // VIDEOSCREEN_H

    and this is my cpp file:

    Code:
    #include "videoscreen.h"
    
    VideoScreen::VideoScreen (QMediaPlayer *player, QWidget *parent = 0)
            : QVideoWidget(player, parent)
    {
    }
    I create the widget like this:

    Code:
     QMediaPlayer player = new QMediaPlayer;
    VideoScreen video (player);
    , but I get the following errors:

    Code:
    undefined reference to 'VideoScreen::VideoScreen(QMediaPlayer*,QWidget*)'
    I include "videoscreen.h" where I create the widget, so this is not the problem. what could be wrong?

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Touch/Click event over QVideoWidget

    I don't see a constructor with parameters: QMediaPlayer*,QWidget*
    http://doc.qt.nokia.com/qtmobility-1...l#QVideoWidget

  5. #5
    Registered User
    Join Date
    Jan 2011
    Posts
    12

    Re: Touch/Click event over QVideoWidget

    Yes, I have just realized of this. I was following the example in the book "Qt for Symbian", but this constructor doesn't exist... After including QWidget in my file, I have no more errors building.

    And now, it is working and detecting the clicks.

    Thanks!

Similar Threads

  1. Replies: 5
    Last Post: 2009-11-06, 11:13
  2. Mouse click Event
    By abhimanyu1 in forum Symbian
    Replies: 2
    Last Post: 2009-10-09, 08:10
  3. Image click Event in mobiles without touch screen
    By swarna.nokia in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2009-06-16, 14:50
  4. capture inbox click event
    By pamelag in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-10-03, 11:20
  5. Camera Click Event
    By shashideokar10 in forum Symbian
    Replies: 1
    Last Post: 2008-06-10, 09:38

Posting Permissions

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