Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Persian
  4. چگونه فیلمی را روی ویجت شفاف شده نمایش بدیم؟
Qt 6.11 is out! See what's new in the release blog

چگونه فیلمی را روی ویجت شفاف شده نمایش بدیم؟

Scheduled Pinned Locked Moved Persian
2 Posts 1 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hdeldar
    wrote on last edited by
    #1

    p{direction:rtl; text-align:right}. در یک برنامه نیاز دارم یک فیلمی را روی یک ویجتی که فلگ Qt::FramelessWindowHint و خصوصیت Qt::WA_TranslucentBackground داره نمایش بدم.هر دوی QVideoWidget و QGraphicsVideoItem را تست کردم ولی در چنین شرایطی تصویر فیلم بدرستی نمایش داده نمیشه و فقط صدای فیلم شینده میشه .بنظرتون مشکل از کجاست ؟ راه حلی بنظرتون نمیاد؟

    @

    #include "videoplayer.h"
    #include <QtWidgets/QApplication>
    #include "qboxlayout.h"
    #include "qvideowidget.h"

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QWidget *w = new QWidget;
    w->setWindowFlags(Qt :: Window | Qt::FramelessWindowHint );
    w->setAttribute(Qt::WA_TranslucentBackground, true);
    w->setMinimumSize(300,200);

    QVideoWidget *videoWidget = new QVideoWidget;
    
    QBoxLayout *controlLayout = new QHBoxLayout;
    controlLayout->setMargin(0);
    controlLayout->addWidget(videoWidget);
    w->setLayout(controlLayout);
    
    QMediaPlayer mediaPlayer;
    mediaPlayer.setVideoOutput(videoWidget);
    mediaPlayer.setMedia(QUrl::fromLocalFile&#40;"C:/1.wmv"&#41;);
    
    videoWidget->show();
    mediaPlayer.play();
    
    w->show();
    return app.exec();
    

    }

    @

    p{direction:rtl; text-align:right}. با حذف دو خط

    @
    w->setWindowFlags(Qt :: Window | Qt::FramelessWindowHint );
    w->setAttribute(Qt::WA_TranslucentBackground, true);
    @

    p{direction:rtl; text-align:right}. فیلم بدرستی نمایش داده میشود.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hdeldar
      wrote on last edited by
      #2

      p{direction:rtl; text-align:right}. حل شد
      در "اینجا":http://qt-project.org/forums/viewthread/42867/ جواب رو قرار دادم

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved