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

PyQt Using a progress bar seems to not be progressive

The following code is meant to update a progress bar as a 24line file is read. The timer serving to demonstrate what is going on in a longer time. What actually happens is that the whole file is read line by line and then the progress bar is updated…
nerak99
  • 640
  • 8
  • 26
0
votes
1 answer

PyQt: Scrollbars are not shown with QGraphicsView class being nested under QMainWindow

I am supposed to add scrollbars to the screen. The class design shown below is the part of a software that I am supposed to modify and add scrollbars to. The scroll bar code in Window class has been added by me. It doesn't get shown when I run the…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
0
votes
1 answer

QWidget does not appear in the QMainWindow using PyQt5

What I want is an interface which opens windows under a SINGLE window, that is, I do NOT want the interface to open extra windows. I will guide you to my error. When I run my code I get a home page, from there I click on View/Edit --> View/Edit…
Migui Mag
  • 187
  • 1
  • 3
  • 13
0
votes
0 answers

Activate QMainWindow in Astra Linux

I have an application with some windows, and one of them is modal. On Windows OS, I can't raise the not modal window by clicked on it when the modal window is activated. On Linux (I'm using Astra Linux) I can do this (not modal window will raise). I…
0
votes
1 answer

Is it possible to use QGraphicsLayout in an application with a QMainWindow?

What I was hoping to do was have a standard QMainWindow class with menus, toolbar, plus various widgets in a layout, one of which would be a graphics view showing a graphics widget that contained a graphics layout. But whenever I put the graphics…
0
votes
1 answer

How do I set a background image to mainwindow?

I am trying to set the background image of the mainwindow through setStyleSheet() but this also applies the image to its children including textbrowsers and TextEdit. How can I accomplish this without doing so?
0
votes
1 answer

Passing/giving commands to CMD through Qt GUI

What I'm trying to achieve (And struggling with) is basically passing commands to CMD through my QT Mainwindow application. I would like to have my code, first run CMD (preferably hidden). I used here QProcess like this: (in my Mainwindow.cpp…
skdadle
  • 155
  • 1
  • 2
  • 17
0
votes
0 answers

Qml FileDialog is rendering behind main window with QQuickWidget (QT 5.9.1)

I am building a desktop application using QML with QQuickWidget and QMainWindow, everything looks work fine except to the FileDialog. When I open a window using FileDialog it works flawlessly at first time but in the second time and so on the…
Spes
  • 51
  • 6
0
votes
1 answer

Qt Multiple window design

I appologize for the long paragraph but its the only way I can explain this. Basic Question: How do I have multiple windows that share some UI functionality without having it all in one giant class? My Situation: I have a question regarding the…
user9150170
0
votes
1 answer

How to access other class's object in Qt?

In the program, I want to click a button in the main window and trigger the sub-window to display the image. But I cannot access ui->graphsView in the main window.cpp, how can I do that? In the main.cpp. the click-button function is assumed to do…
md612
  • 300
  • 2
  • 5
  • 20
0
votes
2 answers

add combobox to mainwindow

I created a Main window with 2 button by pyqt5 and now i want to add a combo box to it. But if i keep App(QMainWindow), the combo box wont show. Only if i write App(QWidgets) it will show. Are there any way to add a combo box to main window ? here…
dauhuong68
  • 19
  • 1
  • 7
0
votes
1 answer

How to keep QMainWindow open?

I have a UI file that I created using Qt Creator. When I execute the application through PyCharm, the main window opens briefly, then closes. I assume it is being garbage collected, but I'm not sure how to get this to work. Any…
artomason
  • 3,625
  • 5
  • 20
  • 43
0
votes
1 answer

PyQt5: QWidgets shows without any datas

After my previous problem, I have my widgets on my main window. But this lasts doesn't come with any data: the datagridview haven't columns and the treeview are invisible or without my hard coded items. Here's my code: app.py #!/usr/bin/env…
Y.Berthoud
  • 75
  • 8
0
votes
1 answer

PyQt5: main window shows without any widgets

I'm using PyQt5 to create my application. The problem is that my window appears, but without any widgets (i.e. without my Main class, without any menus, toolbars, etc.) - just still empty. I'm using Python-3.6 and PyQt5, Windows 10…
Y.Berthoud
  • 75
  • 8
0
votes
0 answers

QWidget (from Qt Designer) in centralZone of QMainWindow

I have a simuWindows.ui (and its .cpp and .h files associated) which is a QWidget. I have a mainWindows.cpp and mainWindows.h. What I would like to do is to set my QWidget (simuWindows) as a centralZone of mainWindows. Here is what I have tried…
EagleWatch
  • 105
  • 1
  • 8