Home > other >  About the QPainter: : scale
About the QPainter: : scale

Time:11-05

I want to ask how to use QPainter: : scale () the function realization of graphics? Such as the original drawing in CAD figure, own the same output particularly large, some show not to come out, how to narrow the coordinate system, let all the figure shown? Thank you for your attention!

CodePudding user response:

Maybe all you need is the scale in the QGraphicsView...

CodePudding user response:

Int minScaleFactorLen=qMin (this - & gt; Width (), and this - & gt; Height ()); Painter. Scale (minScaleFactorLen/actualLen, minScaleFactorLen/actualWidth); ActualLen and actual width is the actual pixel width of the length of your current system
  • Related