<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Marian,</p>
    <p>Just tell Qt that it shouldn't create the connection more than
      once using Qt::UniqueConnection.</p>
    <p>Cheers</p>
    <p>Matthias<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 10/2/17 5:30 PM, Tudorache, Marian
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:8dd62c7b2771462a86fb4b0a1cfc16e6@NCRMAIL3.corp.NAVCAN.CA">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Hi everyone,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I have connected the signal
          selectionChanged so some code, which is executed after
          features are selected.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">myLayer.selectionChanged.connect(self.executeAfterSelection)<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Then I have a method self.
          executeAfterSelection(self, featuresIds)<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The SIGNAl/SLOT tandem works but now I
          realized every time when I call
          <b>myLayer.selectionChanged.connect(self.executeAfterSelection)</b>
           It does not overwrite my previous call. It creates a second
          signa/slot tandem. During running the method
           executeAfterSelection is excuted twice, three times etc.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">How can I check if the SIGNAL
          selectionChanged is connected to the slot
          executeAfterSelection before I run
          myLayer.selectionChanged.connect(self.executeAfterSelection)?<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I tried this:<o:p></o:p></p>
        <p class="MsoNormal">receiversCount =
          QtCore.QObject.receivers(QtCore.SIGNAL(“selectionChanged()”)<o:p></o:p></p>
        <p class="MsoNormal">receiversCount =
          QtCore.QObject.receivers(QtCore.SIGNAL(“selectionChanged”)<o:p></o:p></p>
        <p class="MsoNormal">receiversCount =
          QtCore.QObject.receivers(QtCore.SIGNAL(“myLayer.selectionChanged()”)<o:p></o:p></p>
        <p class="MsoNormal">receiversCount =
          QtCore.QObject.receivers(QtCore.SIGNAL(“myLayer.selectionChanged”)<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Every time I get this error:<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">QObject.receivers(SIGNAL()): first argument
          of unbound method must have type ‘QObject’).<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Thanks,<o:p></o:p></p>
        <p class="MsoNormal">Marian<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <hr>
      <font size="1" color="Gray" face="Arial"><br>
        This electronic message, as well as any transmitted files
        included in the electronic message, may contain privileged or
        confidential information and is intended solely for the use of
        the individual(s) or entity to which it is addressed. If you
        have received this electronic message in error please notify the
        sender immediately and delete the electronic message. Any
        unauthorized copying, disclosure or distribution of the
        electronic message is strictly forbidden. NAV CANADA accepts no
        liability for any damage caused by any virus and/or other
        malicious code transmitted by this electronic communication.<br>
        <br>
        Le présent message électronique et tout fichier qui peut y être
        joint peuvent contenir des renseignements privilégiés ou
        confidentiels destinés à l’usage exclusif des personnes ou des
        organismes à qui ils s’adressent. Si vous avez reçu ce message
        électronique par erreur, veuillez en informer l’expéditeur
        immédiatement et supprimez le. Toute reproduction, divulgation
        ou distribution du présent message électronique est strictement
        interdite. NAV CANADA n’assume aucune responsabilité en cas de
        dommage causé par tout virus ou autre programme malveillant
        transmis par ce message électronique.<br>
      </font>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
    </blockquote>
    <br>
  </body>
</html>