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

QMainWindow does not show Qwidgets background

I have a problem regarding a QWidget (custom made) inside a QMainWindow (custom made). My problem is that when I add my widget to my window as its central widget using setCentralWidget() method, it won't show the widgets background. It's important…
Kian Ahrabian
  • 911
  • 2
  • 8
  • 20
0
votes
1 answer

Wider line in QGraphicScene on MainWindow::resizeEvent

In a window I've got a QGraphicScene. Inside this QGraphicScene I draw some lines (see the first picture). My bug is that when I resize the window the code below is called to fit the scene in the view. void GoBobMainWindow::resizeEvent(QResizeEvent…
Armand
  • 726
  • 11
  • 29
0
votes
1 answer

PyQt4: Where can you make menus?

I'm using Python 3 and PyQt4 I'm trying to make a simple main window with a menubar. It doesn't work if I try to set up the menubar in the MainWindow initialization but does work if I set it up in some external function. That is, the following does…
ehudson
  • 205
  • 3
  • 6
0
votes
1 answer

PyQt : Manage two MainWindow

i'm trying to manage two MainWindow (MainWindow & AccessWindow) with PyQt for my RFID ACCESS CONTROL Project. I want to show the first MainWindow all time (Endless Loop). Then, i want to hide it and show the second MainWindow when the RFID Reader…
0
votes
1 answer

How Can I put a QMdiSubWindow into a QMdiArea QMainWindow?

I'm new in pyqt. I want to do an application with a Qmainwindow with its menubar and menu items. when I click in some menu item A QMdiSubWindow should appear into the qmdiarea, How can I do that? this is my qmainwindow code: class…
GSandro_Strongs
  • 773
  • 3
  • 11
  • 24
0
votes
1 answer

QMainwindow doesn't show when I clicked a qpushbutton into a QWidget

I have a QWidget (login form) and QMainWindow(main form). the problem is when I clicked a qpushbutton into the qwidget the QmainWindow should appear, but It doesn't. class Ui_frmInicial(QWidget): def __init__(self): …
GSandro_Strongs
  • 773
  • 3
  • 11
  • 24
0
votes
1 answer

Force QMainWindow to fit exact size of shown Text

I try to build a frameless window with a single text label with changing text depending on chosen language and a boarder around it. This window should always have the smallest possible size. Here's the simple code without any configurations I tried…
Rappit
  • 11
  • 4
0
votes
2 answers

How to resize the main window again after setFixedSize()?

I would like to resize the MainWindow (QMainWindow) after I make some widgets unvisible and vice versa. And I want to block the window resize. def hideAndShowWidget(self): self.widgetObject.setVisible(not self.widgetObject.isVisible() ) …
Igor
  • 358
  • 3
  • 6
  • 14
0
votes
0 answers

How to save QMenu settings to external config file and how to reapply them later

The code below saves, reads and re-applies the config settings on every application's start and exit. Aside from the main window's size I want to be able to save the QMenu state as well. from PyQt4.QtCore import * from PyQt4.QtGui import * class…
alphanumeric
  • 17,967
  • 64
  • 244
  • 392
0
votes
1 answer

PyQT application - where to hold data that is then processed by other widgets?

I'm writing an application using PyQt4 to analyze data as it acquired from our data acquisition software. The application will consist of a few widgets: a widget to display what files have been imported (and what data channels are in those files);…
dan_g
  • 2,712
  • 5
  • 25
  • 44
0
votes
0 answers

pyQT4 statusbar setpalette (python3)

A little question about the statusbar() of QMainWindow in pyQT4 Is it possible to set a palette for a statusbar() ? So far I have one working very well but I'd like to put a image in its background just like I did with my widgets. So here's what I…
0
votes
1 answer

Widget not shown in QMainWindow

Good evening, the aim is to have a mainwindow (created without Designer but by coding) with three sections next to each other: a list of data points (vector) statistics about the data points a graphical summary (histogram)of the data I have…
RogerWilco77
  • 319
  • 1
  • 3
  • 13
0
votes
2 answers

How to setup multiple screens in qt mainwindow

I am developing a Hospital Management System using Qt. It has options to create Patients, edit Patients and generate Bills. I used a QMainWindow and had three buttons in the Toolbar for each of these three options. Now when user selects one of…
Dinesh P.R.
  • 6,936
  • 6
  • 35
  • 44
0
votes
2 answers

Resize QMainwindow to fit Qdockwidget size

I have a QMainWindow and a QDockWidget nested inside this. I show some graphs, so the QDockWidget expands but the QMainWindow keeps it's initial size so i have to resize it using my mouse. So, how can i make a QMainWindow resize to QDockWidget size…
igoutas
  • 135
  • 2
  • 14
0
votes
2 answers

Fully disable Qt main window including menu bar?

I need to temporarily disable the main window, including the menu bar. The main window can be disabled simply using setEnabled(false) however it seems that doesn't disable the menu bar, so the user can still click menu items (which in my case break…
laurent
  • 88,262
  • 77
  • 290
  • 428