Doxygen: arguments and methods with the same names
-
wrote on 6 Jul 2018, 10:46 last edited by
Slightly off topic, I realise, but I wanted to ask if anybody knows how to prevent doxygen producing links to methods from function arguments with the same name.
For example: in this documentation,QModelIndex buddy (const QModelIndex &index)
theindex
argument is made into a link to the totally unrelatedindex(int row, int column, const QModelIndex &parent
method. Do you know how to prevent this? -
Slightly off topic, I realise, but I wanted to ask if anybody knows how to prevent doxygen producing links to methods from function arguments with the same name.
For example: in this documentation,QModelIndex buddy (const QModelIndex &index)
theindex
argument is made into a link to the totally unrelatedindex(int row, int column, const QModelIndex &parent
method. Do you know how to prevent this? -
wrote on 6 Jul 2018, 10:59 last edited by
Just tested:
/*! Constructs a new proxy model with the given \a parent. \param parent The Qt parent object */ TransposeProxyModel::TransposeProxyModel(QObject* parent)
still links to the
TransposeProxyModel::parent(const QModelIndex &index)
method -
-
-
Are you putting the method signature in the documentation or do you let Doxygen do that automatically ?
-
wrote on 6 Jul 2018, 11:20 last edited by
In the exameple above I have :
In header:
explicit TransposeProxyModel(QObject* parent = Q_NULLPTR); QModelIndex buddy(const QModelIndex &index) const Q_DECL_OVERRIDE;
in source:
/*! Constructs a new proxy model with the given \a parent. \param parent The Qt parent object */ TransposeProxyModel::TransposeProxyModel(QObject* parent) {/*some nasty implementation*/} /*! \reimp */ QModelIndex TransposeProxyModel::buddy(const QModelIndex &index) const { /*some nasty implementation*/ }
So the links are totally auto-generated
-
In the exameple above I have :
In header:
explicit TransposeProxyModel(QObject* parent = Q_NULLPTR); QModelIndex buddy(const QModelIndex &index) const Q_DECL_OVERRIDE;
in source:
/*! Constructs a new proxy model with the given \a parent. \param parent The Qt parent object */ TransposeProxyModel::TransposeProxyModel(QObject* parent) {/*some nasty implementation*/} /*! \reimp */ QModelIndex TransposeProxyModel::buddy(const QModelIndex &index) const { /*some nasty implementation*/ }
So the links are totally auto-generated
Moderatorswrote on 6 Jul 2018, 11:22 last edited by raven-worx 7 Jun 2018, 11:24@VRonin said in Doxygen: arguments and methods with the same names:
\param parent The Qt parent object
in the link i've posted before the it's mentioned with
@param
, maybe this results in a different behavior?Also you can explicitly declare the function the documentation belongs to using \fn. Maybe then you can apply the workaround of @SGaist
-
wrote on 6 Jul 2018, 15:29 last edited by
Apparently this is a known bug: https://stackoverflow.com/questions/51212831/doxygen-arguments-and-methods-with-the-same-names
5/9