【问题标题】:QWebView has glitchy graphics when loading animated gifs加载动画 gif 时 QWebView 有故障图形
【发布时间】:2013-11-30 17:23:43
【问题描述】:

这是一个 SSCCE:

test.pro

QT += core gui network webkitwidgets widgets

TEMPLATE = app
TARGET = test
INCLUDEPATH += .

CONFIG += c++11

SOURCES += test.cpp
HEADERS += test.hpp

test.hpp

#include <QMainWindow>
#include <QWebView>

class Window : public QMainWindow {
  Q_OBJECT

public:
  Window();

private:
  QWebView* m_web;

private slots:
};

test.cpp

#include <QApplication>
#include <QGridLayout>

#include "test.hpp"

Window::Window() :
    QMainWindow() {
  auto* w = new QWidget(this);
  setCentralWidget(w);

  auto* layout = new QGridLayout(centralWidget());
  m_web = new QWebView(this);
  layout->addWidget(m_web, 0, 0, 1, 3);

  m_web->load(QUrl("http://www.hampsterdance.com/classics/originaldance.htm"));
}

int main(int argc, char *argv[]) {
  QApplication a(argc, argv);

  Window w;
  w.show();

  return a.exec();
}

编译说明:

qmake test.pro
make
./test

结果

问题

我的问题是:是否有解决方法或强制 QWebView 不显示这些乱码图形?在这个例子中我做错了吗?这是一个已知的错误/问题吗?

环境

使用 g++ 4.8.1 和 Qt 5.0.2 在 Linux x64 和使用 g++ 4.8.1 和 Qt 5.1.1 的 Windows XP 下测试和重现。

【问题讨论】:

    标签: c++ qt qt5 qwebview


    【解决方案1】:

    这是一个bug in Qt,您可以通过将版本更新到至少 5.2 来修复它。

    很遗憾,5.2 还没有完全发布,所以我不得不更新到 5.2-rc1

    【讨论】:

      猜你喜欢
      • 2015-03-20
      • 1970-01-01
      • 2016-05-24
      • 2011-08-15
      • 2014-08-27
      • 1970-01-01
      • 2022-09-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多