Important: Please read the Qt Code of Conduct -

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

  • 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

  • Qt Champions 2019

    @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.

  • 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.

Log in to reply