Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why can't I modify old project's .ui file?

Why can't I modify old project's .ui file?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.3k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    D_Sharad
    wrote on last edited by D_Sharad
    #1

    Hey guys i am beginner at Qt. Yesterday I downloaded a project from web which is working perfectly fine but when I try to modify its .ui file in Design Mode nothing shows up.
    3473f422-b0d8-482d-a250-b5bb5529d714-image.png
    It's Everything that shows up.
    What am I missing here?
    Btw I am using latest version of qt in Windows and I am not quite sure what original creator used.

    Pl45m4P 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Normally it's not an issue if the UI file is not ultra old.

      It might be broken.
      Could you post it here ?

      or if really long then
      https://paste.ofcode.org/

      THE UI file is an XML file so e can look in it and see.

      D 1 Reply Last reply
      1
      • D D_Sharad

        Hey guys i am beginner at Qt. Yesterday I downloaded a project from web which is working perfectly fine but when I try to modify its .ui file in Design Mode nothing shows up.
        3473f422-b0d8-482d-a250-b5bb5529d714-image.png
        It's Everything that shows up.
        What am I missing here?
        Btw I am using latest version of qt in Windows and I am not quite sure what original creator used.

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #3

        @D_Sharad said in Why can't I modify old project's .ui file?:

        nothing shows up.

        "Nothing" is wrong here :)
        You can see something in the top left corner... Don't know what this is, but looks like some widget...

        As @mrjj suggests, open the ui file with any texteditor, check what's inside and if it looks like XML. If not, it's probably broken.


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        D 1 Reply Last reply
        0
        • mrjjM mrjj

          Hi
          Normally it's not an issue if the UI file is not ultra old.

          It might be broken.
          Could you post it here ?

          or if really long then
          https://paste.ofcode.org/

          THE UI file is an XML file so e can look in it and see.

          D Offline
          D Offline
          D_Sharad
          wrote on last edited by
          #4

          @mrjj Thankyou for your reply.
          It's
          <?xml version="1.0" encoding="UTF-8"?>
          <ui version="4.0">
          <class>MainWindow</class>
          <widget class="QMainWindow" name="MainWindow">
          <property name="enabled">
          <bool>true</bool>
          </property>
          <property name="geometry">
          <rect>
          <x>0</x>
          <y>0</y>
          <width>16</width>
          <height>16</height>
          </rect>
          </property>
          <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
          </sizepolicy>
          </property>
          <widget class="QWidget" name="centralWidget">
          <widget class="QRadioButton" name="radioButtonSimple">
          <property name="geometry">
          <rect>
          <x>0</x>
          <y>0</y>
          <width>84</width>
          <height>22</height>
          </rect>
          </property>
          <property name="text">
          <string>Обычный</string>
          </property>
          </widget>
          <widget class="QRadioButton" name="radioButtonCompl">
          <property name="geometry">
          <rect>
          <x>0</x>
          <y>0</y>
          <width>105</width>
          <height>22</height>
          </rect>
          </property>
          <property name="text">
          <string>Инженерный</string>
          </property>
          </widget>
          <widget class="QLineEdit" name="lineEdit">
          <property name="geometry">
          <rect>
          <x>0</x>
          <y>0</y>
          <width>142</width>
          <height>27</height>
          </rect>
          </property>
          </widget>
          </widget>
          </widget>
          <layoutdefault spacing="6" margin="11"/>
          <resources/>
          <connections/>
          </ui>

          I got it from :https://github.com/Bychin/Qt-simple-calculator.git

          Pl45m4P 1 Reply Last reply
          0
          • Pl45m4P Pl45m4

            @D_Sharad said in Why can't I modify old project's .ui file?:

            nothing shows up.

            "Nothing" is wrong here :)
            You can see something in the top left corner... Don't know what this is, but looks like some widget...

            As @mrjj suggests, open the ui file with any texteditor, check what's inside and if it looks like XML. If not, it's probably broken.

            D Offline
            D Offline
            D_Sharad
            wrote on last edited by
            #5

            @Pl45m4 Thank you for your time. That's a widget containing a Line Edit and two radio button jumbled together.

            1 Reply Last reply
            0
            • D D_Sharad

              @mrjj Thankyou for your reply.
              It's
              <?xml version="1.0" encoding="UTF-8"?>
              <ui version="4.0">
              <class>MainWindow</class>
              <widget class="QMainWindow" name="MainWindow">
              <property name="enabled">
              <bool>true</bool>
              </property>
              <property name="geometry">
              <rect>
              <x>0</x>
              <y>0</y>
              <width>16</width>
              <height>16</height>
              </rect>
              </property>
              <property name="sizePolicy">
              <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
              </sizepolicy>
              </property>
              <widget class="QWidget" name="centralWidget">
              <widget class="QRadioButton" name="radioButtonSimple">
              <property name="geometry">
              <rect>
              <x>0</x>
              <y>0</y>
              <width>84</width>
              <height>22</height>
              </rect>
              </property>
              <property name="text">
              <string>Обычный</string>
              </property>
              </widget>
              <widget class="QRadioButton" name="radioButtonCompl">
              <property name="geometry">
              <rect>
              <x>0</x>
              <y>0</y>
              <width>105</width>
              <height>22</height>
              </rect>
              </property>
              <property name="text">
              <string>Инженерный</string>
              </property>
              </widget>
              <widget class="QLineEdit" name="lineEdit">
              <property name="geometry">
              <rect>
              <x>0</x>
              <y>0</y>
              <width>142</width>
              <height>27</height>
              </rect>
              </property>
              </widget>
              </widget>
              </widget>
              <layoutdefault spacing="6" margin="11"/>
              <resources/>
              <connections/>
              </ui>

              I got it from :https://github.com/Bychin/Qt-simple-calculator.git

              Pl45m4P Offline
              Pl45m4P Offline
              Pl45m4
              wrote on last edited by Pl45m4
              #6

              @D_Sharad said in Why can't I modify old project's .ui file?:

              <width>16</width>
              <height>16</height>

              There you have it. The mainWindow in QtDesigner has a 16x16 geometry. And this is what you see at the top left (the square). It's just too small to see everything, but as soon as you run the program, it is set up correctly

              MainWindow c'tor:

                  setMinimumSize(380, 450);
                  setMaximumSize(380, 450);
              

              The repo owner just threw all the widgets onto the mainWindow without any layout and size policies. The rest in done in code.

              So nothing is broken. If you want to modify something, you probably have to do it in the code file, because the ui file does pretty much nothing, except holding the unorganized widgets (LineEdit and two RadioButtons)


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              D 1 Reply Last reply
              3
              • Pl45m4P Pl45m4

                @D_Sharad said in Why can't I modify old project's .ui file?:

                <width>16</width>
                <height>16</height>

                There you have it. The mainWindow in QtDesigner has a 16x16 geometry. And this is what you see at the top left (the square). It's just too small to see everything, but as soon as you run the program, it is set up correctly

                MainWindow c'tor:

                    setMinimumSize(380, 450);
                    setMaximumSize(380, 450);
                

                The repo owner just threw all the widgets onto the mainWindow without any layout and size policies. The rest in done in code.

                So nothing is broken. If you want to modify something, you probably have to do it in the code file, because the ui file does pretty much nothing, except holding the unorganized widgets (LineEdit and two RadioButtons)

                D Offline
                D Offline
                D_Sharad
                wrote on last edited by
                #7

                @Pl45m4 Thank you very very much.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved