本文整理汇总了C++中QMenuBar::setLayout方法的典型用法代码示例。如果您正苦于以下问题:C++ QMenuBar::setLayout方法的具体用法?C++ QMenuBar::setLayout怎么用?C++ QMenuBar::setLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMenuBar
的用法示例。
在下文中一共展示了QMenuBar::setLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
CMainWindow::CMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::CMainWindow),
m_currentTab(nullptr)
{
ui->setupUi(this);
ui->tabWidget->setUsesScrollButtons(true);
ui->tabWidget->setElideMode(Qt::ElideNone);
ui->tabWidget->setTabsClosable(true);
ui->tabWidget->setMovable(true);
connect(ui->glView, SIGNAL(initialized()), this, SLOT(onViewerInitialized()));
CResourceManager* resourceManager = CResourceManager::instance().get();
connect(resourceManager, SIGNAL(newPak(CPakTreeWidget*)), this, SLOT(onNewPak(CPakTreeWidget*)));
connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(onTabChanged()));
connect(ui->actionLoad_Basepath, &QAction::triggered, this, &CMainWindow::_loadBasePath);
connect(ui->glView, &CGLViewer::movementSpeedChanged, [=](float val){
ui->horizontalSlider->setUpdatesEnabled(false);
ui->horizontalSlider->setValue((int)((val * 100) / 1.0));
ui->horizontalSlider->setUpdatesEnabled(true);
});
connect(ui->horizontalSlider, &QSlider::valueChanged, [=](int val){
if (!ui->horizontalSlider->updatesEnabled())
return;
ui->horizontalSlider->setUpdatesEnabled(false);
ui->glView->setMovementSpeed((float)(val / 100.f));
ui->horizontalSlider->setValue((int)((ui->glView->movementSpeed() * 100) / 1.0));
ui->horizontalSlider->setUpdatesEnabled(true);
});
installEventFilter(CKeyboardManager::instance());
ui->actionMode0 ->setChecked(QSettings().value("mode0", true ).toBool());
ui->actionMode1 ->setChecked(QSettings().value("mode1", true ).toBool());
ui->actionMode2 ->setChecked(QSettings().value("mode2", true ).toBool());
ui->actionMode3 ->setChecked(QSettings().value("mode3", true ).toBool());
ui->actionMode4And5 ->setChecked(QSettings().value("mode4And5", true ).toBool());
ui->actionMode6 ->setChecked(QSettings().value("mode6", true ).toBool());
ui->actionMode7 ->setChecked(QSettings().value("mode7", true ).toBool());
ui->actionEnableTextures ->setChecked(QSettings().value("enableTextures", true ).toBool());
ui->actionDrawPoints ->setChecked(QSettings().value("drawPoints", false).toBool());
ui->actionDrawJointNames ->setChecked(QSettings().value("drawJointNames", false).toBool());
ui->actionDrawBoundingBox->setChecked(QSettings().value("drawBoundingBox", false).toBool());
ui->actionDrawCollision ->setChecked(QSettings().value("drawCollision", false).toBool());
ui->actionWireframe ->setChecked(QSettings().value("wireframe", false).toBool());
m_fpsUpdateTimer.setInterval(50);
QMenuBar* bar = this->menuBar();
QHBoxLayout* previewLayout = new QHBoxLayout(bar);
previewLayout->addStretch();
QLabel* previewLabel = new QLabel(bar);
previewLabel->setObjectName("previewLabel");
previewLabel->setText("<b>UNSTABLE BUILD</b>");
previewLayout->setContentsMargins(150, 0, 6, 0);
previewLayout->addWidget(previewLabel);
bar->setLayout(previewLayout);
statusBar()->addPermanentWidget(&m_cameraPosition);
}