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. QtCreator shows fixed white background behind identifiers in python

QtCreator shows fixed white background behind identifiers in python

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
9 Posts 4 Posters 737 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.
  • K Offline
    K Offline
    karel_l
    wrote on last edited by
    #1

    Hi everyone!

    I have a problem that's been bothering me in QtCreator for a while. I thought it might be just insufficient python support in the old version I used to use but now I upgraded (to 4.5.2 with Ubuntu 18.04) and it's still there. As you can see on the screenshot below, code outside of the current scope has a darker grey background, but not for identifiers (vars, funcs etc.), those stay white. This happens only for python, other languages I sometimes touch (C++, JS, HTML) are fine.

    I went through my Editor settings and checked if I have the background colour hard-coded in any of the settings, but it doesn't seem like I do. Checked on the internet, no results. Anybody would know? Thanks!

    Screenshot

    Note: might be related, but maybe not, python is also "special" in that it doesn't quite "work" like other languages in QtCreator for me, besides the syntax and scope highlighting I don't have any features - no errors/warning by the editor, no "follow symbol" functionality, no matching bracket highlighting, etc...

    J.HilkJ aha_1980A 2 Replies Last reply
    0
    • K karel_l

      Hi everyone!

      I have a problem that's been bothering me in QtCreator for a while. I thought it might be just insufficient python support in the old version I used to use but now I upgraded (to 4.5.2 with Ubuntu 18.04) and it's still there. As you can see on the screenshot below, code outside of the current scope has a darker grey background, but not for identifiers (vars, funcs etc.), those stay white. This happens only for python, other languages I sometimes touch (C++, JS, HTML) are fine.

      I went through my Editor settings and checked if I have the background colour hard-coded in any of the settings, but it doesn't seem like I do. Checked on the internet, no results. Anybody would know? Thanks!

      Screenshot

      Note: might be related, but maybe not, python is also "special" in that it doesn't quite "work" like other languages in QtCreator for me, besides the syntax and scope highlighting I don't have any features - no errors/warning by the editor, no "follow symbol" functionality, no matching bracket highlighting, etc...

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hi @karel_l and welcome

      you should consider upgrading again, the current latest release of QtCreator is 4.10.2

      I believe, the official Qt for Python support was added after 4.5, so you should see significant changes, when you use the latest one.


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      2
      • K karel_l

        Hi everyone!

        I have a problem that's been bothering me in QtCreator for a while. I thought it might be just insufficient python support in the old version I used to use but now I upgraded (to 4.5.2 with Ubuntu 18.04) and it's still there. As you can see on the screenshot below, code outside of the current scope has a darker grey background, but not for identifiers (vars, funcs etc.), those stay white. This happens only for python, other languages I sometimes touch (C++, JS, HTML) are fine.

        I went through my Editor settings and checked if I have the background colour hard-coded in any of the settings, but it doesn't seem like I do. Checked on the internet, no results. Anybody would know? Thanks!

        Screenshot

        Note: might be related, but maybe not, python is also "special" in that it doesn't quite "work" like other languages in QtCreator for me, besides the syntax and scope highlighting I don't have any features - no errors/warning by the editor, no "follow symbol" functionality, no matching bracket highlighting, etc...

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi @karel_l,

        as @j.hilk said, you should update. 4.11 is around the corner, and Python support is gradually improving.

        Regards

        Qt has to stay free or it will die.

        1 Reply Last reply
        1
        • JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          Wait: Qt Creator (which I don't use) is now tackling Python syntax?! What about Python debugging??

          J.HilkJ 1 Reply Last reply
          0
          • JonBJ JonB

            Wait: Qt Creator (which I don't use) is now tackling Python syntax?! What about Python debugging??

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @JonB said in QtCreator shows fixed white background behind identifiers in python:

            What about Python debugging

            Is there such a thing?

            As far as I know, you can add (in QtC) the "-m trace —trace" as argument to the python call


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            JonBJ 1 Reply Last reply
            0
            • J.HilkJ J.Hilk

              @JonB said in QtCreator shows fixed white background behind identifiers in python:

              What about Python debugging

              Is there such a thing?

              As far as I know, you can add (in QtC) the "-m trace —trace" as argument to the python call

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @J-Hilk
              Don't know if you're being serious? PyCharm, which I used before, and VSCode Python, which I use now, have full interactive debugging in the IDEs, just like Qt Creator does for C++/gdb etc.

              I'm talking about for developing Qt stuff via PySide2 & Python, in case there's any misunderstanding.

              Python is bad enough as it is. You (I) certainly want full-featured visual debugging as for C++...!

              J.HilkJ 1 Reply Last reply
              0
              • JonBJ JonB

                @J-Hilk
                Don't know if you're being serious? PyCharm, which I used before, and VSCode Python, which I use now, have full interactive debugging in the IDEs, just like Qt Creator does for C++/gdb etc.

                I'm talking about for developing Qt stuff via PySide2 & Python, in case there's any misunderstanding.

                Python is bad enough as it is. You (I) certainly want full-featured visual debugging as for C++...!

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                @JonB You have to excuse me, but my contact with python is limited to a horrible time during university and a (somewhat) working environment on my Mac to test stuff.

                Never bothered with actual debugging.

                But hitting the debug run in QtCreator actually starts a Python debugger and holds on the first line, with information etc.

                4433891f-c62d-4c45-802b-bc48882d1dc5-image.png


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                JonBJ 1 Reply Last reply
                2
                • J.HilkJ J.Hilk

                  @JonB You have to excuse me, but my contact with python is limited to a horrible time during university and a (somewhat) working environment on my Mac to test stuff.

                  Never bothered with actual debugging.

                  But hitting the debug run in QtCreator actually starts a Python debugger and holds on the first line, with information etc.

                  4433891f-c62d-4c45-802b-bc48882d1dc5-image.png

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @J-Hilk
                  Of course I excuse you, I genuinely didn't know if you were messing about in your reply like I do :)

                  Then it does look like Creator has debugging support, as well as syntax. That's all new to me.

                  Hmmm. Because Creator didn't do Python a while back (probably pre PySide2), I had to do all work in PyCharm, and now for new project VSCode Python. These are good for editing & debugging, but if you want to use the Qt Designer for the UI you have to do pyuic step separately, not integrated. Which is a pain.

                  From Creator it would all be integrated. Unfortunately I don't think its support for Python editing/debugging will be good enough yet for me/this project, but it's interesting to know it's heading that way...

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    karel_l
                    wrote on last edited by
                    #9

                    Beautiful, not everything is perfect (bracket highlighting, symbol following, etc.) but the highlighting is functional now, as well as code completion, thanks a lot! And as a bonus I now have also much better support of JavaScript, yay! :)

                    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