Self.pushButton = QtGui. Push the inner rectangle to the other side to make a hole through the window form. The class definition only contain the class constructor and a private data member for the QTabWidget: In the example, the widget will be used as a top-level window, but we define the constructor so that it can take a parent widget. Here is a working example (derived from yours): #!/usr/bin/env python If you want to save a copy of your file in SketchUps cloud storage. The TabDialog class is a subclass of QDialog that displays a QTabWidget and two standard dialog buttons. (design1 and design2 have been derived from the Qt designer.) (self.on_pushButton_clicked)īut on_pressed, this error message appears: AttributeError: 'Second' object has no attribute 'exec_' To create a new, blank form using a Qt Designer. I fiddled with the code copied from this question: PyQT on click open new window, and I wrote this code: # -*- coding: utf-8 -*-Ĭlass Second(QtGui.QMainWindow, design2.Ui_MainWindow):Ĭlass First(QtGui.QMainWindow, design1.Ui_MainWindow): To start a new form, select the template you want to use from the New Form dialogue box, then click Create. Setting his property to true is equivalent to setting QWidget::windowModality to Qt::ApplicationModal. By default, this property is false and show () pops up the dialog as modeless. I have a window which contains one button (Class First) and I want on pressed, a second blank window to be appeared (Class Second). This property holds whether show () should pop up the dialog as modal or modeless. QDialog dialog (this) // Use a layout allowing to have a label next to each field QFormLayout form (&dialog) // Add some text above the fields form. If you want multiple values, create a QDialog derived class from scratch with 4 input fields. First of all, similar questions have been answered before, yet I need some help with this one. The QInputDialog class provides a simple convenience dialog to get a single value from the user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |