Results 1 to 2 of 2

Thread: Mouse magnifying-glass?

  1. #1
    Join Date
    Jan 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question Mouse magnifying-glass?

    hey!

    I am using PyQt and would like to have an mouse-cursor that like this one:

    http://static.rbytes.net/fullsize_sc...-glass-pro.jpg (i do not need any transparency thou, just a basic zoom)

    i'm quite new to Qt, so do i need to do this all from scratch or are there any good tipps for me to get to a quick solution? I tried google but did not find what i'm looking for (for sure i am not the only one wanting a mouse-zoom-cursor, am i?)

    THANKS!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Mouse magnifying-glass?

    For a quick start have a look at QPixmap::grabWidget(), QPixmap::grabWindow() and QWidget::render(). It's a good guess something like this would work (it's C++ but you can translate it to python easily):

    Qt Code:
    1. QPixmap px(twice_the_width_to_be_zoomed, twice_the_height_to_be_zoomed);
    2. QPainter painter(&px);
    3. painter.scale(2,2); // scale up the result twice in each direction
    4. widget->render(painter, ...);
    To copy to clipboard, switch view to plain text mode 

    Then just show the resulting pixmap where you want it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Creating a Glass Button using QTcreator C++
    By nhs_0702 in forum Qt Programming
    Replies: 2
    Last Post: 14th May 2010, 05:26
  2. Replies: 3
    Last Post: 12th May 2010, 13:11
  3. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13
  4. set mouse pos
    By mickey in forum Qt Programming
    Replies: 1
    Last Post: 25th April 2006, 23:50

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.