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

Resolution handling in QMainWindow

I've a QMainWwindow, and I've fixed its size. i.e. I've set Minimum and maximum size of the window to the same number. Could anyone tell me whether this will be a problem if I'm to use this in another screen with a different resolution, and if so,…
user1173240
  • 1,455
  • 2
  • 23
  • 50
0
votes
1 answer

Qt Calling Another Ui

I have created 2 *.ui using Qt Designer in my project, where one is the main screen and another one is a dialog widget. The dialog widget is called by one of the functions in main screen. How can I connect the function in my main window to call the…
Wallace
  • 293
  • 1
  • 9
  • 18
0
votes
1 answer

Multiple QWidets into one QMainWindow

I am currently learing Qt, and I am stuck on the problem of using multiple QWidgets and one QMainWindow. I have setup a project which contains 2 QWidgets and one QMainWindow. This is my idea of using it: design both QWidgets as needed, add them to…
Cheiron
  • 3,620
  • 4
  • 32
  • 63
0
votes
1 answer

Why is my mainwindow closing automatically when called from a differnet class?

I can't seem to figure out what went wrong so I'm here to ask you. I have made a simple class called BOBSNetworkSessionManager defined below. It is a simple class that inherits the QOBject so that I can use signals and slots but it does not have a…
Rob
  • 169
  • 4
  • 14
0
votes
1 answer

Qt - Close subMenu with signal/slot

I have a Qt main window where I call another window, actually a kind of submenu wich contains parameters for the first one; here is a part of this main window : void Ui_MainWindow::createSignals() { connect(actionDisk_galaxy, SIGNAL(triggered()),…
user1773603
0
votes
1 answer

keyPressedEvent error Qt when implementing function

I'm getting an error in a qt program where im trying to capture keystrokes. In the keyPressedEvent function in my qt program but i'm geting a weird error: frenzywindow.cpp:16:50: error: no 'void FrenzyWindow::keyPressEvent(QKeyEvent*)' member…
Amre
  • 1,630
  • 8
  • 29
  • 41
0
votes
1 answer

2 QMainWindow glued - Size of Layout

I have a main window that I center this way in main.cpp : int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow *qmain = new QMainWindow; Ui_MainWindow ui; ui.setupUi(qmain); QRect r =…
user1773603
0
votes
1 answer

Keep QMainWindow minimized when QDialogs show()

I have an application with QMainWindow as the UI which is in minimized state, after some time the application throws a message by calling messageDlg->show() (messageDlg is a QDialog object). Something like this void MainWindow::WarningDialog() { …
Chenna V
  • 10,185
  • 11
  • 77
  • 104
0
votes
1 answer

Best practice to handle multiple documents in QMdiArea?

I need to design and develop a kind of graphics piece of software, which can edit customized files containing graphical elements, etc. I expect the piece of software to contain many documents thanks to the QMdiArea which is actually my central…
Geoffrey R.
  • 1,907
  • 1
  • 19
  • 32
0
votes
1 answer

Taking data from a Dialog in Qt and using it in a Ui

So I'm making a text editor using Qt and right now I have a button that opens a dialog called "Format text". I want it to work kind of like the dialog in notepad called "font" where you select a few text attributes from some drop down lists and it…
user1581100
0
votes
3 answers

hide qdialog and show mainwindow

I have a Qdialog in which i get some inputs to use on my mainwindow. so it must appear first than mainwindow. the problem is that my mainwindow does not show up. here's my main.cpp #include #include "planevolume.h" #include…
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102
0
votes
1 answer

Transfer inputs from qdialog to mainwindow

In qdialog i put some input that i need in the mainwindow, how can i get them? my program is something like this, I have a qdialog that must open before mainwindow, I put there some input and click ok, and then the mainwinodw opens using those…
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102
0
votes
1 answer

QTranslator only works in some parts of my program

I have a weird problem translating my qt application (qt 4.7.4 on Windows). What happens is the following: 1.- I execute lupdate and generate a .ts file. 2.- I edit the generated .ts file with qt linguist. 3.- I execute lrelease with the previous…
0
votes
1 answer

Qt4: Accessing QtDesigner-created widgets from a subclass of QDockedWidget

I bet my question is obvious from it's title but it may be as well not =) So let me explain in detail... I have created a QDockWidget and then transformed (I mean promoted to..) it into a subclass using the designer. So how do I properly access the…
0
votes
1 answer

Qt - allow docking even if QMainWindow too small

My previous question was unanswered, so let me rephrase it: Is it possible to make a QMainWindow accept docking of a QDockWidget regardless of the sizes of widget and the window? Currently, if the window is too small to fit the minimal size of a…
monoik
  • 13
  • 4