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

Change my Qdialog to QMainWindow

Building off of some random example I hacked out this beautiful window. I regret using a QDialog example rather than a QMainWindow. I like the look of the QMainWindow and its features. Now I cannot make the conversion (sheer ignorance). The code is…
tempneff
  • 97
  • 2
  • 10
0
votes
0 answers

PyQt Inheritance Vs Parsing MainWindow's self As Argument

Through numerous suggestions, I'm trying to split PyQt code so it's more modular, each ChildClass inheriting Main(QApplication). Inheritance in the following works, but only at parsing attributes defined within ChildClass, not at changing something…
user2422819
  • 177
  • 13
0
votes
1 answer

Empty QMainWindow, PyQt

I have two QMainWindows, I'm trying to call one from the other one. The window opens but , it is empty and does not respond until the parent window is closed. My Code: from PyQt4 import QtCore, QtGui try: _fromUtf8 =…
thecreator232
  • 2,145
  • 1
  • 36
  • 51
0
votes
1 answer

Qt code questions perhaps pertaining to C++ in general

I have recently began working with the Qt framework and realized there may be a bit about the syntax of C++ that I do not quite understand. Take for example this code that is given as a foundation when starting a Widget project in Qt.…
sherrellbc
  • 4,650
  • 9
  • 48
  • 77
0
votes
2 answers

QSystemTrayIcon in 4.8 - how to delete this thing?

As the title says, what is this thing and how do I handle it? It's a QObject and asks for a QObject as it's parent. But at the same time it has child objects that are clearly QWidgets. Typically with QObjects, you can either let the parent delete…
Ted Middleton
  • 6,859
  • 10
  • 51
  • 71
0
votes
0 answers

QDockWidget not maintaining size

I have 3 QDockWidgets in my main window. One is docked to the top of the window when initialised and the other two are docked side-by-side at the bottom of the window. The central widget is hidden. Initially everything is of the expected size but…
Alan Spark
  • 8,152
  • 8
  • 56
  • 91
0
votes
0 answers

Modify QStatusBar in QMainWindow without deleting it

I'm confronted to a big problem actually, I had a QTabWidget that contains multiple QWidget-herited object named tab and I would like to change the QStatusBar in function of the QTabWidget index but the QMainwindow delete the QStatusBar (which is in…
CheshireChild
  • 148
  • 1
  • 8
0
votes
1 answer

Value in MainWindow returned from childWindow

How do I send a value from a ChildWindow to a MainWindow once the ChildWindow is closed?. When the "closeButton" in ChildWindow is pressed, ChildWindow sends the calculated value to MainWindow. I did a test like this: def closeEvent(self, evnt): …
codeKiller
  • 5,493
  • 17
  • 60
  • 115
0
votes
2 answers

on calling close() the ui does not close

In Qt I have a 2 forms say FirstUI and SecondUI. The main opens the FirstUI. Here I check if the databases needed for the application are present and if not present creates a new one. It also checks if there are any wifi network details stored in…
gfernandes
  • 1,156
  • 3
  • 12
  • 29
0
votes
1 answer

QMainWindow crashes when using QComboBox

I have a problem with my application in Qt, I use a QMainWindow and try to set up 2 QComboBox like I did for other widgets but the application crashes at the setupUi : Voilà ma classe MainWindow, elle fonctionnait parfaitement et s'affichait jusqu'à…
Woute
  • 15
  • 1
  • 4
0
votes
1 answer

Qt 5.2 unexpected external symbol

I made project on linux with qt 4.7 and qxmpp 0.7.6, all works good I installed Qt 5.2 on windows, compiled qxmpp and installed it, it has finished successfully and is in C:\Qt\Qt5.2.0\5.2.0\msvc2010\include\qxmpp dir, seems all went good I copied…
Ruli
  • 2,592
  • 12
  • 30
  • 40
0
votes
1 answer

C++ GUI Condition for if statement always true

I created a simple login program in C++ GUI but for some reason the condition that makes the if statement true is always true no matter what. I've looked at a bunch of times now and I really don't know whats ccausing this, any input would be…
user3183586
  • 167
  • 1
  • 5
  • 15
0
votes
2 answers

Passing word count into dialog qt

I am building a notepad and want to count the words in a dialog. QString input = ui->textEdit->toPlainText(); int spaces = input.count(" "); ui->NumWordsLabel->setNum(spaces); This is my attempt so far. However, I want to execute this code in my…
sark9012
  • 5,485
  • 18
  • 61
  • 99
0
votes
1 answer

Cross-platform Qt5 project using cmake

I am familiar with Qt4 but we are trying to transition to Qt5 and it's being very difficult. I'm trying to create a very simple application, and I had it working using the Qt PRO file, but we need to base it on cmake to keep the build server…
Betty Crokker
  • 3,001
  • 6
  • 34
  • 68
0
votes
1 answer

Running a QT application from Command promt in WIndows

I have made a small QT application and i am trying to run it thru command prompt on Windows: #include #include int main(int argc,char* argv[]) { QMainWindow a(argc,argv) QLabel *NewLabel = new QLabel("Hi i am a…
Metoo
  • 400
  • 1
  • 7