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. Is there any way to set the default parse context in Qt Creator?

Is there any way to set the default parse context in Qt Creator?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 2 Posters 597 Views 2 Watching
  • 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.
  • Guy GizmoG Offline
    Guy GizmoG Offline
    Guy Gizmo
    wrote on last edited by Guy Gizmo
    #1

    I'm working on a project with four different subprojects, one of which only includes Qt Core and barely any of my header files. Unfortunately it's the one that is always chosen by default to be the parse context for every single one of my source files! This makes nearly every feature for highlighting and following symbols break until I manually change the parse context to the right subproject. I have hundreds of source files, so this is constantly bugging me.

    Is there a way I can specify that a different subproject be the default parse context for my project?

    Update: After doing some experimenting, I've found that it doesn't seem to be choosing a subproject based on its name. I can't figure out what the logic is! I do hope there is a way to do this because it's been driving me crazy.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      If there are multiple parse contexts for a file, a combo box will show up on top of code editor panel (near where you can select line endings etc.). You can switch it there but it's a manual, file-by-file process.

      (Z(:^

      1 Reply Last reply
      0
      • Guy GizmoG Offline
        Guy GizmoG Offline
        Guy Gizmo
        wrote on last edited by
        #3

        Well since this was driving me crazy, I went ahead and took a look at Qt Creator's source code to see how it decided what the parse context will be if a preferred one isn't set. I found is that there's a somewhat complex process for determining which parse context to pick, where each choice is weighted by a number of factors.

        What isn't considered though is the currently selected build target. Given a choice between equally weighted parse contexts, it makes sense that Qt Creator should pick the parse context that comes from the current build target. If it did that, then it would nearly always make the right choice for me, since very often a single source file is included in several targets, and I want the context to be whatever I'm building.

        I might submit a patch for Qt Creator that fixes this behavior.

        1 Reply Last reply
        2

        • Login

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