qdialog

PyQt4 QInputDialog and QMessageBox window flags

守給你的承諾、 提交于 2021-02-11 12:53:29
问题 I am using python 2.7 and PyQt4 to make a gui; my experience is pretty limited. I wanted to use the QInputDialog and QMessageBox objects for some of the dialogs I need. I don't want to have the "?" in any dialogs I use. There is an answer posted on how to do this for a similar question How can I hide/delete the "?" help button on the "title bar" of a Qt Dialog? That solution works for a standard QDialog. It amounts to: message = QtGui.QDialog(self, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt

Qt application windows moved between multiple monitors make child dialog showing with bug of empty blank windows only

你离开我真会死。 提交于 2021-02-10 06:36:50
问题 [Update on 19 aug 2019 about workaround of this bug] environements: System: Windows 7 (reproduced on windows 10 PC on execution too) QT version: 5.11.2 as well as 5.13 compilation kit: Qt 5.11.3 MinGw 32bits ( mingw53_32 ) I encounter an issue with QDialog in Qt app. it's easy to reproduce, with multiple monitors(eg. 2 screens), you launch your application, then you move your main windows from one monitor to another one, then you click on the button of app to show a child dialog, then it this

Qt application windows moved between multiple monitors make child dialog showing with bug of empty blank windows only

懵懂的女人 提交于 2021-02-10 06:36:28
问题 [Update on 19 aug 2019 about workaround of this bug] environements: System: Windows 7 (reproduced on windows 10 PC on execution too) QT version: 5.11.2 as well as 5.13 compilation kit: Qt 5.11.3 MinGw 32bits ( mingw53_32 ) I encounter an issue with QDialog in Qt app. it's easy to reproduce, with multiple monitors(eg. 2 screens), you launch your application, then you move your main windows from one monitor to another one, then you click on the button of app to show a child dialog, then it this

Qt application windows moved between multiple monitors make child dialog showing with bug of empty blank windows only

狂风中的少年 提交于 2021-02-10 06:36:22
问题 [Update on 19 aug 2019 about workaround of this bug] environements: System: Windows 7 (reproduced on windows 10 PC on execution too) QT version: 5.11.2 as well as 5.13 compilation kit: Qt 5.11.3 MinGw 32bits ( mingw53_32 ) I encounter an issue with QDialog in Qt app. it's easy to reproduce, with multiple monitors(eg. 2 screens), you launch your application, then you move your main windows from one monitor to another one, then you click on the button of app to show a child dialog, then it this

Why does opening a QDialog the second time cause it to be shown immediately, not animated smoothly?

橙三吉。 提交于 2021-01-28 01:13:23
问题 In my Qt application, I have a QMainWindow subclass for the UI ( ProgramWindow ) and a QDialog subclass ( SettingsDialog ) which is shown when the user clicks the "Settings" button in the main window. I'm using the following code to implement this: int main(int argc, char *argv[]) { QApplication a(argc, argv); ProgramWindow pw; pw.show(); pw.setFixedSize(pw.size()); SettingsDialog set(&pw); QObject::connect(&pw, SIGNAL(settingsButtonClicked()), &set, SLOT(show())); return a.exec(); } However,

Enable resizing on QWidget

别说谁变了你拦得住时间么 提交于 2020-12-12 03:18:38
问题 I want a resize feature in a QWidget using Qt, like the one shown in the image below. I have used following tried following ways: using QSizeGrip , setSizeGripEnabled 回答1: For completeness I'm showing two examples: with and without the Qt Designer. Example using Qt Designer Check the sizeGripEnabled property: Preview from within the Qt Designer ( Form > Preview... ): Minimal application to show the dialog: #include <QtWidgets/QApplication> #include <QDialog> #include "ui_DialogButtonBottom.h"

Enable resizing on QWidget

谁说胖子不能爱 提交于 2020-12-12 03:17:06
问题 I want a resize feature in a QWidget using Qt, like the one shown in the image below. I have used following tried following ways: using QSizeGrip , setSizeGripEnabled 回答1: For completeness I'm showing two examples: with and without the Qt Designer. Example using Qt Designer Check the sizeGripEnabled property: Preview from within the Qt Designer ( Form > Preview... ): Minimal application to show the dialog: #include <QtWidgets/QApplication> #include <QDialog> #include "ui_DialogButtonBottom.h"

QDialog exec() can not exit process

折月煮酒 提交于 2020-02-02 13:31:32
问题 int main(int argc, char *argv[]) { QApplication a(argc, argv); QDialog dlg; dlg.exec(); return a.exec(); } That's all my code, but when I close the window, The process isn't exit, it seems that drop in the loop a.exec() . 回答1: Generally speaking, calling any exec is a bad idea, other than QCoreApplication::exec() or QDrag::exec() . The presence of exec() and waitForXxx() methods is an enticing trap for the unwary. Those methods are "easy" to use, but that ease comes at a price of hard to

How can I disable Alt + F4 window closing using Qt?

你离开我真会死。 提交于 2020-01-30 18:53:27
问题 I've disabled X button in Qt from my dialog using this line: myDialog->setWindowFlags(Qt::Dialog | Qt::Desktop) but I couldn't detect Alt + F4 using this code: void myClass::keyPressEvent(QKeyEvent *e) { if ((e->key()==Qt::Key_F4) && (e->modifiers()==Qt::AltModifier)) doSomething(); } what should I do to detect Alt + F4 or disable it in Qt? 回答1: Pressing Alt+F4 results in a close event being sent to your top level window. In your window class, you can override closeEvent() to ignore it and

QDialog with rounded corners have black corners instead of being translucent

淺唱寂寞╮ 提交于 2020-01-25 07:04:45
问题 I need to create a QDialog with rounded translucent corners. The problem is when doing so, the corners are translucent, but are somehow filled in by the Window's alpha property making it black (which is my understanding of the cause of the problem) Clearly visible is the rounded edges, but with a black 'background' of sorts. To confirm, this Dialog is a modal dialog launched by a QThread from QMainWindow . It is not the parent window . The CSS for the QDialog (root) component is: QDialog {