In the code of class moderncv, style classic you can find an if-then-else construct checking if a \photo is defined (printing it) or not (doing nothing). I added inside the empty case a new if-then-else testing, if a new command \qrphoto is defined. If it is defined the code prints it, in the other case it does nothing.
The new command for the \qrphoto is:
\NewDocumentCommand{\qrphoto}{O{64pt}O{0.4pt}m}{\def\@qrphotowidth{#1}\def\@qrphotoframewidth{#2}\def\@qrphoto{#3}}
With this command I define the needed values \@qrphotowidth etc. for later usage.
Now we can patch the original command with
\patchcmd{\makecvhead}%
{%
\ifthenelse{\isundefined{\@photo}}{}%
}% code to patch
{% new code <=========================================================
\ifthenelse{\isundefined{\@photo}}%
{%
\ifthenelse{\isundefined{\@qrphoto}}%
{}%
{%
\if@left%
\hspace*{\separatorcolumnwidth}\fi%
\color{black}% <======================== to get a black qrcode
\setlength{\fboxrule}{\@qrphotoframewidth}%
\ifdim\@qrphotoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
\raisebox{1cm}{\framebox{\qrcode[hyperlink,height=\@qrphotowidth]{\@qrphoto}}}
}
}%
}% end new code <=====================================================
{}% success
{\fail}% failure
The command \raisebox[1cm] is needed to get the qr-code on the right position (I did not search for the reason, why I need it here. The used value is okay for sizes of the resulting qr-code of 2cm (I used for the example code) or more. If your qr-code should be smaller you need to change my used value of 1cm to a lower value. You will have to try it out.
As you can see I deleted the command \includegraphics. With command \qrphoto \qrcode... from package qrcode.
With the command
\qrphoto[2cm][0.5pt]{https://tex.stackexchange.com/questions/474546/}
for example you can add an qr-code-image with a hight and width of 2cm, a frame around it with a line of 0.5pt and the content of the qr-code-image is https://tex.stackexchange.com/questions/474546/ (this question).
So with the following complete MWE
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\usepackage{graphicx}
\usepackage{qrcode}
\firstname{John}
\familyname{Doe}
\address{83 Fancy Avenue}{Noweheresville}{Gotham City 24061}
\phone[mobile]{123 456 7890}
\email{someone@xyz.com}
\makeatletter
\NewDocumentCommand{\qrphoto}{O{64pt}O{0.4pt}m}{\def\@qrphotowidth{#1}\def\@qrphotoframewidth{#2}\def\@qrphoto{#3}}
% to patch the code of moderncv, version 2.0.0
%\usepackage{etoolbox} % already loaded in moderncv <===================
\patchcmd{\makecvhead}%
{%
\ifthenelse{\isundefined{\@photo}}{}%
}% code to patch
{% new code <=========================================================
\ifthenelse{\isundefined{\@photo}}%
{%
\ifthenelse{\isundefined{\@qrphoto}}%
{}%
{%
\if@left%
\hspace*{\separatorcolumnwidth}\fi%
\color{black}% <======================== to get a black qrcode
\setlength{\fboxrule}{\@qrphotoframewidth}%
\ifdim\@qrphotoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
\raisebox{1cm}{\framebox{\qrcode[hyperlink,height=\@qrphotowidth]{\@qrphoto}}}
}
}%
}% end new code <=====================================================
{}% success
{\fail}% failure
\makeatother
%\photo[64pt][0.5pt]{example-image}
\qrphoto[2cm][0.5pt]{https://tex.stackexchange.com/questions/474546/} %
\begin{document}
\makecvtitle
\end{document}
you get the following result:

Please note that you can only print a photo or a qr-code. If you have a defined \photo and \qrphoto only the photo is printed!
qrcodepackage? I don't think moderncv loads it, or at least it didn't last time I checked, which was a few years ago – Chris H Feb 12 '19 at 16:51MWEforgot to include it. Updated themwesuitably. The errror is not due to this. – Dr Krishnakumar Gopalakrishnan Feb 12 '19 at 16:52\photois a graphics file, not a LaTeX command. Have you tried to compile the qrcode to a pdf file, and to include the latter? – Feb 12 '19 at 16:59\phototo accept both LaTeX commands as well as as image file paths? – Dr Krishnakumar Gopalakrishnan Feb 12 '19 at 17:01qr codein the future, I have to remember to re-compile the qr code image. That's tedious and error-prone. At the very least can we have one single compilation that automatically updates the image whenever theqrcodecommand arguments are updated? – Dr Krishnakumar Gopalakrishnan Feb 12 '19 at 17:03grep photo /usr/local/texlive/2018/texmf-dist/tex/latex/moderncv/to see how the photo is used. It will require a substantial surgery to redefine the command, but it is certainly not impossible. The question is whether or not you want to do this major surgery. It would have been probably more elegant if the definition read\NewDocumentCommand{\photo}{O{64pt}O{0.4pt}m}{\def\@photowidth{#1}\def\@photoframewidth{#2}\def\@photo{\includegraphics{#3}}}and then all\includegraphicswould have been stripped off from where\@photois used. – Feb 12 '19 at 17:09standalonefor this purpose? – Dr Krishnakumar Gopalakrishnan Feb 12 '19 at 17:20externalize. Or hack the\photocommand, which I personally wouldn't do. – Feb 12 '19 at 17:47