QCustomPlot
ウィジェットにテキスト項目を追加しようとしています。コンストラクターは、 widget へのポインターを引数として受け取りQCPItemText
ます。QCustomPlot
QCPItemText::QCPItemText ( QCustomPlot * parentPlot)
オブジェクトを作成しQCPItemText
たら、メンバー関数を使用してウィジェットに追加できますQCustomPlot::addItem()
。しかし、私の問題は、プログラムがコンパイルされないことです。と呼ばれるメンバー関数はありませんQCustomPlot::addItem()
。しかし、この例はこれを行うようです。私は混乱しています。
これは私のコードの一部です。
//hash out current widget
QCustomPlot *currentWidget = GraphWindow::dynamicWidgetHash.value(slot);
//Setup font
QFont plotFont;
plotFont.setStyleHint(QFont::Helvetica);
plotFont.setBold(true);
plotFont.setWeight(8);
plotFont.setPointSize(16);
GraphWindow::setupBackground(slot);
QCPItemText itemText(currentWidget);
QString dataText = "No " + xLabel + " data found. \nPossibly the firm may not possess " + xLabel;
itemText.setText(dataText);
itemText.setPositionAlignment(Qt::AlignTop|Qt::AlignCenter);
itemText.position->setType(QCPItemPosition::ptAxisRectRatio);
itemText.position->setCoords(2,2);
itemText.setFont(plotFont);
itemText.setPen(QPen(Qt::white));
wheredynamicWidgetHash
は、指定された for eachQHash
を格納するオブジェクトです。QCustomPlot *
key
この行を使用しようとするとエラーが発生します
currentWidget->addIem(itemText);