Results 1 to 5 of 5

Thread: Full Screen Double Click?

  1. #1
    Join Date
    Oct 2008
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Full Screen Double Click?

    I've got a Phonon::VideoPlayer which I've subclassed and reimplemented VideoPlayer::mouseDoubleClickEvent. I'm trying to have it enter fullscreen when double clicked, and exit when double clicked. So far, it will enter fullscreen, but then double click doesn't work.

    VideoWindow.h
    Qt Code:
    1. #pragma once
    2. #include <QtGui>
    3. #include <Phonon>
    4.  
    5. class VideoWindow : public Phonon::VideoPlayer
    6. {
    7. Q_OBJECT
    8. public:
    9. VideoWindow(Phonon::Category category, QWidget * parent = 0);
    10.  
    11. protected:
    12. void mouseDoubleClickEvent( QMouseEvent *evt );
    13. };
    To copy to clipboard, switch view to plain text mode 

    VideoWindow.cpp
    Qt Code:
    1. #include "VideoWindow.h"
    2.  
    3. VideoWindow::VideoWindow(Phonon::Category category, QWidget *parent)
    4. : VideoPlayer(category, parent)
    5. {
    6. }
    7.  
    8. void VideoWindow::mouseDoubleClickEvent( QMouseEvent *evt )
    9. {
    10. this->videoWidget()->setFullScreen(
    11. !this->videoWidget()->isFullScreen() );
    12. evt->accept();
    13. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2009
    Location
    The Netherlands and Spain
    Posts
    150
    Thanks
    6
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Full Screen Double Click?

    isFullScreen() returns true if the widget occupies the whole screen.
    To occupy the whole screen, it must not be a child within another widget or MainWindow, I think...
    If VideoWindow is within another widget, maybe you can try to check on parentWidget()->isFullScreen().

    Or you try to make use of windowState().

  3. #3
    Join Date
    Jul 2008
    Posts
    47
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Full Screen Double Click?

    Just have a look into the Media Player example / demo.

    http://doc.trolltech.com/4.5/demos-mediaplayer.html

    There the double click event is used for fullscreen switching.

  4. #4
    Join Date
    Jun 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Maemo/MeeGo

    Default Re: Full Screen Double Click?

    hi
    try this

    void VideoWindow::mouseDoubleClickEvent(QMouseEvent *event)
    {
    if(!fullScreenFlag)
    {
    qDebug() << "already full screen...closing";
    this->showNormal();
    }
    else
    {
    qDebug() << "hi this is custom video player double click";
    this->showFullScreen();
    }

    fullScreenFlag = !fullScreenFlag;
    event->accept();
    }

    'fullScreenFlag' being a boolean entity.

    cheers

    saurabh

  5. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Full Screen Double Click?

    You need to capture the double click event for videowidget, and not videowindow.

Similar Threads

  1. Double Click Capturing
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2011, 14:12
  2. Replies: 2
    Last Post: 11th January 2009, 23:24
  3. Replies: 0
    Last Post: 16th July 2008, 13:15
  4. QGraphicsScene Click / Double Click
    By philentropist in forum Qt Programming
    Replies: 1
    Last Post: 9th February 2007, 04:32
  5. Replies: 5
    Last Post: 12th January 2006, 15:40

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.