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

  • SEARCH
  • Home
  • 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 7861895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:55:20+00:00 2026-06-02T22:55:20+00:00

I have a custom class derived from QGraphicsPixmapItem. Its called GraphPixmapItemCustom and it’s overloaded

  • 0

I have a custom class derived from QGraphicsPixmapItem. Its called GraphPixmapItemCustom and it’s overloaded method is:

void GraphPixmapItemCustom::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
    QGraphicsPixmapItem::mousePressEvent(event);
    GraphMarkItemCustom *ptr;

    if(event->button() == Qt::RightButton)
    {        
        qDebug("Before emit");
        emit addPoint(QPointF(event->pos().x(), event->pos().y()));
        qDebug("After emit");

        markList.append(new GraphMarkItemCustom(QPointF(event->pos().x(), event->pos().y())));
        ptr = markList.last();
        markGroup->addToGroup(ptr);
        //this->scene()->addItem(ptr);
    }
}

the signal is declared at header:

signals:
    void addPoint(QPointF position);

In main class that has a pointer to object of class GraphPixmapItemCustom called

private:
   GraphPixmapItemCustom *pixItemRGB; 

and in the main class I have a slot called:

private slots:
   void pointAdd(QPointF position);

In the main class constructor I have a connection:

connect(pixItemRGB, SIGNAL(addPoint(QPointF)), this, SLOT(pointAdd(QPointF)));

In the slot I have only qDebug("YUPPY IT ACTUALLY WORKS!");

But the slot is not beeing fired. Why? I have deleted all moc files and everything that didn’t have to be there. So only .pro, .h and .cpp files along with .ui forms where neccesary were left.

I have checked most hits at Google. What is the best (I’m not sured – maybe i modified something) that it worked! I remember the working effects of this connection. Help!

  • 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-06-02T22:55:21+00:00Added an answer on June 2, 2026 at 10:55 pm

    You have to connect the signal after creating the GraphPixmapItemCustom object with the new operator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom class say 'MyCanvas' derived from wpf Canvas class. MyCanvas has
I have a class derived from TreeviewItem(Custom TreeViewItem) which is used by a class
I have a custom control derived from Button: class MyControl : Button{} And suppose,
I have a class derived from JTree with custom TreeCellRenderers. I have implemented drag
I have a class derived from slider which uses a custom control template and
I have a custom observer class derived from CBase , MConnectionMonitorObserver , and QObject
I have created a custom class derived from Canvas, which contain elements which will
I have a custom class that is derived from userControl, it describes what features
I have two simple custom controls derived from standard WPF controls. I.e. internal class
I have a custom control that i have derived from the Control class. I

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.