Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Getting syntax error in tutorial
Forum Updated to NodeBB v4.3 + New Features

Getting syntax error in tutorial

Scheduled Pinned Locked Moved General and Desktop
25 Posts 6 Posters 13.7k 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.
  • G Offline
    G Offline
    goetz
    wrote on 17 Jan 2011, 11:24 last edited by
    #21

    [quote author="mzimmers" date="1295229420"]OK, but...what about when creating a brand-new project? The tutorial shows a dialog box for selecting tagets that I can't find. I'm sure it's right under my nose, but...I can't figure out how to get to it.[/quote]

    You do not find what - the dialog box or the targets within the dialog box?

    http://www.catb.org/~esr/faqs/smart-questions.html

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mzimmers
      wrote on 17 Jan 2011, 16:10 last edited by
      #22

      [quote author="Tobias Hunger" date="1295258618"]SIGNAL and SLOT are supposed to contain a signature of a method, so it must contain "int", not 0. Your changed code will not work: At runtime it will fail to connect the signal to the slot.[/quote]

      Oh, I realize that. The purpose of that exercise was to see whether I could eliminate the eclipse editor's "syntax error" message that I got. For whatever reason, the editor doesn't like the "int." No big deal, as the program builds and runs fine, but...I was hoping to get to the bottom of the error.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on 17 Jan 2011, 16:15 last edited by
        #23

        SIGNAL() and SLOT() are actually macros that do some magic to convert the method signature into a const char array, that is actually fed to the connect method. Seems that eclipse does not recognize this fact and treats it as regular C/C++ syntax and bails out.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mzimmers
          wrote on 17 Jan 2011, 16:36 last edited by
          #24

          Interesting...are those macros explicitly defined in a .h file, or are they part of the Qt behind-the-scenes magic?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on 17 Jan 2011, 19:03 last edited by
            #25

            The macros are defined in qobjectdefs.h of QtCore module. They must be defined in a .h file otherwise the compiler would bail out.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0

            21/25

            17 Jan 2011, 11:24

            • Login

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