如何在QT6 C ++的Web应用中切换页面

问题描述 投票:0回答:1
I尝试使用库QSTACKEDWIDGET基于qt6 c ++ clion在Web应用程序上切换页面。但是主页没有进行。第二页在Main上写。单击任何按钮时如何删除第一页?

与主 - > hide() - 但不起作用。

我想要单击主页上的按钮以切换到另一页。

I尝试使用库QSTACKEDWIDGET基于qt6 c ++ clion在Web应用程序上切换页面。但是主页没有进行。第二页在Main上写。单击任何按钮时如何删除第一页?

与主 - > hide() - 但不起作用。

我没有QT6的WebApps经验。在常规桌面C ++应用中,我经常使用这样的代码。

void switchToView(QWidget* pPage) { qDebug() << "trying to switch to another view"; if (!pPage) { qDebug() << "the new view is NULL, aborting..."; return; } if (pPage->parentWidget() != ui->stackedWidget) { qDebug() << "the new view is not a page of the stacked widget, aborting..."; return; } qDebug() << "switching to page" << pPage->objectName(); ui->stackedWidget->setCurrentWidget(pPage);

}

qt c++11 clion
1个回答
0
投票
最终在QT6中对Web应用程序的工作或多或少相同。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.