Results 1 to 12 of 12

Thread: QVideoWidget Fullscreen

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2014
    Posts
    46
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default QVideoWidget Fullscreen

    I want to make my QVideoWidget fullscreen on mouse click and back.
    I've implemented the mouse click and have tried two methods to go fullscreen but both are not working.

    Method 1:
    Qt Code:
    1. w->setWindowState(w->windowState() ^ Qt::WindowFullScreen);
    To copy to clipboard, switch view to plain text mode 
    And to come back
    Qt Code:
    1. w->setWindowState(w->windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
    To copy to clipboard, switch view to plain text mode 

    Nothing happens in this case.

    Method 2: (found after some good internet searching)
    Qt Code:
    1. void mousePressEvent(QMouseEvent*) {
    2. if (maxMode== false)
    3. {
    4. m_enOrigWindowFlags = this->windowFlags();
    5. m_pSize = this->size();
    6. this->setParent(0);
    7. this->setWindowFlags( Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
    8. this->showFullScreen();
    9. maxMode = true;
    10. }
    11. else
    12. {
    13. this->setParent(m_pParent);
    14. this ->resize(m_pSize);
    15. this->overrideWindowFlags(m_enOrigWindowFlags);
    16. this->show();
    17. maxMode = false;
    18. }
    19. }
    20. };
    To copy to clipboard, switch view to plain text mode 
    This method works fine to get to fullscreen. But on the second click the video widget comes in a new window and not on the original position on the Ui.

    Please help me. Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QVideoWidget Fullscreen

    QWidget::showNormal()
    Qt Code:
    1. void mousePressEvent(QMouseEvent*) {
    2. maxMode = !maxMode;
    3. if(maxMode) showFullscreen(); else showNormal();
    4. };
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2014
    Posts
    46
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QVideoWidget Fullscreen

    Nothing happens Sir.
    No change in the widget!

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QVideoWidget Fullscreen

    What exactly did you change? What does the code currently look like?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QVideoWidget on macos blocks application, need help.
    By DavidXanatos in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2016, 19:19
  2. QVideoWidget , QMediaPlayer : missing video frames
    By vee_sivee in forum Qt Programming
    Replies: 0
    Last Post: 27th April 2015, 04:11
  3. Replies: 0
    Last Post: 15th March 2014, 01:19
  4. Replies: 3
    Last Post: 12th July 2011, 22:55
  5. Replies: 0
    Last Post: 8th April 2010, 11:08

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.