Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Full screen QWebEngine without margins?
QtWS25 Last Chance

Full screen QWebEngine without margins?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qwebenginemargins
1 Posts 1 Posters 1.2k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on 25 Oct 2015, 00:20 last edited by
    #1

    I am trying to get QWebEngine to fill the entire window. Per this answer I am trying to use setContentsMargins(0,0,0,0); with the result below: the QWebEngine loads the page at full window size but then immediately scales down to this:

    enter image description here

    When I use setContentsMargins(1,1,1,1); with the QWebEngine in the layout, it loads correctly, with a 1 px margin. I did a test of just loading the image directly, with no margin and it loaded fine and filled the screen.

    Is this my bug/issue or QWebEngine's?


    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QtWebEngineWidgets>
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        QVBoxLayout *mainLayout = new QVBoxLayout;
        mainLayout->setContentsMargins(0,0,0,0);
        ui->centralWidget->setLayout(mainLayout);
    
    //    // load and show image
    //    inputImg = new QImage(":/images/testScreen.jpg");
    //    imgDisplayLabel = new QLabel("");
    //    imgDisplayLabel->setPixmap(QPixmap::fromImage(*inputImg));
    //    imgDisplayLabel->adjustSize();
    //     mainLayout->addWidget(imgDisplayLabel);
    
        view = new QWebEngineView(this);
         mainLayout->addWidget(view);
    
        QUrl url;
        url = QUrl("qrc:/testScreen.html");
        view->load(url);
    }
    
    1 Reply Last reply
    0

    1/1

    25 Oct 2015, 00:20

    • Login

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