Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1314

.ui compliaton - datastamp and "-x" parameter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • None
    • 5.15.0
    • PySide
    • None
    • W7x64 Sp2
    • Windows

    Description

      I upgraded the Pyside2 by pip to PySide2-5.15.0-5.15.0-cp35.cp36.cp37.cp38-none-win_amd64.whl

      I discover that not exist function in case of usage

      Python36\Scripts\pyside2-uic window.ui -o window.py -x

      where result is:

      uic: Unknown option 'x'.

        • it's finaly solution? It added this type to end file*

       

      if _name_ == "_main_":
          import sys
          app = QtWidgets.QApplication(sys.argv)
          MainWindow = QtWidgets.QMainWindow()
          ui = Ui_MainWindow()
          ui.setupUi(MainWindow)
          MainWindow.show()
          sys.exit(app.exec_())
       
       
      In previous version for window.ui was window.py code as:
      # Created: Sun Apr 26 21:37:59 2020
      #      by: pyside2-uic  running on PySide2 5.12.2
       
      * *coding: utf-8 --

      # Form implementation generated from reading ui file 'main_window.ui',
      # licensing of 'main_window.ui' applies.
      #
      # Created: Sun Apr 26 21:37:59 2020
      #      by: pyside2-uic  running on PySide2 5.12.2
      #
      # WARNING! All changes made in this file will be lost!

      from PySide2 import QtCore, QtGui, QtWidgets

      class Ui_MainWindow(object):
          def setupUi(selfMainWindow):
              MainWindow.setObjectName("MainWindow")
              MainWindow.setWindowModality(QtCore.Qt.ApplicationModal)
      with end.. of all
      import main_rc

      if _name_ == "_main_":
          import sys
          app = QtWidgets.QApplication(sys.argv)
          MainWindow = QtWidgets.QMainWindow()
          ui = Ui_MainWindow()
          ui.setupUi(MainWindow)
          MainWindow.show()
          sys.exit(app.exec_())
       

      In new is (without date creation - not good [want turn back this function for git]):
      * *coding: utf-8 --

      ################################################################################
      ## Form generated from reading UI file 'main_window.ui'
      ##
      ## Created by: Qt User Interface Compiler version 5.15.0
      ##
      ## WARNING! All changes made in this file will be lost when recompiling UI file!
      ################################################################################

      from PySide2.QtCore import (QCoreApplication, QDate, QDateTime, QMetaObject,
          QObject, QPoint, QRect, QSize, QTime, QUrl, Qt)
      from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont,
          QFontDatabase, QIcon, QKeySequence, QLinearGradient, QPalette, QPainter,
          QPixmap, QRadialGradient)
      from PySide2.QtWidgets import *

      import main_rc

      class Ui_MainWindow(object):
          def setupUi(selfMainWindow):
              if not MainWindow.objectName():
                  MainWindow.setObjectName(u"MainWindow")
              MainWindow.setWindowModality(Qt.ApplicationModal)
       

      Not sure that we need more that:
      from PySide2 import QtCore, QtGui, QtWidgets
       
      HVR the new solution where in MVC we need add in view module .show() is not friendly for calling many dialog windows in my opinion.

       
              self.ui = Ui_MainWindow()
              self.ui.setupUi(self)
              self.show()

       

       

      BTW to JIRAD admin the WYSWIG after send msg not respecting black bacground code from VSC thats why code is coloured without bg, and ugly, not for eyes freindly.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            qtman Qt_resercher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes