Results 1 to 4 of 4

Thread: How exit FullScreen from videoWidget ? thanks for help

  1. #1
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Smile How exit FullScreen from videoWidget ? thanks for help

    Hello everyone,
    I am playing a video using phonon videoplayer,and call setFullScreen() to enter full screen mode,but how can i exit it ? the mouseEvent isn't work,my videoPlayer is inherit from QWidget.

    Qt Document's Description:
    Warning: When switching to full screen mode using setFullScreen(), the widget onto which the video is rendered is shown as a top-level window. Key event forwarding is handled by VideoWidget, but if you need to handle other events, e.g., mouse events, you should handle fullscreen mode yourself.


    i can't understand what's it mean,and thanks for help.

  2. #2
    Join Date
    Apr 2011
    Location
    Russia
    Posts
    85
    Thanks
    2
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How exit FullScreen from videoWidget ? thanks for help

    the mouseEvent isn't work
    Maybe your vodeoPlayer not in focus. Try set FocusPolicy.

  3. #3
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How exit FullScreen from videoWidget ? thanks for help

    Quote Originally Posted by Jonny174 View Post
    Maybe your vodeoPlayer not in focus. Try set FocusPolicy.
    the widget onto which the video is rendered is shown as a top-level window,maybe your solution is effective.thank you for yuor help.

  4. #4
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How exit FullScreen from videoWidget ? thanks for help

    solution:

    // eventFilter
    bool videoPlayer::eventFilter(QObject *obj, QEvent *event)
    {
    QMouseEvent *mouse = static_cast<QMouseEvent *>(event); // mouseEvent

    if (obj == videoWidget) {

    // double clicked to enter full screen or exit full screen
    if (event->type() == QEvent::MouseButtonDblClick) {
    if(mouse->button() == Qt::LeftButton){
    if(!bFull){ // is not full screen and enter full screen
    videoWidget->enterFullScreen();
    bFull = true;
    }
    else{ // exit full screen
    videoWidget->exitFullScreen();
    bFull = false;
    }

    return true;
    }
    }
    else
    return false;
    }
    else
    return videoPlayer::eventFilter(obj, event);

    }

Similar Threads

  1. cannot exit from fullscreen
    By lazycoder in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2011, 06:38
  2. Overlaying Widgets on top of VideoWidget
    By opsimath in forum Qt Programming
    Replies: 2
    Last Post: 9th June 2011, 13:29
  3. VideoWidget problem
    By baluk in forum Newbie
    Replies: 15
    Last Post: 24th October 2010, 02:32
  4. [MAC OSX] Mousetracking does not work in VideoWidget
    By Markus in forum Qt Programming
    Replies: 0
    Last Post: 1st October 2010, 23:23
  5. Zoom in a Phonon::VideoWidget
    By linus in forum Qt Programming
    Replies: 1
    Last Post: 26th March 2010, 21:13

Tags for this Thread

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.