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. Rotate a QLine

Rotate a QLine

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 1.1k 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.
  • S Offline
    S Offline
    Sucharek
    wrote on last edited by
    #1

    Hi,

    I want to rotate a QLine, but I don't know how. I tried ui->line->setRoation() but thats not a valid command.
    Do you know how to rotate it?
    Thanks

    eyllanescE 1 Reply Last reply
    0
    • S Sucharek

      Hi,

      I want to rotate a QLine, but I don't know how. I tried ui->line->setRoation() but thats not a valid command.
      Do you know how to rotate it?
      Thanks

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @Sucharek Your question is unclear. QLine is not a visual element but only a container for information. Or do you mean a QGraphicsLineItem? setRoation OR setRotation?

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sucharek
        wrote on last edited by
        #3

        Hi, I meant rotating it from MainWindow
        6b41048d-ab18-424f-9b4a-b0ad6903a81c-image.png

        eyllanescE 1 Reply Last reply
        0
        • S Sucharek

          Hi, I meant rotating it from MainWindow
          6b41048d-ab18-424f-9b4a-b0ad6903a81c-image.png

          eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by
          #4

          @Sucharek Line is a custom widget and we don't know the code, if you want help provide the code for that class.

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sucharek
            wrote on last edited by
            #5

            I found the Line widget in the Display Widgets menu in Qt Creator.
            The Line widget isn't custom
            f978470c-19bd-491b-85ae-11f76c6a315a-image.png
            Sorry for the delay, I have to wait 600 second to post a reply

            eyllanescE 1 Reply Last reply
            0
            • S Sucharek

              I found the Line widget in the Display Widgets menu in Qt Creator.
              The Line widget isn't custom
              f978470c-19bd-491b-85ae-11f76c6a315a-image.png
              Sorry for the delay, I have to wait 600 second to post a reply

              eyllanescE Offline
              eyllanescE Offline
              eyllanesc
              wrote on last edited by
              #6

              @Sucharek Okay, those "Line" are actually QFrame and with these elements you won't be able to do any rotation. In this case you must create custom QWidget, override the paintEvent to make the custom paint and promote them if you want to use them through QtDesigner.

              If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

              1 Reply Last reply
              2
              • S Offline
                S Offline
                Sucharek
                wrote on last edited by
                #7

                Ok, but if I'd do that, will it lose a stretching (expanding) ability?
                If it does, is there an object (that I can make look like a line) that can rotate?

                D 1 Reply Last reply
                0
                • S Sucharek

                  Ok, but if I'd do that, will it lose a stretching (expanding) ability?
                  If it does, is there an object (that I can make look like a line) that can rotate?

                  D Offline
                  D Offline
                  Dan203
                  wrote on last edited by
                  #8

                  @Sucharek said in Rotate a QLine:

                  Ok, but if I'd do that, will it lose a stretching (expanding) ability?
                  If it does, is there an object (that I can make look like a line) that can rotate?

                  That's actually a frame. You can change it to vertical using...

                  setFrameShape(QFrame::VLine);

                  and back to horizontal using...

                  setFrameShape(QFrame::HLine);

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Sucharek
                    wrote on last edited by
                    #9

                    Hi, thanks for the response.
                    That was not what I was looking for, but I found another way.
                    I used QGraphicsScene.

                    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