Qt开发进阶:从传统C++到Qt Quick的探索
1. 传统Qt开发的拓展
1.1 创建动作并添加到主窗口
在传统的Qt开发中,我们可以创建各种动作并将其添加到主窗口的菜单栏。以下是创建动作的代码示例:
void MainController::createActions()
{
mBackAction = new WebActionProxy( this );
connect(mBackAction, SIGNAL(triggered()),
this, SLOT(handleItemClosed()));
mShowListAction = new QAction(tr("Show List"), this);
connect(mShowListAction, SIGNAL(triggered()),
this, SLOT(handleShowList()));
mShowMapAction = new QAction(tr("Show Map"), this);
connect(mShowMapAction, SIGNAL(triggered()),
this, SLOT(handleShowMap()));
// Add to the options menu
mMainWindow->menuBar()->addAction(mShowListAction);
mMain
超级会员免费看
订阅专栏 解锁全文
3448

被折叠的 条评论
为什么被折叠?



