Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEngineView inside of QWidget
QtWS25 Last Chance

QWebEngineView inside of QWidget

Scheduled Pinned Locked Moved QtWebEngine
qtwidgetsqtwebengine
2 Posts 1 Posters 2.9k Views
  • 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.
  • D Offline
    D Offline
    Delta
    wrote on 15 Jul 2015, 01:08 last edited by
    #1

    Hey Qt Community,

    I was trying to create a QWebEngineView inside of an custom QWidget,
    and simply add it to it's layout.

    But for some reason, it won't update properly.

    If I add the QWebEngineView directly into a QMainWindow, everything wors fine.

    Am I missing something in custom QWidgets class?

    Example code:

    class WWebBrowser : public QWidget
    {
    	 Q_OBJECT
    public:
    	WWebBrowser(QWidget *parent = (QWidget *)NULL);
    	virtual ~WWebBrowser();
    };
    
    ///
    
    WWebBrowser::WWebBrowser(QWidget *parent) : QWidget(parent)
    {
    	QVBoxLayout *l = new QVBoxLayout();
    
    	QWebEngineView *m_webView = new QWebEngineView(parent);
    	m_webView->load(QUrl("http://www.google.com"));
    	l->addWidget(m_webView, 1);
    
    	setLayout(l);
    	m_webView->show();
    }
    
    WWebBrowser::~WWebBrowser()
    {
    }
    

    Any suggestions / ideas?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Delta
      wrote on 18 Jul 2015, 00:49 last edited by
      #2

      Well, it was caused by a QGraphicsEffect on the QWidget.
      After removing it, the QWebEngineView worked without any flaws. weird.

      1 Reply Last reply
      0

      2/2

      18 Jul 2015, 00:49

      • Login

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