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. How to Set the item has fixed line width(bigger 1 ) in QGraphicsView And not be transformed after view transformation changed?
QtWS25 Last Chance

How to Set the item has fixed line width(bigger 1 ) in QGraphicsView And not be transformed after view transformation changed?

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 1.6k 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.
  • joeQJ Offline
    joeQJ Offline
    joeQ
    wrote on last edited by joeQ
    #1

    i just want to use QGraphicsView and QGraphicsScene to show some item.

    but, i has some problem.

    i want to complete this function. like the following bmp file;

    alt text

    help me. thank u.

    Just do it!

    joeQJ 1 Reply Last reply
    0
    • FlotisableF Offline
      FlotisableF Offline
      Flotisable
      wrote on last edited by
      #2

      is the box border belong to the bmp file?

      joeQJ 2 Replies Last reply
      0
      • FlotisableF Flotisable

        is the box border belong to the bmp file?

        joeQJ Offline
        joeQJ Offline
        joeQ
        wrote on last edited by
        #3

        @Flotisable
        no, it is a QGraphicsRectItem

        Just do it!

        FlotisableF 1 Reply Last reply
        0
        • FlotisableF Flotisable

          is the box border belong to the bmp file?

          joeQJ Offline
          joeQJ Offline
          joeQ
          wrote on last edited by
          #4

          @Flotisable
          I want to use QGraphicsRectItem to come true it. but QGraphicsRectItem's line width was also zoomin after view zoomin.

          Just do it!

          1 Reply Last reply
          0
          • joeQJ joeQ

            @Flotisable
            no, it is a QGraphicsRectItem

            FlotisableF Offline
            FlotisableF Offline
            Flotisable
            wrote on last edited by
            #5

            @joeQ
            I remember you have find the solution

            how about set the QPen's width to 0 ?

            joeQJ 2 Replies Last reply
            0
            • FlotisableF Flotisable

              @joeQ
              I remember you have find the solution

              how about set the QPen's width to 0 ?

              joeQJ Offline
              joeQJ Offline
              joeQ
              wrote on last edited by
              #6

              @Flotisable
              I also find QPen::setCosmetic and GraphicsItem::ItemIgnoresTransformations. . I think, them can save my problem.

              I am testing these code now. hold on.

              Just do it!

              1 Reply Last reply
              0
              • FlotisableF Flotisable

                @joeQ
                I remember you have find the solution

                how about set the QPen's width to 0 ?

                joeQJ Offline
                joeQJ Offline
                joeQ
                wrote on last edited by
                #7

                @Flotisable

                Yes, But it caused another problem. I was crazy.

                Just do it!

                FlotisableF 1 Reply Last reply
                0
                • joeQJ joeQ

                  @Flotisable

                  Yes, But it caused another problem. I was crazy.

                  FlotisableF Offline
                  FlotisableF Offline
                  Flotisable
                  wrote on last edited by
                  #8

                  @joeQ
                  so what's the new problem?

                  joeQJ 1 Reply Last reply
                  0
                  • FlotisableF Flotisable

                    @joeQ
                    so what's the new problem?

                    joeQJ Offline
                    joeQJ Offline
                    joeQ
                    wrote on last edited by
                    #9

                    @Flotisable

                    First, I want to save this problem item line width also zoomed after view zoom, I find the solution.

                    But, this solution, caused another problem screen flashing. I was crazy at yesterday.

                    Today, I must to save the screen flashing. I don't know ho to save it. so, i think, i was wrong at the first step.

                    To fixed the line width(bigger 1), I used the wrong way at first.

                    I find the page now. It maybe can help me.

                    Just do it!

                    1 Reply Last reply
                    0
                    • joeQJ joeQ

                      i just want to use QGraphicsView and QGraphicsScene to show some item.

                      but, i has some problem.

                      i want to complete this function. like the following bmp file;

                      alt text

                      help me. thank u.

                      joeQJ Offline
                      joeQJ Offline
                      joeQ
                      wrote on last edited by
                      #10

                      @joeQ

                      I am so stupid. i cost two days to save it. tried some wrong way.

                      I found this doc helpful.

                      now, i list the key wrolds

                      1. QPen::setCosmetic
                      2. QGraphicsItem::ItemIgnoresTransformations

                      You can read them from Qt manual.

                      Just do it!

                      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