Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6834541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:07:26+00:00 2026-05-26T23:07:26+00:00

In this example: http://www.java2s.com/Code/Cpp/Qt/InteractwithQGraphicsItem.htm the itemChange() function is where all of the updating work

  • 0

In this example:
http://www.java2s.com/Code/Cpp/Qt/InteractwithQGraphicsItem.htm

the itemChange() function is where all of the updating work takes place. However, this function doesn’t seem to be called when I move the handles around. According to:

http://doc.qt.io/qt-4.8/qgraphicsitem.html#itemChange

it should be called whenever the state changes, which I would imagine would include the position. Can anyone explain how to make this function get called when the handles are moved?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:07:27+00:00Added an answer on May 26, 2026 at 11:07 pm

    From the qt documentation check the QGraphicsItem::ItemPositionChange:

    The item’s position changes. This notification is sent if the
    ItemSendsGeometryChanges flag is enabled, and when the item’s local
    position changes, relative to its parent (i.e., as a result of calling
    setPos() or moveBy()). The value argument is the new position (i.e., a
    QPointF). You can call pos() to get the original position. Do not call
    setPos() or moveBy() in itemChange() as this notification is
    delivered;
    instead, you can return the new, adjusted position from
    itemChange(). After this notification, QGraphicsItem immediately sends
    the ItemPositionHasChanged notification if the position changed.

    So you should enable the flag QGraphicsItem::ItemSendsGeometryChanges in order to have the itemChange called when the position changes.

    By default this is disabled for optimization:

    For performance reasons, these notifications are disabled by default.
    You must enable this flag to receive notifications for position and
    transform changes.
    This flag was introduced in Qt 4.6.

    In order to set a flag you should call the setFlag function preferably in the constructor of your custom item.

    item->setFlag(GraphicsItem::ItemSendsGeometryChanges);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I looked at this site example: http://www.codesampler.com/dx9src/dx9src_6.htm But the code is rather weird: it
I have tried this example http://www.bennadel.com/blog/1056-ColdFusion-CFPOP-My-First-Look.htm , but it retrieve emails from POP server.
if(strpos(http://www.example.com,http://www.)==0){ // do work} I'd expect this to resolve as true, which it does.
example: at this domain http://www.example.com/234234/go.html is only one iframe-code how can i get the
I'm trying to modify this example: http://www.extjs.com/deploy/dev/examples/writer/writer.html to make the all fields in the
I want to Run surround query . Downloading from http://www.java2s.com/Code/Jar/JKL/Downloadlucenesurround241jar.htm Moved the lucene-surround-2.4.1.jar to
I'm following this example: http://www.codinghorror.com/blog/2005/12/getting-started-with-indexing-service.html However, the conversion to dataset shows empty columns for
Take a look at this example: http://www.extjs.com/deploy/dev/examples/multiselect/multiselect-demo.html On it, there are components rendered against
I'm using this plugin: http://www.jeremymartin.name/projects.php?project=kwicks And my code follows this example: http://www.jeremymartin.name/examples/kwicks.php?example=7 I'm using
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.