Questions tagged [qdialog]

A QDialog is a class from the Qt Toolkit which is the base class for dialog windows.

QDialog serves as a base class in constructing dialog windows. It is different from an ordinary window or widget, because it has a return value, and default buttons. Dialogs can also be made modal or non-modal.

Qt offers a set of default dialogs derived from this class, and allows developers to make custom dialogs by deriving from QDialog. QDialog is always a top-level widget, but if it has a parent, its default location is centered on top of the parent's top-level widget (if it is not top-level itself)

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

467 questions
10
votes
3 answers

How to return data from QDialog?

I am trying to design a main window and a QDialog, and to find the best way to return the data from a QDialog. Right now I am catching the accepted() signal from the dialog, after which I call dialog's function that returns the data. Is there any…
Igor
  • 26,650
  • 27
  • 89
  • 114
10
votes
4 answers

How to center a QDialog in QT?

I have this example code: QDialog *dialog = new QDialog(this); QPoint dialogPos = dialog->mapToGlobal(dialog->pos()); QPoint thisPos = mapToGlobal(this->pos()); dialog->exec(); But the Dialog is not centered on his parent. Thanks in…
Omar Murcia
  • 547
  • 2
  • 11
  • 26
10
votes
4 answers

PyQt: getting widgets to resize automatically in a QDialog

I'm having difficulty getting widgets in a QDialog resized automatically when the dialog itself is resized. In the following program, the textarea resizes automatically if you resize the main window. However, the textarea within the dialog stays…
Luke Woodward
  • 63,336
  • 16
  • 89
  • 104
9
votes
3 answers

how to set QDialog width and height and allow automatic window placement

Is there a way to just initialize a QDialog's width and height and not change the x and y coordinates without using a ui file? I just have a simple QDialog and want to set only the width and height, and have the x and y automatically set to the…
Alex
  • 712
  • 2
  • 13
  • 27
9
votes
2 answers

How to show a window in Qt and deleting it as soon as it's closed?

As a very simple example, I want to show a dialog in Qt when I press a button. The usual pattern for this (in the application I'm currently working on) seems to be as follows: class MainWindow { ... private slots: buttonClicked(); …
Joey
  • 344,408
  • 85
  • 689
  • 683
8
votes
2 answers

Qt designer - how to create QDialog?

It is possibility to create QDialog in Qt-creator like for example QForm (by clicking)? I've found several samples, but QDialog is created programmatically. I want to drag and drop buttons, listview and others components on QDialog. Now I can add…
Albert
  • 161
  • 2
  • 4
8
votes
4 answers

How to close a QDialog

I've been trying to close a QDialog window that is branching off of my main window. The following have not worked for me so far: self.close() QDialog.close() I tried other commands such as exit and exec_() with no luck. The most common error I…
C Snyder
  • 81
  • 1
  • 1
  • 4
8
votes
4 answers

Enable maximize button in QWizard

I have a Windows application that is built on QWizard (which inherits from QDialog). It must have a working maximization button. By default maximization button is not even visible. i have set it to show, using: auto flags = windowFlags(); flags ^=…
Srv19
  • 3,458
  • 6
  • 44
  • 75
7
votes
2 answers

Qt : how to implement QDialog StatusBar

I have QDialog that is heavily designed with QDesigner , I saw on the web that I could add QStatusBar with code like this : #include #include #include #include #include #include…
user63898
  • 29,839
  • 85
  • 272
  • 514
7
votes
1 answer

How to hide a row of a QTableWidget without changing the index of the entries?

I have a QTableWidget with 7 colums in a QDialog, where every row has information about files in a specific directory. With some checkboxes, lineedits etc I want to have the possibility to show only those files with a certain text, which I can…
erniberni
  • 313
  • 5
  • 17
7
votes
2 answers

Quit application call twice the closeevent

I have wrote an application in Qt/c++ on OSX. When quitting the app, I'm catching the closeevent to display dialog box void MainUI::closeEvent (QCloseEvent *event) { if( DeviceUnplugged == false) { ExitDialog = new DialogExit; …
Seb
  • 2,929
  • 4
  • 30
  • 73
7
votes
2 answers

QDialog - How to remove the minimize button

Qt 4.8 based, application - Issue with QDialog, minimize button Windows and Gnome (linux) The modal dialog appears with the close button on the right top, and the minimize button is nonexistent. The minimize option are grayed out in every…
Theo
  • 1,385
  • 2
  • 10
  • 19
7
votes
2 answers

QDialog with ok and cancel buttons

I need Qt Dialog with ok and cancel buttons with standard functionality, placed on the right side of its layout. I need to inherit from it and add other widgets to its layout. I can implement it myself, but maybe there is something standard, in that…
Ashot
  • 10,807
  • 14
  • 66
  • 117
7
votes
1 answer

How do I know if a window blocked by modal

I have several modal dialogs and main dialog where I exec() modal. How do I know if a main window blocked by modal or not?
BiTOk
  • 716
  • 1
  • 6
  • 15
6
votes
1 answer

Load QDialog directly from UI-File?

I work with QT Designer and create my GUIs with it. To launch the main program, I use this code: import sys from PyQt4 import uic, QtGui, QtCore from PyQt4.QtGui import * from PyQt4.QtCore import * try: _fromUtf8 =…
Kai
  • 299
  • 6
  • 13
1
2
3
31 32