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. Why does `/*event*/` italicize this function name?
Forum Updated to NodeBB v4.3 + New Features

Why does `/*event*/` italicize this function name?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 708 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.
  • D Offline
    D Offline
    DragonautX
    wrote on last edited by
    #1

    In the Qt.5.7 Screenshot Example, in QtCreator, the definition for Screenshot::resizeEvent` has a parameter coded like this.

    void Screenshot::resizeEvent(QResizeEvent * /* event */)

    I realized that this definition without a parameter name is allowed the function works because the parameter's not actually used in the function. But why does the commmnt /* event */ italicize the function name resizeEvent? Does it have any significance, or is it italicized just to show that the comment exists? I think it has something to do with Qdoc. I tried looking at the C++ Documentation Style section, but I didn't find anything there

    jsulmJ 1 Reply Last reply
    0
    • D DragonautX

      In the Qt.5.7 Screenshot Example, in QtCreator, the definition for Screenshot::resizeEvent` has a parameter coded like this.

      void Screenshot::resizeEvent(QResizeEvent * /* event */)

      I realized that this definition without a parameter name is allowed the function works because the parameter's not actually used in the function. But why does the commmnt /* event */ italicize the function name resizeEvent? Does it have any significance, or is it italicized just to show that the comment exists? I think it has something to do with Qdoc. I tried looking at the C++ Documentation Style section, but I didn't find anything there

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @DragonautX Are you sure it is due to the comment? Usually QtCreator uses Italic font for virtual methods (resizeEvent is virtual as far as I know). Just uncomment event and see what happens.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • D Offline
        D Offline
        DragonautX
        wrote on last edited by
        #3

        Oh ya, you're right. The docs said resizeEvent was virtual. I'm not sure how I got myself to think this. I might've done something other than just delete the comment. Anyways, 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