A QWidget's width and height are always in pixel units. The mapping from QPainter coordinates to QWidget coordinates is one-to-one in pixels unless you have applied a scaling transformation to the QPainter.
Your code makes no sense. The for() loop repeatedly sets the x value, and when it exits, point.x() will always have the last value of i (that is, "something" - 1). And if "something" is capped at 30% of the width (converted to an integer, since "i" is an int), the last x that is assigned will be 30% of the width.
Bookmarks