qt - Zooming a view in PyQt? -


i have simple tree application displays qtreeview inside of qmainwindow. want give user ability change magnification level of content (using spinbox likely), without changing underlying font size of text.

is there way without changing whole app qgraphicsscene? app showing good-old fashioned tree text, no graphics or fancy other wanting change magnification of view; hence, thinking switching graphics scene overkill.

or, wrong, , switching graphics scene simple way it?

note trimmed down version of app @ code review. contains sscce, bit long post here.

in site discussing how put widgets on scene, trolltech wrote (emphasis added):

i myself , several other trolls’ve spent time researching topic [how embed widget in qgraphicsscene]. it’s not trivial; solutions embedding widgets scene end several serious drawbacks. that’s why qt doesn’t have off-the-shelf solution this.

widgets cannot scaled or rotated, graphics items can.

this suggests cannot perform, in simple way, operations want on qwidget itself. is, perhaps need add scene, trying avoid. if answer, i'll accept , start new question if stuck doing that.

note found this question, pretty duplicate, , not have (accepted) answer.

related content

as suggested docs quoted trolltech in original question, there no built-in method zoom on view.

if goal avoid use of qgraphicsviews, simplest way separate size of font on screen, versus size of font saved or printed, have 2 fonts. 1 displayed on screen can call 'zoom', versus other saved/printed , call 'font size'.

i got idea qtcentre (in post added original post too):

http://www.qtcentre.org/threads/62745-zoom-a-view


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -