4

I want my qwebengineview can't scroll to the left/right/up/down.
My situation is like this: Image Image2 It was asked in Qt Fourm first, however I can't find a solution for this.
QT Fourm link: link

Please see the minimum code example code below. It's not the same website but can also show this problem.
I'm using Mac Os 10.15 and Qt 5.13.1.

Update
mainwindow.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWebEngineView>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    QWebEngineView* m_pWebView;
};
#endif // MAINWINDOW_H

mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    this->setFixedSize(920,580);

    m_pWebView = new QWebEngineView(this);
    // Set WebView Size
    m_pWebView->setGeometry(0,0,920,580);
    // Disable Right Click
    m_pWebView->setContextMenuPolicy(Qt::NoContextMenu);
    m_pWebView->load(QUrl("https://clash.razord.top/#/proxies"));
}

MainWindow::~MainWindow()
{
    delete ui;
}

main.cpp

#include "mainwindow.h"

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}
Hhry
  • 823
  • 1
  • 8
  • 19

0 Answers0