Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. A signal was received from inner QHash
Forum Updated to NodeBB v4.3 + New Features

A signal was received from inner QHash

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 475 Views 1 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.
  • A Offline
    A Offline
    Aaron Kim
    wrote on last edited by Aaron Kim
    #1

    0_1535613992125_capture.PNG

    Mat remainPixelsInCircle(const Point& center, int radian, Mat matrix){
        Mat result = matrix.clone();
        result = Mat::zeros(result.rows, result.cols, result.type());
        QSet<QPair<int, int>> dataPixels;
        findDataPixels(matrix, dataPixels);
        QMutableSetIterator<QPair<int, int>> iter(dataPixels);
        while(iter.hasNext()){
            auto next = iter.next();
            if(std::pow(next.first - center.x, 2) + std::pow(next.second - center.y, 2) <= std::pow(radian, 2)){
                uchar* data = result.ptr<uchar>(next.second);
                data[(next.first) * 3 + 0] = 255;
                data[(next.first) * 3 + 1] = 255;
                data[(next.first) * 3 + 2] = 255;
            }
        }
        return result;
    }
    

    It seems that the signal was sent from a destructor of QSet. But I have no idea what happens inside.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      Why do you use QMutableSetIterator? I don't see where you modify the set...

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Aaron Kim
        wrote on last edited by
        #3

        @Asperamanca I left it even after I removed the code part which modifies the set. I solved it after I changed it to normal iterator. Thanks!

        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