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. How to generate QR code in Cpp ?
Forum Update on Monday, May 27th 2025

How to generate QR code in Cpp ?

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 4.6k Views
  • 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.
  • S Offline
    S Offline
    Saikumar
    wrote on last edited by
    #1

    I would like to generate QR code by taking string input from the user. Can anyone suggest reference for the QR code and also how to dowload pods.pri file.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      you could use an existing library
      https://github.com/fukuchi/libqrencode

      • how to dowload pods.pri file.

      I have zero idea what pods.pri files are :)

      S 1 Reply Last reply
      1
      • mrjjM mrjj

        Hi
        you could use an existing library
        https://github.com/fukuchi/libqrencode

        • how to dowload pods.pri file.

        I have zero idea what pods.pri files are :)

        S Offline
        S Offline
        Saikumar
        wrote on last edited by
        #3

        @mrjj
        I have downloaded libqrencode file already. But getting errors.
        [0_1514451884337_mainwindow.cpp](Uploading 100%)
        Errors screenshot :0_1514451857269_error1.png

        S 1 Reply Last reply
        0
        • S Saikumar

          @mrjj
          I have downloaded libqrencode file already. But getting errors.
          [0_1514451884337_mainwindow.cpp](Uploading 100%)
          Errors screenshot :0_1514451857269_error1.png

          S Offline
          S Offline
          Saikumar
          wrote on last edited by
          #4

          @Saikumar
          My Program :
          0_1514452014293_img1.png 0_1514452019517_img2.png

          1 Reply Last reply
          0
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by mrjj
            #5

            Hi
            You both have Mainwindow AND QWidget in constructor that seems odd.?
            alt text

            S 1 Reply Last reply
            0
            • mrjjM mrjj

              Hi
              You both have Mainwindow AND QWidget in constructor that seems odd.?
              alt text

              S Offline
              S Offline
              Saikumar
              wrote on last edited by
              #6

              @mrjj
              I have removed that line then also I am getting errors...
              Mainly on data variable name

              mrjjM 1 Reply Last reply
              0
              • S Saikumar

                @mrjj
                I have removed that line then also I am getting errors...
                Mainly on data variable name

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Saikumar
                what data variable ?
                the
                data.toStdString() one ?

                should just be a member
                QString data of mainwindow it seems.

                S 1 Reply Last reply
                0
                • mrjjM mrjj

                  @Saikumar
                  what data variable ?
                  the
                  data.toStdString() one ?

                  should just be a member
                  QString data of mainwindow it seems.

                  S Offline
                  S Offline
                  Saikumar
                  wrote on last edited by
                  #8

                  @mrjj
                  It's taking it as QWidgetData private variable that's why it is giving mainwindow doesn't have any data variable name. How to resolve this problem. Getting conflict on the data . It's saying data is private variable. But when assigning getting error Qstring can't be convert to QWidgetData type on this line this->data=data .

                  mrjjM 1 Reply Last reply
                  0
                  • S Saikumar

                    @mrjj
                    It's taking it as QWidgetData private variable that's why it is giving mainwindow doesn't have any data variable name. How to resolve this problem. Getting conflict on the data . It's saying data is private variable. But when assigning getting error Qstring can't be convert to QWidgetData type on this line this->data=data .

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @Saikumar
                    Hi
                    I think there is a name conflict between a string name data and something else
                    please rename your data string.

                    S 1 Reply Last reply
                    1
                    • mrjjM mrjj

                      @Saikumar
                      Hi
                      I think there is a name conflict between a string name data and something else
                      please rename your data string.

                      S Offline
                      S Offline
                      Saikumar
                      wrote on last edited by
                      #10

                      @mrjj
                      Hii,
                      I have created data variable in my program.
                      Its working now.

                      Thank you.

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved