Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to zoom in/out all widgets in a GUI?
Forum Updated to NodeBB v4.3 + New Features

How to zoom in/out all widgets in a GUI?

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 2 Posters 665 Views 2 Watching
  • 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.
  • Y Offline
    Y Offline
    yohana
    wrote on last edited by
    #1
    This post is deleted!
    JonBJ 1 Reply Last reply
    0
    • Y yohana

      This post is deleted!

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @yohana
      Gosh! I don't know what you've done here :) But if you detect a zoom on a widget, why not emit() a signal with its zoom level and the other widgets can have a slot on that to set their own zoom level the same?

      Unless you can just detect the zoom outside the widget and then just call to zoom the others.

      Y 1 Reply Last reply
      0
      • JonBJ JonB

        @yohana
        Gosh! I don't know what you've done here :) But if you detect a zoom on a widget, why not emit() a signal with its zoom level and the other widgets can have a slot on that to set their own zoom level the same?

        Unless you can just detect the zoom outside the widget and then just call to zoom the others.

        Y Offline
        Y Offline
        yohana
        wrote on last edited by yohana
        #3

        @JonB Thanks a lot for your reply! You are right, this got too complicated...
        After reading your reply I have tried your suggestion. When I detect the zoom through zoomable(self.img1), I connect it to a slot (I created the function zoom_img1_detected) and I pass the parameters scalx and scaly. Since I do this inside the function image_Widget1 I get the error AttributeError: 'main_GUI' object has no attribute 'scalx' because scalx is defined in zoomable(), which belongs to a different class than main_GUI :(

        JonBJ 1 Reply Last reply
        0
        • Y yohana

          @JonB Thanks a lot for your reply! You are right, this got too complicated...
          After reading your reply I have tried your suggestion. When I detect the zoom through zoomable(self.img1), I connect it to a slot (I created the function zoom_img1_detected) and I pass the parameters scalx and scaly. Since I do this inside the function image_Widget1 I get the error AttributeError: 'main_GUI' object has no attribute 'scalx' because scalx is defined in zoomable(), which belongs to a different class than main_GUI :(

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @yohana
          I do not hear a mention of creating your own new signal for this and .emit()-ing it, and how you connect() that signal.

          I don't want to discourage you, but from your code it looks to me like your Python is all over the place. You have def zoomable method embedding a class Filter(QtCore.QObject) declaration which then goes on to have its own def eventFilter embedded method. I have no idea what/why you are trying to achieve here, but it would not surprise me if that leads to all sorts of problems like you report.

          I am not going to correct your code, but unless you have some deep reason this does not sound right at all. You may want to look at what you are doing from a Python point of view. I would have thought you should have no nested classes within def methods. Perhaps if you start by sorting all of that out things will fall into place more....

          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