Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. German
  4. In QML was spricht gegen diese Schreibweise: Text{ Text{} }
Forum Updated to NodeBB v4.3 + New Features

In QML was spricht gegen diese Schreibweise: Text{ Text{} }

Scheduled Pinned Locked Moved Solved German
11 Posts 3 Posters 1.7k 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.
  • G Galilio

    Hallo Zusammen,

    Was spricht gegen diese Schreibweise:

    Text {
        .....
        Text {
         ....
        }
    }
    
    J.HilkJ Offline
    J.HilkJ Offline
    J.Hilk
    Moderators
    wrote on last edited by
    #2

    @Galilio
    nichts,
    funzt einwandfrei

    4f071e7d-f823-422a-97f2-15067c75b4e1-image.png


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      Galilio
      wrote on last edited by
      #3

      @J-Hilk
      Danke für die Antwort
      was mir stört ist folgende:

      Text {
          x: 10
      	y: 20
      	font:....
      	color:....
      	text:.....
      	Text {
      	    x: 30
      		y: -20   // diese negativen Zahl stört
      		font: ...
      		color: ...
      		text: ..
      	}
      }
      

      Aus der Applicationssicht muss ich dieses zahl negative haben, damit der Text richtig positioniert wird.
      Gibt es eine andere Möglichkeit diese zu vermeiden?

      Danke

      J.HilkJ 1 Reply Last reply
      0
      • G Galilio

        @J-Hilk
        Danke für die Antwort
        was mir stört ist folgende:

        Text {
            x: 10
        	y: 20
        	font:....
        	color:....
        	text:.....
        	Text {
        	    x: 30
        		y: -20   // diese negativen Zahl stört
        		font: ...
        		color: ...
        		text: ..
        	}
        }
        

        Aus der Applicationssicht muss ich dieses zahl negative haben, damit der Text richtig positioniert wird.
        Gibt es eine andere Möglichkeit diese zu vermeiden?

        Danke

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #4

        @Galilio
        das kommt darauf an, was genau versuchst du zu erreichen?


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Galilio
          wrote on last edited by
          #5

          @J-Hilk
          Zwei Texte untereinander darzustellen

          J.HilkJ 1 Reply Last reply
          0
          • G Galilio

            @J-Hilk
            Zwei Texte untereinander darzustellen

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #6

            @Galilio wenn Text 2 ein Kind von Text1 ist, und du willst Text2 über(y) Text1 anzeigen, geht kein Weg um eine negative Zahl


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            G 1 Reply Last reply
            0
            • J.HilkJ J.Hilk

              @Galilio wenn Text 2 ein Kind von Text1 ist, und du willst Text2 über(y) Text1 anzeigen, geht kein Weg um eine negative Zahl

              G Offline
              G Offline
              Galilio
              wrote on last edited by
              #7

              @J-Hilk said in In QML was spricht gegen diese Schreibweise: Text{ Text{} }:

              wenn Text 2 ein Kind von Text1 ist, und du willst Text2 über(y) Text1 anzeigen, geht kein Weg um eine negative Zahl

              du meinst ohne ?

              J.HilkJ 1 Reply Last reply
              0
              • G Galilio

                @J-Hilk said in In QML was spricht gegen diese Schreibweise: Text{ Text{} }:

                wenn Text 2 ein Kind von Text1 ist, und du willst Text2 über(y) Text1 anzeigen, geht kein Weg um eine negative Zahl

                du meinst ohne ?

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #8

                @Galilio ohne, oder um ... herum :D


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                G 1 Reply Last reply
                0
                • J.HilkJ J.Hilk

                  @Galilio ohne, oder um ... herum :D

                  G Offline
                  G Offline
                  Galilio
                  wrote on last edited by
                  #9

                  @J-Hilk

                  danke :-)

                  Was kann ich statt:

                  Text {
                        ....
                        Text {
                           .....
                        }
                  }
                  

                  und um die negative Zahl zu vermeiden am besten benutzen?

                  J.HilkJ KroMignonK 2 Replies Last reply
                  0
                  • G Galilio

                    @J-Hilk

                    danke :-)

                    Was kann ich statt:

                    Text {
                          ....
                          Text {
                             .....
                          }
                    }
                    

                    und um die negative Zahl zu vermeiden am besten benutzen?

                    J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by
                    #10

                    @Galilio ich würde vorschlagen, sie Geschwister zu machen (also einfach untereinander) und mit dem anchor property die auszurichten

                    Window {
                        id: window
                    
                        width: 80
                        height: 120
                    
                        visible: true
                    
                        Text {
                            id: t1
                            anchors{
                                top: parent.top
                                topMargin: 20
                                left: parent.left
                                leftMargin: 10
                            }
                    
                            text: qsTr("text1")
                    
                            horizontalAlignment: Text.AlignLeft
                            verticalAlignment: Text.AlignVCenter
                    
                        }
                        Text{
                            id:t2
                            anchors{
                                top: t1.bottom
                                topMargin: 20
                                left: parent.left
                                leftMargin: 10
                            }
                            text: qsTr("text2")
                            horizontalAlignment: Text.AlignLeft
                            verticalAlignment: Text.AlignVCenter
                        }
                    }
                    

                    6ca3fff5-3743-4d3c-984c-b9322648b2f2-image.png


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    1 Reply Last reply
                    1
                    • G Galilio

                      @J-Hilk

                      danke :-)

                      Was kann ich statt:

                      Text {
                            ....
                            Text {
                               .....
                            }
                      }
                      

                      und um die negative Zahl zu vermeiden am besten benutzen?

                      KroMignonK Offline
                      KroMignonK Offline
                      KroMignon
                      wrote on last edited by
                      #11

                      @Galilio said in In QML was spricht gegen diese Schreibweise: Text{ Text{} }:

                      und um die negative Zahl zu vermeiden am besten benutzen?

                      Warum nicht einfach ColumnLayout benutzen?

                      Window {
                          id: window
                      
                          width: 80
                          height: 120
                      
                          visible: true
                      
                          ColumnLayout {
                              width: parent.width
                              spacing: 20
                              Text {        
                                  id: t1
                                  text: qsTr("text1")
                                  horizontalAlignment: Text.AlignLeft
                                  verticalAlignment: Text.AlignVCenter
                              }
                              Text {        
                                  id: t2
                                  text: qsTr("text2")
                                  horizontalAlignment: Text.AlignLeft
                                  verticalAlignment: Text.AlignVCenter
                              }
                          }
                      }
                      

                      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                      1 Reply Last reply
                      1

                      • Login

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