Results 1 to 1 of 1

Thread: QWebView problem with flash

  1. #1
    Join Date
    Sep 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QWebView problem with flash

    Hi guys,
    I had written a music player application in C# and I have decided to rewrite it in QT, but I have a huge problem with QWebView (which is similar to WebBrowser in C#). My application uses a flash player from the website. WebBrowser's (C#) WebBrowserProgressChangedEvent sends to me the signal (-1), when the flash player has just finished his job, but QWebView doesn't. In this application I have to know when a current track is finished, to start the next one, so please help me. How can I solve this problem?

    I have attached console diagrams from both applications (they say how WebBrowserProgressChangedEvent (C#) and loadProgress(int) (QT) signals are changing) and QT source code
    C# application
    c#.jpg
    QT application
    QT.jpg

    source code
    MainWindow.h
    Qt Code:
    1. #ifndef MAINWINDOW_H
    2. #define MAINWINDOW_H
    3.  
    4. #include <QtGui/QListWidget>
    5. #include <QtGui/QVBoxLayout>
    6. #include <QtGui/QWidget>
    7. #include <QtWebKit/QWebView>
    8.  
    9. class MainWindow : public QWidget
    10. {
    11. Q_OBJECT
    12.  
    13. public:
    14. explicit MainWindow(QWidget *parent = 0);
    15. ~MainWindow();
    16.  
    17. private:
    18. QVBoxLayout *verticalLayout;
    19. QWebView *webView;
    20. QListWidget *listWidget;
    21.  
    22. void setupUi(QWidget *MainWindow);
    23.  
    24. private slots:
    25. void progressChanged(int progress);
    26. };
    27.  
    28. #endif // MAINWINDOW_H
    To copy to clipboard, switch view to plain text mode 
    MainWindow.cpp
    Qt Code:
    1. #include "MainWindow.h"
    2.  
    3. MainWindow::MainWindow(QWidget *parent) : QWidget(parent)
    4. {
    5. setupUi(this);
    6. connect(webView, SIGNAL(loadProgress(int)), this, SLOT(progressChanged(int)));
    7. }
    8.  
    9. MainWindow::~MainWindow()
    10. {
    11. }
    12.  
    13. void MainWindow::progressChanged(int progress)
    14. {
    15. listWidget->addItem(QString::number(progress));
    16. }
    17.  
    18. void MainWindow::setupUi(QWidget *widget)
    19. {
    20. webView = new QWebView(widget);
    21. webView->setFixedSize(250, 70);
    22. webView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    23. webView->setUrl(QUrl("http://w618.wrzuta.pl/audio.swf?key=aL9BKZ2y9Lb&host=wrzuta.pl&autoplay=y"));
    24.  
    25. listWidget = new QListWidget(widget);
    26.  
    27. verticalLayout = new QVBoxLayout(widget);
    28. verticalLayout->addWidget(webView);
    29. verticalLayout->addWidget(listWidget);
    30.  
    31. widget->setLayout(verticalLayout);
    32. }
    To copy to clipboard, switch view to plain text mode 
    test2.pro
    Qt Code:
    1. QT += webkit
    2.  
    3. TARGET = test2
    4. TEMPLATE = app
    5.  
    6.  
    7. SOURCES += main.cpp\
    8. MainWindow.cpp
    9.  
    10. HEADERS += MainWindow.h
    To copy to clipboard, switch view to plain text mode 
    Last edited by TuBylem; 25th September 2010 at 14:01.

Similar Threads

  1. Problem With QWebView
    By traxtopel in forum Qt Programming
    Replies: 2
    Last Post: 25th February 2010, 18:01
  2. QWebView problem
    By wirasto in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2009, 02:32
  3. Problem With QWebView
    By ivi2501 in forum Qt Programming
    Replies: 8
    Last Post: 2nd August 2009, 19:37
  4. Problem in QWebView
    By navi1084 in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2008, 19:27
  5. QWebView problem with pdf
    By oscar in forum Qt Programming
    Replies: 5
    Last Post: 23rd August 2008, 15:37

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.