<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thanks Alessandro :-)  <br>
    </p>
    <p>(I need some new reading glasses, or maybe a new brain. When you
      read the <i>Properties</i> -> <i>Information</i> tab for the
      layer, the needed information is shown in the tab with the prefix
      <i><b>Source</b>: </i>! It shouldn't be that hard for me to
      guess!!) <br>
    </p>
    <pre class="moz-signature" cols="72">Med venlig hilsen / Kind regards

Bo Victor Thomsen</pre>
    <div class="moz-cite-prefix">Den 29-04-2021 kl. 14:32 skrev
      Alessandro Pasotti:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAL5Q672BXYFRZd8fc2ET=a-_+rTXkiGS1x_xSkocr4G1SN2yYg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi Bo,</div>
        <div><br>
        </div>
        <div>
          <p style="margin:0px;text-indent:0px;white-space:pre-wrap">iface.activeLayer().source() should give you what you want.</p>
          <p style="margin:0px;text-indent:0px;white-space:pre-wrap">
</p>
          <p style="margin:0px;text-indent:0px;white-space:pre-wrap">
</p>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Thu, Apr 29, 2021 at 2:21
          PM Bo Victor Thomsen <<a
            href="mailto:bo.victor.thomsen@gmail.com"
            moz-do-not-send="true">bo.victor.thomsen@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi
          list -<br>
          <br>
          I have a (probably totally obvious, stupid) Pyhton question:<br>
          <br>
          I need the datasource URI string of a maplayer chosen by the
          user.<br>
          <br>
          I have found  the QgsMapLayer chosen by the user. And the
          QgsVectorLayer <br>
          associated with the Maplayer.<br>
          <br>
          How do I find the datasource string associated with the
          QgsVectorLayer?<br>
          <br>
          There is oodles of QGIS information about generating a vector
          layer from <br>
          a specific datasource. I need the opposite to generate a
          virtual layer <br>
          in Python using a join between the chosen layer with a another
          <br>
          predefined layer (which I have the datasource string for).<br>
          <br>
          -- <br>
          <br>
          Med venlig hilsen / Kind regards<br>
          <br>
          Bo Victor Thomsen<br>
          <br>
          _______________________________________________<br>
          QGIS-Developer mailing list<br>
          <a href="mailto:QGIS-Developer@lists.osgeo.org"
            target="_blank" moz-do-not-send="true">QGIS-Developer@lists.osgeo.org</a><br>
          List info: <a
            href="https://lists.osgeo.org/mailman/listinfo/qgis-developer"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
          Unsubscribe: <a
            href="https://lists.osgeo.org/mailman/listinfo/qgis-developer"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
        </blockquote>
      </div>
      <br clear="all">
      <br>
      -- <br>
      <div dir="ltr" class="gmail_signature">
        <div dir="ltr">
          <div>Alessandro Pasotti</div>
          <div>QCooperative:  <a href="https://www.qcooperative.net"
              target="_blank" moz-do-not-send="true">www.qcooperative.net</a><br>
          </div>
          ItOpen:   <a href="http://www.itopen.it" target="_blank"
            moz-do-not-send="true">www.itopen.it</a></div>
      </div>
    </blockquote>
  </body>
</html>