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

Pointing a specific part of the table when app is opened

I am developing an app in windows using Qt. This app displays a table that contains some data. Depending on the time a certain row is highlighted. The window size of the application is fixed. The number of rows exceed the height of the window, so we…
0
votes
1 answer

How do I pass QMainWindow resize events down to a QGLWidget contained in the QMainWindow?

Initially, I followed the structure of http://qt-project.org/wiki/How_to_use_OpenGL_Core_Profile_with_Qt. I created a vanilla Visual Studio 2010 Qt application project, clicked on the .ui file to start Qt Designer, inserted a QWidget and promoted it…
Walt Donovan
  • 357
  • 1
  • 10
0
votes
0 answers

Central Widget in Full Screen Pyqt

I have a mainwindow containing many dockwidget, toolbars,and menubars. I am able to toggle the visibility of dockwidgets and toolbars but not the menubars. Why does not the below code work? Is it possible to view only the central widget of a…
honeybadger
  • 1,465
  • 1
  • 19
  • 32
0
votes
2 answers

Can't set size QMainWindow to less than 200x100 px

Currently I am trying to style QMainWindow using qss stylesheets. It works well, except of setting the size. I am using following qss params: width, height, min-width, min-height. max-width, max-height in the stylesheet file. Unfortunately no…
tomak
  • 167
  • 2
  • 7
0
votes
1 answer

Exec() QDialog after MainWindow appears

I want to make a Modal QDialog appear (with exec()) after the MainWindow appears itself. I tried to call exec in MainWindow::showEvent ( QShowEvent * event ) but It still show before the MainWindow appears. Any idea how could achieve this ?…
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
0
votes
1 answer

Destroy QWidget returned from Plugin in Qt

My app loads a plugin which creates a window (QWidget), but I can not destroy it when I exit from QMainWindow, obviously because widget returned from plugin is not a child of QMainWindow. The issue is that if I make that window to be a child of…
user704010
-1
votes
1 answer

QLabel text doesn't update after i changed it when QMainWindow is shown

I've set a placeholder in a QLabel to "user". After ui->setupUi(this);, QLabel gets changed via ui->label->setText("superuser");. No changes are made afterwards. As soon as QMainWindow is initialized and shown via mw.show(); in main.cpp file ,…
red power
  • 1
  • 2
-1
votes
1 answer

Qt: Show MainWindow in main.cpp without using QT Designer

I'm working on an assignment using QT Creator and as a requirement I have to create my GUI without using QT Designer. I have a header file with basically just a constructor. I want to call show my MainWindow in the main.cpp file (and have included…
Lebo
  • 19
  • 2
-1
votes
1 answer

How to open a Ui_MainWindow file, inside my main.py (PYQT6)

how do I create a main.py file, where it will access the child files (screen, login, registration). first it will open the login screen, and then it will open the main screen. I made the whole project in pyqt6, and converted to py file. The way I…
-1
votes
1 answer

qt Program crush with segmentation fault while switching cental widget

I tried maybe everything but I just don't see a mistake in this code. I made two windows inherited from QMainWindow: one with qt designer and another just in constructor. I'm trying to switch these windows in the MainWindow class depending on what…
-1
votes
1 answer

How to show a QMainWindow in the taskbar

I am making a desktop application using Qt. the main window opens one of two other windows, but i need to hide the main window when the others are working, when doing so the program is hidden from the taskbar . and i want to show them with different…
-1
votes
1 answer

QMainWindow close button gets inactive while QNetworkReply is reading data

Here is some idea of my code.It executes successfully. I am just not able to use close button the moment it starts executing read statement.! inside main(): int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow…
-1
votes
1 answer

Python Qt4 classes & QTGui Windows

i'm trying to learn Python and QT4. I like pizza, so I realized a program to calculate the amount of ingredients, based on the number of pizzas I want to make. The program is the following and do its job. class Pizza: # MEMBRI farina=0 …
Massimo D. N.
  • 316
  • 1
  • 6
  • 17
-1
votes
1 answer

PyQt - Correct Position Of Import Statements

In light of segregating/organising code, am lost on the best approach. The below works, with app.py imports after the MainWindow instantiation, but will that create subsequent problems, as I can't see how else things can be done (putting the…
user2422819
  • 177
  • 13
-1
votes
1 answer

Why MainWindow in Qt is closing after start the program?

I was working on Windows with this program and was ok.. When im running it on linux (using QT creator, same on windows) window show and hide immediately. The program is to big to paste it all, this is my main.cpp code int main(int argc, char…
user1824542
  • 225
  • 1
  • 4
  • 15
1 2 3
34
35