Questions tagged [qmainwindow]

QMainWindow is a class in Qt library that implements the main window of an application.

As a main window for the application, QMainWindow is different from an ordinary widget. It has a menu bar on the top, a status bar, it can also have toolbars and dock widgets.

It also have a so-called Central Widget, which can be occupied by any other widgets.

Qt also allows one to easily implement single- and multiply-document-interfaces with this class.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

516 questions
0
votes
0 answers

How to prevent QMenu from going out of the main window

I have a QMenubar inside QMainWindow. I have set it to be displayed on the right corner using setCornerWidget. But the menu items are going out of the main window. How can I prevent the menu to be displayed within the window? I have already tried…
0
votes
1 answer

Sending Qpixmap from one window to another window

I'm writing a program which has two windows and I want to send a QPixmap image from the first window to the second window. The first window contains one QGraphicsView (FirstView) and one label(Second_View_label) where both will be set to the same…
Sara
  • 169
  • 2
  • 9
0
votes
1 answer

QMainWindow: Minimize to dash board on Ubuntu 18.04

I want to minimize a QMainWindow to an icon on the dash board on the left side of the screen on Ubuntu 18.04. When the "show()" function is called and the QMainWindow is visible I see the icon for my application on the left side dash. However,…
Ankur Shah
  • 125
  • 12
0
votes
1 answer

Error converting pyqt5 to exe: "Failed to execute script"

Error converting pyqt5 to exe: After I convert code created by pyqt5 designer I got "Failed to execute script" # -*- coding: utf-8 -*- import requests from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QMainWindow,…
user12088851
0
votes
1 answer

QMainWindow unexpectedly closes when I print a pandas DataFrame?

Below is a minimal example that reproduces this problem. from PyQt5 import QtWidgets import pandas as pd class PandasGUI(QtWidgets.QMainWindow): def __init__(self): super().__init__() # This ensures there is always a reference…
pyjamas
  • 4,608
  • 5
  • 38
  • 70
0
votes
1 answer

Menubar is not showing on the second window

I am trying to build an application that after getting some user input on the first window, pops up another window and displays some results. However, even though the menubar is visible on the first window, the menubar does not appear on the second…
Edin Guso
  • 31
  • 2
0
votes
1 answer

How to call one mainwindow to another mainwindow in Qt (or PyQt)

In my project i have created two mainwindow i want to call mainwindow2 from the mainwindow1 (which in running). in mainwindow1 i am already used the app.exec_() (PyQt) and to show maindow2 i am using the maindow2.show() in the click event of the…
Arjun Jain
  • 401
  • 1
  • 8
  • 20
0
votes
1 answer

QGraphicsScene, QGraphicsView and QVBoxLayout() problem

Greetings everyone, Every time I run it seems Qt Creator just stop working, when I commented out the line //mainWindow = new MainWindow(); But if the line is not commented out, MainWindow will keep appearing many times. Also to check, is the…
harith00
  • 1
  • 2
0
votes
0 answers

QT QChart getting destroyed when calling from MainWindow class

I am trying to make an application where chart is displayed after click of a button. I am creating chart in the MainWindow class. chart.h class Chart: public QChart { Q_OBJECT public: Chart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags =…
Hesham Ahmad
  • 89
  • 1
  • 1
  • 3
0
votes
0 answers

Opening browser tabs in the same window on QWebEngineView. Referer is not sent. How to configure?

When clicking on any site when clicking on a link with target="_blank" ... In the program, the page opens in the same window, but the Google Analytics counters see such a transition is not correct without a referrer. It seems like a direct approach.…
0
votes
1 answer

Pyqt5 and threading - passing values from external class(method) not working - Attribute Error

I have main class with sub-classes as tabs. I have GUI like this: QApp.py - Mainwindow #!/usr/bin/env python # -*- coding: utf-8 -*- from PyQt5 import QtGui, QtWidgets from QFilesTab import Files from QWebservicesTab import Webservices import…
karolch
  • 184
  • 4
  • 19
0
votes
1 answer

Using classes outside of the main class which is connected to Ui_MainWindow

I need to be able to break up my code into different files so I am trying to understand how to get a separate class to run that will still update the main window. I had code that ran well, but I was editing the setupUi function and I read that…
Amanda.py
  • 113
  • 10
0
votes
0 answers

saveState in destructor of QMainWindow

Is it correct to call saveState method in destructor of QMainWindow? Or should I do it in QMainWindow::closeEvent (as in documentation)? I have problems in some project with saving state from destructor. It seems to me, that in destructor of…
poljak181
  • 585
  • 4
  • 12
0
votes
1 answer

How can I avoid having PyQT5 Central Widget covering up MenuBar?

The central widget in my QMainWindow keeps covering up the QMenuBar I want. How do I avoid this? If I comment out the pushbutton, I can see the menu bar using the code below. from PyQt5 import QtWidgets class Test: def __init__(self): …
Ethan
  • 37
  • 5
0
votes
1 answer

Pyqt5 - Back to hidden MainWindows

I'm making a program to specify a specific area using pyqt5. If I click on the capture button, I will hide the MainWindow and display a screen to specify the area. I want to clear the screen and return to the mainwindow by pressing the esc key. But…
InApple
  • 1
  • 4