In document, the description of QCPAxis::setTicks and QCPAxis::setTickLabels are:
void QCPAxis::setTicks ( bool show)
Sets whether tick marks are displayed.
Note that setting show to false does not imply that tick labels are invisible, too. To achieve that, see setTickLabels.
void QCPAxis::setTickLabels ( bool show)
Sets whether tick labels are displayed. Tick labels are the numbers drawn next to tick marks.
That means, whatever setTicks(false), but setTickLabels(true), the text of tick labels will be shown. But in fact, when setTicks(false), whatever setTickLabels(true) or setTickLabels(false), the text of tick labels will not be shown.
In the source code of qcustomplot.cpp, threre are
void QCPAxis::setTicks(bool show)
{
if (mTicks != show)
{
mTicks = show;
mCachedMarginValid = false;
}
}
void QCPAxis::setTickLabels(bool show)
{
if (mTickLabels != show)
{
mTickLabels = show;
mCachedMarginValid = false;
if (!mTickLabels)
mTickVectorLabels.clear();
}
}
void QCPAxis::draw(QCPPainter *painter)
{
QVector<double> subTickPositions; // the final coordToPixel transformed vector passed to QCPAxisPainter
QVector<double> tickPositions; // the final coordToPixel transformed vector passed to QCPAxisPainter
QVector<QString> tickLabels; // the final vector passed to QCPAxisPainter
tickPositions.reserve(mTickVector.size());
tickLabels.reserve(mTickVector.size());
subTickPositions.reserve(mSubTickVector.size());
if (mTicks)
{
for (int i=0; i<mTickVector.size(); ++i)
{
tickPositions.append(coordToPixel(mTickVector.at(i)));
if (mTickLabels)
tickLabels.append(mTickVectorLabels.at(i));
}
if (mSubTicks)
{
const int subTickCount = mSubTickVector.size();
for (int i=0; i<subTickCount; ++i)
subTickPositions.append(coordToPixel(mSubTickVector.at(i)));
}
}
......
}
when mTicks is false(because setTicks(false)), tickLabels has nothing to show. The action does not match the description in the help document. So I think this is a bug.