LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Doesn't Open Menu Bar (https://www.linuxquestions.org/questions/linux-software-2/doesn%27t-open-menu-bar-4175735875/)

bekoikc 04-10-2024 02:21 PM

Doesn't Open Menu Bar
 
Hello guys, today I was coding my own browser (I know it's a simple thing) and the menu bar, which is the basic search engine, isn't showing up on the screen. Only the buttons and the search bar are appearing, but the search engine in the middle isn't showing up. I thought maybe it could be because I'm using Ubuntu, and that's why I came here. Here is my code, guys.
Code:

from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import *

class Browser():

    def __init__(self):

        self.window = QWidget()
        self.window.setWindowTitle("BEKO BROWSER")

        self.layout = QVBoxLayout()
        self.horizontal = QHBoxLayout()

        self.url_bar = QTextEdit()
        self.url_bar.setMaximumHeight(30)

        self.go_btn = QPushButton("Git")
        self.go_btn.setMaximumHeight(30)

        self.back_btn = QPushButton("<")
        self.back_btn.setMaximumHeight(30)

        self.forward_btn = QPushButton(">")
        self.forward_btn.setMaximumHeight(30)

        self.horizontal.addWidget(self.url_bar)
        self.horizontal.addWidget(self.go_btn)
        self.horizontal.addWidget(self.back_btn)
        self.horizontal.addWidget(self.forward_btn)

        self.browser = QWebEngineView()

        self.layout.addLayout(self.horizontal)
        self.layout.addWidget(self.browser)

        self.browser.setUrl(QUrl("http://google.com"))

        self.window.setLayout(self.layout)
        self.window.show()

app = QApplication([])
window = Browser()
app.exec_()

I used Python. I'm waiting for your help, thank you.


All times are GMT -5. The time now is 05:58 AM.