With the latest version, I set up a plot in this way:

   ui->customPlot->addGraph();
    ui->customPlot->graph(0)->setAntialiasedFill(false);
    QSharedPointer<QCPAxisTickerTime> timeTicker(new QCPAxisTickerTime);
    timeTicker->setTimeFormat("%h:%m");
    ui->customPlot->xAxis->setTicker(timeTicker);
    ui->customPlot->axisRect()->setupFullAxesBox();

In my application I clearly see the axes rect in solid black.
Then I print it to a QPainter:

    QPrinter printer(QPrinter::HighResolution);
    printer.setOutputFileName(filename);

    // ...

    QPainter p;
    p.begin(&printer);
    font = p.font();
    font.setPointSize(10);
    font.setWeight(QFont::Bold);
    p.setPen(QPen(Qt::black, 3));
    p.setFont(font);

    // ...

    QPicture graph;
    QCPPainter cpPainter;
    cpPainter.begin(&graph);
    ui->customPlot->axisRect()->setVisible(true);
    ui->customPlot->toPainter(&cpPainter, GRAPH_WIDTH, GRAPH_HEIGHT);
    cpPainter.end();

    // ...

    p.drawPicture(LEFT_MARGIN, GRAPH_TOP, graph);
    p.end();

I see the labels and the curves perfectly. Ma the axes lines are almost invisible. Are so thin and light that you need to zoom a lot to barely see them.

What am I missing?
Qt5.14.0 tested on Windows and Linux.