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
1 answer

Connection between from QDialog to QMainWindow - PyQt5

I have created two widgets (QMainWindow as win_one and QDialog as win_two) with qtdesigner and PyQt5. From win_one, I open win_two, fill-in the lineEdit and press OK to transfer the entry into a label displayed in win_one. Everything works well…
H. Dave
  • 549
  • 3
  • 9
  • 26
0
votes
1 answer

Create a QMainWindow in python without frame despite that it is movable and resizable

I want to create a QMainWindow without the frame and the titlebar despite that it is movable and resizable I tried self.setWindowFlags(Qt.FramelessWindowHint)but the it is not movable or floatable.
O. Shehab
  • 31
  • 11
0
votes
1 answer

python - pyqt5: error in show two form, name 'Window' is not defined

Welcome.. i have two form: Form1=>Window & form2 =>MainWindow The problem occurs after pressing the exit button in the main window. Where it is supposed to return to the login window again. form1 (Window for Login) code: import sys from…
Yousef
  • 3
  • 2
0
votes
0 answers

Window spawned from MainWindow doesn't fully close when closing

I have a main window which creates a second window when a button is pressed. I have two problems that occur but for now I will focus on the first one: I cannot get it to completely close the old window when I close it. It closes it visually but the…
Scott
  • 61
  • 2
  • 9
0
votes
1 answer

What should I use instead of QMainWindow if I don't want to use QMainWindow's layout? Where should QMainWindow be preferred?

https://stackoverflow.com/a/13661255/462608 QMainWindow comes with its own layout, you can't set that directly. You probably should be setting your layout on the central widget, or possibly not using a QMainWindow at all if you don't want its…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
0
votes
1 answer

PyQt5 Got stuck with access to another class function

Got stuck with accessing to outer class functions, it'll be great to receive some advice or solution how can i get access to another class method in Python. from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def…
Alex Shaw
  • 13
  • 5
0
votes
0 answers

QMainWindow and docks positioning

I use C++, Qt 4.8.7 for creating GUI application under Windows. I have additional main window as a tab (see an image below). A, B, C, D are dockable widgets. How can I put B widget on the top of C widget? I was able to do it via mouse, but I'd like…
ilya
  • 1,103
  • 14
  • 36
0
votes
1 answer

Access methods from another class PyQt4

I have created 2 new widgets/windows in pyqt, from my my main window. Now I would like to access my methods in mainwindow class to my new widgets. How can I do this? Here is my code: from UI_NewProject import Ui_widget from UI_OpenNew import…
learncode
  • 1,105
  • 4
  • 18
  • 36
0
votes
2 answers

How to start Main Window inside Dialog Window Qt C++

I made the following panel with QDialog Window: I want to, I clicked "OK" button view MainWindow. I wrote the following code but it did not work void QDialog::pushButton_clicked() { MainWindow w; w.show(); }
oğuzhan kaynar
  • 77
  • 1
  • 10
0
votes
0 answers

No closeEvent received by QMainWindows in the QApplication of a subprocess

I have a main QApplication (with a single QMainWindow) which starts a sub-process running another QApplication with several QMainWindows. These QMainWindows save their position and size when closed, as I defined in the closeEvent() method. The…
user3650925
  • 173
  • 1
  • 10
0
votes
0 answers

Python save images and window.show

I am writing a test script. I want to display different bits as a pattern and save these under images. For bits 1 = a0.png For bits 2 = a2.png ... for bits 8 = a8.png My program saves me the pictures from the camera but the window.show is not…
A.D
  • 3
  • 1
  • 1
  • 7
0
votes
2 answers

MainWindow from code from the main.cpp in Qt

Want to understand the difference in code between the MainWindow and the main.cpp. Specifically, how a chunk of code written exclusively in the main.cpp needs to be modified to be part of the mainwindow.cpp and mainwindow.h. As an example, I am…
user6167676
0
votes
1 answer

pyqt4 already has a layout. How to 'detect' it or change?

I'm trying to set a layout manager. But getting the message: QLayout: Attempting to add QLayout "" to Window "", which already has a layout How can I change or detect which type the layout is? I'd like to use the boxlayout as it seems to be…
vandelay
  • 1,965
  • 8
  • 35
  • 52
0
votes
1 answer

PyQt5 set a QLabel x axis automatically center of the window

How can I set x axis of the QLabel the exact center of the window? I have this example from PyQt5.QtWidgets import QMainWindow,QApplication,QLabel from PyQt5 import QtCore import sys class cssden(QMainWindow): def __init__(self): …
GLHF
  • 3,835
  • 10
  • 38
  • 83
0
votes
1 answer

updating value from mainwindow to dialog

I have a mainwindow that generates random int numbers every second in "numbers" and I have a button that opens a new dialog. In that dialog is a button "Get Number" and a qlabel. If I press "Get Number" I want the current generated number from the…
Paul G.
  • 461
  • 6
  • 21