qdialog

Non-resizeable QDialog with fixed size in Qt?

自作多情 提交于 2019-11-27 10:13:31
问题 I have a Qt dialog application. Now I dont want that dialog to be resizeable. I am not sure how to achieve this. I tried a bunch of things but still when the dialog launches this dialog can be resized. What is the property that i should set to disable the dialog/Widget resize. I also tried setSizePolicy(QSizePolicy::Fixed); But i get an error saying.. source\nimcac_settingsMain.cpp(36) : error C2248: **'QSizePolicy::QSizePolicy' : cannot access private member declared in class 'QSizePolicy'**

QDialog exec() and getting result value

谁都会走 提交于 2019-11-27 09:12:40
I have subclassed QDialog to implement functionality similar to QMessageBox ( I needed this to allow for customization). It has a text message and OK, Cancel buttons. I am showing the dialog using exec() to make it blocking. Now, how do I return values of true/false when the user clicks on OK/Cancel? I tried connecting the buttons to setResult() and then, return the result value when clicked, but Clicking the buttons does not close the dialog box the return value is incorrect. Following is the code I have written. I think I am wrong in the exec/result part - but I am not sure how to fix it.

How to fix error in my pyqt programm (first argument of unbound method must have type 'QDialog') ?

放肆的年华 提交于 2019-11-27 09:01:08
问题 After typing 1, both as login and password, a new window should appear, but it gives an error. It used to work fine before I made some changes to code, and I don't know what exactly causes it. # -*- coding: utf-8 -*- from PyQt4 import QtGui, QtCore import sys app = QtGui.QApplication(sys.argv) login = QtGui.QDialog() login.setWindowTitle('login') login.resize(100, 100) login_form = QtGui.QFormLayout() row1 = QtGui.QHBoxLayout() user_input = QtGui.QLineEdit() row1.addWidget(user_input) login

PyQt: getting widgets to resize automatically in a QDialog

两盒软妹~` 提交于 2019-11-26 23:21:56
问题 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 the same size when the dialog is resized. Is there any way of making the textarea in the dialog resize automatically? I've tried using setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) on the dialog itself and the two widgets within, but that

How can I hide/delete the “?” help button on the “title bar” of a Qt Dialog?

我的未来我决定 提交于 2019-11-26 16:19:40
问题 I am using Qt Dialogs in one of my application. I need to hide/delete the help button. But i am not able to locate where exactly I get the handle to his help button. Not sure if its a particular flag on the Qt window. 回答1: By default the Qt::WindowContextHelpButtonHint flag is added to dialogs. You can control this with the WindowFlags parameter to the dialog constructor. For instance you can specify only the TitleHint and SystemMenu flags by doing: QDialog *d = new QDialog(0, Qt: