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
0
votes
1 answer

PyQt self.close() in __init__()

I encountered a few minor issues while working with PyQt4 under Python 2.7 I'm writing a little project where there are some QDialogs opening each other. So there is one Dialog I open and instantly open another Dialog to check something and when…
Carl Philipp
  • 181
  • 1
  • 10
0
votes
1 answer

PyQt Creating a QDialog inside a QMainWindow

i am learning PyQt and tried to put a QDialog inside a QMainWindow (to mix layouts). I just don't get why i have 2 separated windows instead of my Dialog inside the MainWindow. Tks in advance. #!/usr/bin/env python # -*- coding: utf-8 -*- import…
D0p
  • 1
  • 3
0
votes
1 answer

How to show a QDialog in center of a QGraphicsView?

I have a QGraphicsView subclass where, on context menu on an item, I want to show a Properties dialog. I would like the dialog to be centered in the view... As I have it now, with no parent, it is shown in the center of the…
Thalia
  • 13,637
  • 22
  • 96
  • 190
0
votes
1 answer

Can't use setWindowsFlag when set parent to Qdialog

I have QDialog which is a child of mainWindow. My problem is I can't use setWindowsFlag when set parent for the dialog: the dialog sticks to the top left of MainWindow and is transparent .The code look like this: mainWindow::MainWindow(QWidget*…
Tiana987642
  • 696
  • 2
  • 10
  • 28
0
votes
1 answer

Qlabel settext is crashing

I have created a dialog box using the qt designer. it generate me a .ui, cpp and header. the cpp is defined : DialogAbout::DialogAbout(QWidget *parent) : QDialog(parent), ui(new Ui::DialogAbout) { ui->buildversion->setText("toto"); …
Seb
  • 2,929
  • 4
  • 30
  • 73
0
votes
2 answers

Using QDialog inside MousePressEvent

I have a class, that subclasses QDialog without overriding exec(), accept() or reject() and another one, that calls the Dialog class inside its mousePaintEvent: void Canvas::mousePressEvent(QMouseEvent *event) { if (event->button() ==…
Ivan Bratoev
  • 235
  • 2
  • 13
0
votes
1 answer

Ok button is not working on QDialog

I'm working on an app in C++/Qt I have used the design tool to design a Qdialog box. The Dialog box is defined as below. c++ file #include "dialogwarning.h" #include "ui_dialogwarning.h" DialogWarning::DialogWarning(QWidget *parent) : …
Seb
  • 2,929
  • 4
  • 30
  • 73
0
votes
0 answers

Button clicked not received in buttonbox

I have created a overwrite dialog box as shown below in QT/C++ here is the code associated: DialogOverwrite::DialogOverwrite(QWidget *parent) : QDialog(parent), ui(new Ui::DialogOverwrite) { ui->setupUi(this); QPushButton…
Seb
  • 2,929
  • 4
  • 30
  • 73
0
votes
1 answer

Python PyQt4 open from QDialog new QWidget window

By pressing a QPushButton in my QDialog window I want to open a new QWidget window. My code: from PyQt4 import QtGui import sys class MainWindow(QtGui.QWidget): def __init__(self, parent=None): super(MainWindow,…
Timo
  • 138
  • 2
  • 11
0
votes
0 answers

Create and update a QprogressBar

I'm developing an app which is mainly a file browser. I need to create a Progress Indication when deleting files to show the progress to the user. I have created one, but it's ugly and not working as expected. Below is the look of Progress this is…
Seb
  • 2,929
  • 4
  • 30
  • 73
0
votes
2 answers

Make a QDialog appear in a different screen

The title says it pretty much all: I have two screens, and each time I create a QDialog it appears in the same screen as its parent. How can I make it appear in a different screen? Or should I use a different type of top-level widget? The code I use…
Daniel
  • 21,933
  • 14
  • 72
  • 101
0
votes
1 answer

Python PySide modal Qdialog without OS decoration (title bar, ...)

I'am going to start coding a GUI with Python and Qt using PySide. I'am using Qt-creator to generate ui for my application. I need a dialog without os decoration such titlebar, statusbar, ... And this Dialog must be modal, or at least it must close…
willygroup
  • 143
  • 1
  • 10
0
votes
1 answer

Keep dialog open until reject signal

I'm opening a dialog that presents a form to the user with: if(dialog.exec() == QDialog::Accepted) { // do stuff based on returned values if (retval == 1) { value1=dialog.value1(); } if (retval ==…
Jocala
  • 243
  • 1
  • 4
  • 16
0
votes
1 answer

Unable to display QDialog/QProgressbar

I have design an app is C++/Qt to transfer file between my Mac to Android Device. to do this, I have created a class QDialog as shown below: dialog.cpp Dialog::Dialog(QWidget *parent) : QWidget(parent) { } void Dialog::CreateProgressBar() { …
Seb
  • 2,929
  • 4
  • 30
  • 73
0
votes
1 answer

How can an image to be displayed on a qdialog?

Pls help on this code, cuz i don't really get the concept. I start a dialog by clicking a button on a qwidget. I also would like to display an image on the aforementiond qdialog by clicking on a different button (img_btn) on the dialog . I have…
Qfwfq
  • 185
  • 1
  • 7