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
Forum Updated to NodeBB v4.3 + New Features

I keep getting errors

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 6 Posters 444 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.
  • Mahdir2111M Offline
    Mahdir2111M Offline
    Mahdir2111
    wrote on 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
    • Mahdir2111M Mahdir2111 marked this topic as a regular topic on
    • Grit ClefG Offline
      Grit ClefG Offline
      Grit Clef
      wrote on 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));
      
      Mahdir2111M 1 Reply Last reply
      5
      • Grit ClefG Grit Clef

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

        ui->output->setText(QString::number(randomnum));
        
        Mahdir2111M Offline
        Mahdir2111M Offline
        Mahdir2111
        wrote on 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));
        
        Christian EhrlicherC 1 Reply Last reply
        0
        • Mahdir2111M Mahdir2111

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

          int randomnum = rand() % 101;
              ui->output->setText(QString::number(randomnum));
          
          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 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 last edited by
            #5
            This post is deleted!
            jsulmJ 1 Reply Last reply
            0
            • E ellen

              This post is deleted!

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on 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
              • Mahdir2111M Offline
                Mahdir2111M Offline
                Mahdir2111
                wrote on 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'
                
                JonBJ 1 Reply Last reply
                0
                • Mahdir2111M Mahdir2111

                  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'
                  
                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on 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.

                  Mahdir2111M 1 Reply Last reply
                  1
                  • JonBJ JonB

                    @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.

                    Mahdir2111M Offline
                    Mahdir2111M Offline
                    Mahdir2111
                    wrote on last edited by
                    #9

                    @JonB

                    home = /Applications/Xcode.app/Contents/Developer/usr/bin
                    include-system-site-packages = false
                    version = 3.9.6
                    
                    JonBJ 1 Reply Last reply
                    0
                    • Mahdir2111M Mahdir2111

                      @JonB

                      home = /Applications/Xcode.app/Contents/Developer/usr/bin
                      include-system-site-packages = false
                      version = 3.9.6
                      
                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by
                      #10

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

                      1 Reply Last reply
                      0

                      • Login

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