Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Help to do my idea



  • Hello, today i test QWebEngine module to make Web Browser, and i would like to make menu similar to the actual gnome 3 menu in the left (similar to Ubuntu style), and when mouse isn't into this menu, this menu disappear.
    But how can i do that ? Is it possible to show picture into WebView, or i need to some other widgets ? What is your advice ?



  • I have doing this, i think i found good way, but i don't have success to fill the WebView to the MainWindow. When i resize manually the window, webview layout isn't updated, how can i do that ? And if you look my commented code, i have tried to show picture on my webview, but picture is white and i have visible rect, but i don't would like to have visible rect, just my picture...

    #include <QApplication>
    #include <QWidget>
    #include <QGraphicsView>
    #include <QGraphicsPixmapItem>
    #include <QWebEngineView>
    
    int main(int argc, char *argv[])
    {
        QApplication application(argc, argv);
    
        QWidget MainWindow;
        MainWindow.showMaximized();
    
        QWebEngineView webview(&MainWindow);
        webview.setUrl(QUrl(QStringLiteral("https://www.google.fr")));
        webview.show();
    
        //QGraphicsView view(&MainWindow);
        //QGraphicsPixmapItem item(QPixmap("Image.png"));
        //view.setGeometry(0,0,60,60);
        //view.show();
    
        return application.exec();
    }
    
    

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    If MainWindow is a QMainWindow subclass then call setCentralWidget.


Log in to reply