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
2
votes
2 answers

How to prevent crash after close QMainWindow in Qt?

I have an error, just after closing my application, I get an error message saying that it has stopped unexpectedly. I reached this: But, after I close the window, I get this error: The program has unexpectedly finished. The process was ended …
Omar Murcia
  • 547
  • 2
  • 11
  • 26
2
votes
1 answer

How to add tab space before QAction buttons in QMainToolBar

How can I add space before QAction icons.Like this image.I set style-sheet for mainToolBar like this spacing:10px; But I need to add tab space before icon 1.
Sachith Wickramaarachchi
  • 5,546
  • 6
  • 39
  • 68
2
votes
1 answer

Accessing a common data object in a PyQt application

I have a GUI programmed in PyQt with many widgets and different windows, etc. The data for the GUI is stored in a python object. This object should be reachable from every widget in the program. Where should I put this object? Right now I have it…
Benjamin
  • 298
  • 1
  • 12
2
votes
3 answers

How to hide the status bar Qt

I'm trying to create an opening screen for my software. Because I have a status bar in the QMainwindow then Qt makes me a transparent line line at the bottom of the opening screen. I tried using: this-> statusBar () -> hide (); ui-> statusBar-> hide…
YOKO
  • 119
  • 1
  • 7
2
votes
1 answer

Collect all docked widgets and their locations

Is there a way in PySide to collect all the docked widgets, and whether they are docked on he left or right side of the main window? If there is no answer to my first question, how can I at least find out if a widget is docked on the left or the…
JokerMartini
  • 5,674
  • 9
  • 83
  • 193
2
votes
0 answers

QT main window separate images for horizontal and vertical separators?

Is it possible to specify separate images for horizontal and vertical separators like we can for QSplitter? I tried some of the same css selectors, but no luck. I'm only able to specify the same image for both vertical and horizontal separators as…
Rafe
  • 1,937
  • 22
  • 31
2
votes
0 answers

How can I embed/reparent QMainWindow into a non Qt application?

I have a WindowID where I want to embed a QMainWindow. Briefly summarized: I'm finding the equivalent of gtk.gdk.window_foreign_new(). My not working Qt5.2 code is: WId nonqt_window_id = WId(0x7A00516); QWindow* nonqt_parent_window =…
andras.tim
  • 1,964
  • 1
  • 13
  • 23
2
votes
1 answer

change QMainWindow PyQt5 after pressed button

I have generated my UI with Qt Designer: like this I have used the .ui file with the following python code: Ui_MainWindow, QtBaseClass = uic.loadUiType("vault.ui") Ui_Credentials, QtBaseClass = uic.loadUiType("credentials.ui") class…
Florian
  • 182
  • 1
  • 10
2
votes
1 answer

Qt MainWindow ignores width, height and title properties

I've created a simple Qt Widgets application using Qt Creator on my Windows 10 machine. I use the ui file and the designer to change properties of my QMainWindow, but somehow the width, height and windowTitle properties have no effect when I set…
diggingforfire
  • 3,359
  • 1
  • 23
  • 33
2
votes
1 answer

toggle QMainWindow WindowStaysOnTopHint flag pyside

Why, when I toggle the QMainWindow's SetWindowFlags to WindowStaysOnTopHint, does my window disappear, and more importantly not stay on top? I'm using PySide and a QMainWindow. import sys from PySide import QtGui, QtCore class…
JokerMartini
  • 5,674
  • 9
  • 83
  • 193
2
votes
3 answers

How to communicate between QDialog Window and QMainWindow with Qt C++

I am an application using Qt Creator in C ++. The int main () function is as follows. I am starting a QDialog Window where I am getting the "url" variable content. How can I get this variable into the mainwindow.cpp file. QApplication a(argc,…
oğuzhan kaynar
  • 77
  • 1
  • 10
2
votes
1 answer

PyQT - list QWidgets/Windows

I have a class Main(QtGui.QMainWindow): That is able to click>spawn a x number of windows that are: class dataWindow(QtGui.QWidget) Is there a way in PyQt to now find all spawned dataWindow's and get their objectName? each window has unique…
Dariusz
  • 960
  • 13
  • 36
2
votes
1 answer

QMainWindow and child widgets size don't match

Probably a noob question, but I'm still learning PySide. So I'm trying to use QMainWindow which has a QFrame and the QFrame has two labels. I'm using QBoxLayouts on QMainWindow and QFrame. The problem is that when I set the QFrame to something like…
flouwer
  • 327
  • 1
  • 4
  • 13
2
votes
2 answers

How to remove mainwindow titlebar permanently?

When I set mainwindow to fullscreen() , title bar disappears, thats what I want. But when a dialog is opened main window title bar appears again, which is undesirable in my case.I have tried setting several Qt::windowflags but they dont work.Any…
dilip yadav
  • 123
  • 1
  • 10
2
votes
4 answers

How to add a custom widget to the main window in Qt Creator

I am new to Qt. I took an example from here http://doc.qt.io/qt-5/qtmultimediawidgets-player-example.html. Now I want to integrate the player in the main window. I created a Qt Widgets application project, I thought, that I would just have to edit…
Rareform
  • 77
  • 1
  • 2
  • 11