1
嗨我试图获取链接到图像查看器的路径名,但它不会链接错误是 path =(currentDir.absoluteFilePath(item-> text())) ; 任何人都可以帮助我。 在QT C++创建为QTableWidgetItem选择路径文件qt
void Window::open(int row, int /* column */)
{
QTableWidgetItem *item = filesTable->item(row, 0);
QString path;
path = currentDir.absoluteFilePath(item->data(Qt::DisplayRole)).toString();
QGraphicsView* w = new QGraphicsView();
QGraphicsScene *scn = new QGraphicsScene(w);
w->setScene(scn);
QPixmap pix (path);
scn->addPixmap(pix);
w->show();
}
`
你的问题不清楚。你能否提供你想要做什么和发生什么的细节? – Nick
我试图将当前选定的文件链接到路径并将其链接到QPixmap以将其显示在新窗口中 – chris
现在它显示DisplayValue不是Qt – chris