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. manipulate the position of a tableview with an xml file
QtWS25 Last Chance

manipulate the position of a tableview with an xml file

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 967 Views
  • 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.
  • M Offline
    M Offline
    Mogli123
    wrote on last edited by
    #1

    Hi,

    I'm new in Qt and C++ and need some help.
    I have created some tableviews with the designer.
    Now i want to make it possible to change the position and the size of the tables with an xml file.

    This is my xml file so far.

    <?xml version="1.0" encoding="UTF-8"?>
    <manupulateUi>
    	<class>test_screen</class>
    	<widget class="QMainWindow" name"test_screen">
    		<widget class="QWidget" name="centralWidget">
    			<widget class="QLabel" name="label_2">
    				<property name="geometry">
    					<rect>
    						<x>830</x>
    						<y>10</y>
    					</rect>
    				</property>
    			</widget>
    		</widget>
    	</widget>
    </manupulateUi>
    

    Is that possible?
    Some example code for the explanation would be very helpful for me.

    Thank you.

    jsulmJ 1 Reply Last reply
    0
    • M Mogli123

      Hi,

      I'm new in Qt and C++ and need some help.
      I have created some tableviews with the designer.
      Now i want to make it possible to change the position and the size of the tables with an xml file.

      This is my xml file so far.

      <?xml version="1.0" encoding="UTF-8"?>
      <manupulateUi>
      	<class>test_screen</class>
      	<widget class="QMainWindow" name"test_screen">
      		<widget class="QWidget" name="centralWidget">
      			<widget class="QLabel" name="label_2">
      				<property name="geometry">
      					<rect>
      						<x>830</x>
      						<y>10</y>
      					</rect>
      				</property>
      			</widget>
      		</widget>
      	</widget>
      </manupulateUi>
      

      Is that possible?
      Some example code for the explanation would be very helpful for me.

      Thank you.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Mogli123 Sure it is possible. Don't put these tableviews into a layout and position/size them manually.
      You can find here examples for reading XML: http://doc.qt.io/qt-5/examples-xml.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • M Offline
        M Offline
        Mogli123
        wrote on last edited by Mogli123
        #3

        Thank you for your answer.

        Is my xml the right way to manage that?
        I'm not sure how to get the information from the xml to the tableview.
        What do you mean with "don't positon/size them manually"?
        Sorry for the many questions.

        mrjjM jsulmJ 2 Replies Last reply
        0
        • M Mogli123

          Thank you for your answer.

          Is my xml the right way to manage that?
          I'm not sure how to get the information from the xml to the tableview.
          What do you mean with "don't positon/size them manually"?
          Sorry for the many questions.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Mogli123
          Hi
          first of all. Questions are super ok here.
          Just make sure to try to make it as clear as possible
          what the goal is.

          So can we talk about
          why you need to be able to alter the position of the tables in the first place?
          and also is that the UI xml file or your own format/file?

          1 Reply Last reply
          1
          • M Offline
            M Offline
            Mogli123
            wrote on last edited by
            #5

            Thats my own xml.
            I have the basic format from the UI xml file.
            I need the tableviews for displaying data from a machine for the user.
            The user should have the possibility to change the position and the size of the tables without changing something in Qt.

            mrjjM 1 Reply Last reply
            0
            • M Mogli123

              Thats my own xml.
              I have the basic format from the UI xml file.
              I need the tableviews for displaying data from a machine for the user.
              The user should have the possibility to change the position and the size of the tables without changing something in Qt.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @Mogli123
              ok, the normal use of layout to make table follow window size cannot be used?
              you need multiple tables on the form in floating positions user select?

              The user must freely position the table on the form/window?

              Im asking as free placement is somewhat unusual. normally
              we use QSplitter and layouts to allow the user to size a section/area and
              sometimes QDockWidgets to have windows you can move around.

              1 Reply Last reply
              1
              • M Offline
                M Offline
                Mogli123
                wrote on last edited by
                #7

                @mrjj
                The tables look like this example.
                I have creat the tables with the designer and with layouts so far.
                The user shoud have the possibility to change the size and position but not with the designer.
                Why he should have that possibility I don't know. That was not my idea ;) .
                I'm trying it with xml because thats the only way I know to have the possibility to solve the problem.
                But I don't know how exactly.

                0_1539334379045_example.PNG

                1 Reply Last reply
                0
                • M Mogli123

                  Thank you for your answer.

                  Is my xml the right way to manage that?
                  I'm not sure how to get the information from the xml to the tableview.
                  What do you mean with "don't positon/size them manually"?
                  Sorry for the many questions.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Mogli123 said in manipulate the position of a tableview with an xml file:

                  don't positon/size them manually

                  That's not what I wrote, please reread

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    Mogli123
                    wrote on last edited by
                    #9

                    @jsulm

                    oh sorry for that

                    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