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. Nested qhash visual problems in QT Creator
Qt 6.11 is out! See what's new in the release blog

Nested qhash visual problems in QT Creator

Scheduled Pinned Locked Moved Qt Creator and other tools
4 Posts 3 Posters 2.6k Views 1 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    So for my project because I don't want to type things over and over again, I have the following:
    @
    #define DATA QHash<QString,QString>
    #define DATASHEET QHash<QString,DATA>
    @

    However when I use DATASHEET, I get the following warning red underline with the text "Expected a declaration". It compiles and works correctly but it's very annoying because 1. it's red underline which constantly trigger the thought that I did something wrong, and 2. I can't use the popup helper that appears when I am accessing its functions. Is there a workaround to this? Manually typing QHash<QString,DATA> works fine. However, using DATASHEET as QHash<QString,QHash<QString,QString>> also causes the red underlines to popup.

    If there is no workaround, I will just manually type QHash<QString,DATA> but I was wondering if there was a workaround.

    Thanks in advance.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      What happens if you use typedefs instead of macros when defining the types?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        I did have the same problem using QList<QList<something>>, the problem was the double >> at the end of definition.

        Try writing QHash<QStrsing, QHash<QString, QString> >, and be carrefull whit the space at the end.

        BR,

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          You are right! Thanks!

          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