Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. I keep getting errors

I keep getting errors

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 6 Posters 418 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.
  • M Offline
    M Offline
    Mahdir2111
    wrote on 23 Jan 2025, 02:44 last edited by Mahdir2111
    #1

    I keep getting these error:

    "reference to type 'const QString' could not bind to an lvalue of type 'int'."
    

    Is there anything wrong with my code:

    int randomnum = rand() % 101;
        ui->output->setText(randomnum);
    
    1 Reply Last reply
    0
    • M Mahdir2111 marked this topic as a regular topic on 23 Jan 2025, 02:45
    • G Offline
      G Offline
      Grit Clef
      wrote on 23 Jan 2025, 05:57 last edited by Grit Clef
      #2

      You shouldn't use an 'int' as the argument of 'setText'. Instead, you should use

      ui->output->setText(QString::number(randomnum));
      
      M 1 Reply Last reply 23 Jan 2025, 21:39
      5
      • G Grit Clef
        23 Jan 2025, 05:57

        You shouldn't use an 'int' as the argument of 'setText'. Instead, you should use

        ui->output->setText(QString::number(randomnum));
        
        M Offline
        M Offline
        Mahdir2111
        wrote on 23 Jan 2025, 21:39 last edited by Mahdir2111
        #3

        @Grit-Clef I still get the same error, Here's my code:

        int randomnum = rand() % 101;
            ui->output->setText(QString::number(randomnum));
        
        C 1 Reply Last reply 24 Jan 2025, 05:14
        0
        • M Mahdir2111
          23 Jan 2025, 21:39

          @Grit-Clef I still get the same error, Here's my code:

          int randomnum = rand() % 101;
              ui->output->setText(QString::number(randomnum));
          
          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 24 Jan 2025, 05:14 last edited by
          #4

          @Mahdir2111 said in I keep getting errors:

          I still get the same error,

          For sure not.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          2
          • E Offline
            E Offline
            ellen
            wrote on 24 Jan 2025, 05:24 last edited by
            #5
            This post is deleted!
            J 1 Reply Last reply 24 Jan 2025, 06:13
            0
            • E ellen
              24 Jan 2025, 05:24

              This post is deleted!

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 24 Jan 2025, 06:13 last edited by
              #6

              @ellen What are you talking about? Your post is not related to the topic of this thread.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • M Offline
                M Offline
                Mahdir2111
                wrote on 26 Jan 2025, 00:03 last edited by
                #7

                also a get a error when running a app with pyside6:

                Fatal Python error: init_import_site: Failed to import the site module
                Python runtime state: initialized
                Traceback (most recent call last):
                  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site.py", line 621, in <module>
                    main()
                  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site.py", line 604, in main
                    known_paths = venv(known_paths)
                  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site.py", line 522, in venv
                    with open(virtual_conf, encoding='utf-8') as f:
                PermissionError: [Errno 1] Operation not permitted: '/Users/a-user/Documents/Qt/Mathcalcpy/.qtcreator/Python_3_9_6venv/pyvenv.cfg'
                
                J 1 Reply Last reply 26 Jan 2025, 09:02
                0
                • M Mahdir2111
                  26 Jan 2025, 00:03

                  also a get a error when running a app with pyside6:

                  Fatal Python error: init_import_site: Failed to import the site module
                  Python runtime state: initialized
                  Traceback (most recent call last):
                    File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site.py", line 621, in <module>
                      main()
                    File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site.py", line 604, in main
                      known_paths = venv(known_paths)
                    File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site.py", line 522, in venv
                      with open(virtual_conf, encoding='utf-8') as f:
                  PermissionError: [Errno 1] Operation not permitted: '/Users/a-user/Documents/Qt/Mathcalcpy/.qtcreator/Python_3_9_6venv/pyvenv.cfg'
                  
                  J Online
                  J Online
                  JonB
                  wrote on 26 Jan 2025, 09:02 last edited by
                  #8

                  @Mahdir2111 said in I keep getting errors:

                  PermissionError: [Errno 1] Operation not permitted: '/Users/a-user/Documents/Qt/Mathcalcpy/.qtcreator/Python_3_9_6venv/pyvenv.cfg'

                  Start by verifying what the permissions, owner and group are on that file.

                  M 1 Reply Last reply 26 Jan 2025, 14:53
                  1
                  • J JonB
                    26 Jan 2025, 09:02

                    @Mahdir2111 said in I keep getting errors:

                    PermissionError: [Errno 1] Operation not permitted: '/Users/a-user/Documents/Qt/Mathcalcpy/.qtcreator/Python_3_9_6venv/pyvenv.cfg'

                    Start by verifying what the permissions, owner and group are on that file.

                    M Offline
                    M Offline
                    Mahdir2111
                    wrote on 26 Jan 2025, 14:53 last edited by
                    #9

                    @JonB

                    home = /Applications/Xcode.app/Contents/Developer/usr/bin
                    include-system-site-packages = false
                    version = 3.9.6
                    
                    J 1 Reply Last reply 26 Jan 2025, 14:58
                    0
                    • M Mahdir2111
                      26 Jan 2025, 14:53

                      @JonB

                      home = /Applications/Xcode.app/Contents/Developer/usr/bin
                      include-system-site-packages = false
                      version = 3.9.6
                      
                      J Online
                      J Online
                      JonB
                      wrote on 26 Jan 2025, 14:58 last edited by
                      #10

                      @Mahdir2111 That doesn't address any of the questions. Up to you.

                      1 Reply Last reply
                      0

                      10/10

                      26 Jan 2025, 14:58

                      • Login

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