本文整理汇总了C++中QActionGroup::checkedAction方法的典型用法代码示例。如果您正苦于以下问题:C++ QActionGroup::checkedAction方法的具体用法?C++ QActionGroup::checkedAction怎么用?C++ QActionGroup::checkedAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QActionGroup
的用法示例。
在下文中一共展示了QActionGroup::checkedAction方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildFromQWidget
//=========================================================================
// MemoryWindowQtConfig
//=========================================================================
void MemoryWindowQtConfig::buildFromQWidget(QWidget* widget)
{
WindowQtConfig::buildFromQWidget(widget);
MemoryWindow* window = dynamic_cast<MemoryWindow*>(widget);
QComboBox* memoryRegion = window->findChild<QComboBox*>("memoryregion");
m_memoryRegion = memoryRegion->currentIndex();
QAction* reverse = window->findChild<QAction*>("reverse");
m_reverse = reverse->isChecked();
QActionGroup* addressGroup = window->findChild<QActionGroup*>("addressgroup");
if (addressGroup->checkedAction()->text() == "Logical Addresses")
m_addressMode = 0;
else if (addressGroup->checkedAction()->text() == "Physical Addresses")
m_addressMode = 1;
QActionGroup* dataFormat = window->findChild<QActionGroup*>("dataformat");
if (dataFormat->checkedAction()->text() == "1-byte chunks")
m_dataFormat = 0;
else if (dataFormat->checkedAction()->text() == "2-byte chunks")
m_dataFormat = 1;
else if (dataFormat->checkedAction()->text() == "4-byte chunks")
m_dataFormat = 2;
else if (dataFormat->checkedAction()->text() == "8-byte chunks")
m_dataFormat = 3;
else if (dataFormat->checkedAction()->text() == "32 bit floating point")
m_dataFormat = 4;
else if (dataFormat->checkedAction()->text() == "64 bit floating point")
m_dataFormat = 5;
else if (dataFormat->checkedAction()->text() == "80 bit floating point")
m_dataFormat = 6;
}
示例2: buildFromQWidget
//=========================================================================
// BreakpointsWindowQtConfig
//=========================================================================
void BreakpointsWindowQtConfig::buildFromQWidget(QWidget* widget)
{
WindowQtConfig::buildFromQWidget(widget);
BreakpointsWindow* window = dynamic_cast<BreakpointsWindow*>(widget);
QActionGroup* typeGroup = window->findChild<QActionGroup*>("typegroup");
if (typeGroup->checkedAction()->text() == "Breakpoints")
m_bwType = 0;
else if (typeGroup->checkedAction()->text() == "Watchpoints")
m_bwType = 1;
}
示例3: buildFromQWidget
//=========================================================================
// MainWindowQtConfig
//=========================================================================
void MainWindowQtConfig::buildFromQWidget(QWidget* widget)
{
WindowQtConfig::buildFromQWidget(widget);
MainWindow* window = dynamic_cast<MainWindow*>(widget);
m_windowState = window->saveState();
QActionGroup* rightBarGroup = window->findChild<QActionGroup*>("rightbargroup");
if (rightBarGroup->checkedAction()->text() == "Raw Opcodes")
m_rightBar = 0;
else if (rightBarGroup->checkedAction()->text() == "Encrypted Opcodes")
m_rightBar = 1;
else if (rightBarGroup->checkedAction()->text() == "Comments")
m_rightBar = 2;
}
示例4: buildFromQWidget
//=========================================================================
// DasmWindowQtConfig
//=========================================================================
void DasmWindowQtConfig::buildFromQWidget(QWidget* widget)
{
WindowQtConfig::buildFromQWidget(widget);
DasmWindow* window = dynamic_cast<DasmWindow*>(widget);
QComboBox* cpu = window->findChild<QComboBox*>("cpu");
m_cpu = cpu->currentIndex();
QActionGroup* rightBarGroup = window->findChild<QActionGroup*>("rightbargroup");
if (rightBarGroup->checkedAction()->text() == "Raw Opcodes")
m_rightBar = 0;
else if (rightBarGroup->checkedAction()->text() == "Encrypted Opcodes")
m_rightBar = 1;
else if (rightBarGroup->checkedAction()->text() == "Comments")
m_rightBar = 2;
}
示例5: buildFromQWidget
//=========================================================================
// MemoryWindowQtConfig
//=========================================================================
void MemoryWindowQtConfig::buildFromQWidget(QWidget* widget)
{
WindowQtConfig::buildFromQWidget(widget);
MemoryWindow* window = dynamic_cast<MemoryWindow*>(widget);
QComboBox* memoryRegion = window->findChild<QComboBox*>("memoryregion");
m_memoryRegion = memoryRegion->currentIndex();
QAction* reverse = window->findChild<QAction*>("reverse");
m_reverse = reverse->isChecked();
QActionGroup* addressGroup = window->findChild<QActionGroup*>("addressgroup");
if (addressGroup->checkedAction()->text() == "Logical Addresses")
m_addressMode = 0;
else if (addressGroup->checkedAction()->text() == "Physical Addresses")
m_addressMode = 1;
QActionGroup* chunkGroup = window->findChild<QActionGroup*>("chunkgroup");
if (chunkGroup->checkedAction()->text() == "1-byte chunks")
m_chunkSize = 0;
else if (chunkGroup->checkedAction()->text() == "2-byte chunks")
m_chunkSize = 1;
else if (chunkGroup->checkedAction()->text() == "4-byte chunks")
m_chunkSize = 2;
}
示例6: deletePluginSwitchAction
void RackWindow::deletePluginSwitchAction(QObject *action)
{
QAction *act = qobject_cast<QAction *>(action);
QActionGroup *ag = act->actionGroup();
//make sure we have a checked action in the actiongroup after we delete this one
if (act == ag->checkedAction() && ag->actions().count() > 1) {
if (act == ag->actions().last())
{
ag->actions().at(ag->actions().count() - 2)->trigger();
}
else
{
ag->actions().at(ag->actions().indexOf(act) + 1)->trigger();
}
}
delete act;
act = 0;
}
示例7: addMenu
//.........这里部分代码省略.........
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::DefaultSkybox, 0, true);
// Developer > Render > Throttle FPS If Not Focus
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::ThrottleFPSIfNotFocus, 0, true);
// Developer > Render > Resolution
MenuWrapper* resolutionMenu = renderOptionsMenu->addMenu(MenuOption::RenderResolution);
QActionGroup* resolutionGroup = new QActionGroup(resolutionMenu);
resolutionGroup->setExclusive(true);
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionOne, 0, true));
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionTwoThird, 0, false));
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionHalf, 0, false));
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionThird, 0, false));
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionQuarter, 0, false));
//const QString = "Automatic Texture Memory";
//const QString = "64 MB";
//const QString = "256 MB";
//const QString = "512 MB";
//const QString = "1024 MB";
//const QString = "2048 MB";
// Developer > Render > Resolution
MenuWrapper* textureMenu = renderOptionsMenu->addMenu(MenuOption::RenderMaxTextureMemory);
QActionGroup* textureGroup = new QActionGroup(textureMenu);
textureGroup->setExclusive(true);
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTextureAutomatic, 0, true));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture64MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture256MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture512MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture1024MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture2048MB, 0, false));
connect(textureGroup, &QActionGroup::triggered, [textureGroup] {
auto checked = textureGroup->checkedAction();
auto text = checked->text();
gpu::Context::Size newMaxTextureMemory { 0 };
if (MenuOption::RenderMaxTexture64MB == text) {
newMaxTextureMemory = MB_TO_BYTES(64);
} else if (MenuOption::RenderMaxTexture256MB == text) {
newMaxTextureMemory = MB_TO_BYTES(256);
} else if (MenuOption::RenderMaxTexture512MB == text) {
newMaxTextureMemory = MB_TO_BYTES(512);
} else if (MenuOption::RenderMaxTexture1024MB == text) {
newMaxTextureMemory = MB_TO_BYTES(1024);
} else if (MenuOption::RenderMaxTexture2048MB == text) {
newMaxTextureMemory = MB_TO_BYTES(2048);
}
gpu::Texture::setAllowedGPUMemoryUsage(newMaxTextureMemory);
});
// Developer > Render > LOD Tools
addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, 0, dialogsManager.data(), SLOT(lodTools()));
// Developer > Assets >>>
MenuWrapper* assetDeveloperMenu = developerMenu->addMenu("Assets");
auto& atpMigrator = ATPAssetMigrator::getInstance();
atpMigrator.setDialogParent(this);
addActionToQMenuAndActionHash(assetDeveloperMenu, MenuOption::AssetMigration,
0, &atpMigrator,
SLOT(loadEntityServerFile()));
// Developer > Avatar >>>
MenuWrapper* avatarDebugMenu = developerMenu->addMenu("Avatar");
// Developer > Avatar > Face Tracking
示例8: addMenu
//.........这里部分代码省略.........
// Developer > Render > Resolution
MenuWrapper* resolutionMenu = renderOptionsMenu->addMenu(MenuOption::RenderResolution);
QActionGroup* resolutionGroup = new QActionGroup(resolutionMenu);
resolutionGroup->setExclusive(true);
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionOne, 0, true));
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionTwoThird, 0, false));
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionHalf, 0, false));
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionThird, 0, false));
resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionQuarter, 0, false));
//const QString = "Automatic Texture Memory";
//const QString = "64 MB";
//const QString = "256 MB";
//const QString = "512 MB";
//const QString = "1024 MB";
//const QString = "2048 MB";
// Developer > Render > Maximum Texture Memory
MenuWrapper* textureMenu = renderOptionsMenu->addMenu(MenuOption::RenderMaxTextureMemory);
QActionGroup* textureGroup = new QActionGroup(textureMenu);
textureGroup->setExclusive(true);
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTextureAutomatic, 0, true));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture4MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture64MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture256MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture512MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture1024MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture2048MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture4096MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture6144MB, 0, false));
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture8192MB, 0, false));
connect(textureGroup, &QActionGroup::triggered, [textureGroup] {
auto checked = textureGroup->checkedAction();
auto text = checked->text();
gpu::Context::Size newMaxTextureMemory { 0 };
if (MenuOption::RenderMaxTexture4MB == text) {
newMaxTextureMemory = MB_TO_BYTES(4);
} else if (MenuOption::RenderMaxTexture64MB == text) {
newMaxTextureMemory = MB_TO_BYTES(64);
} else if (MenuOption::RenderMaxTexture256MB == text) {
newMaxTextureMemory = MB_TO_BYTES(256);
} else if (MenuOption::RenderMaxTexture512MB == text) {
newMaxTextureMemory = MB_TO_BYTES(512);
} else if (MenuOption::RenderMaxTexture1024MB == text) {
newMaxTextureMemory = MB_TO_BYTES(1024);
} else if (MenuOption::RenderMaxTexture2048MB == text) {
newMaxTextureMemory = MB_TO_BYTES(2048);
} else if (MenuOption::RenderMaxTexture4096MB == text) {
newMaxTextureMemory = MB_TO_BYTES(4096);
} else if (MenuOption::RenderMaxTexture6144MB == text) {
newMaxTextureMemory = MB_TO_BYTES(6144);
} else if (MenuOption::RenderMaxTexture8192MB == text) {
newMaxTextureMemory = MB_TO_BYTES(8192);
}
gpu::Texture::setAllowedGPUMemoryUsage(newMaxTextureMemory);
});
#ifdef Q_OS_WIN
// Developer > Render > Enable Sparse Textures
{
auto action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::SparseTextureManagement, 0, gpu::Texture::getEnableSparseTextures());
connect(action, &QAction::triggered, [&](bool checked) {
qDebug() << "[TEXTURE TRANSFER SUPPORT] --- Enable Dynamic Texture Management menu option:" << checked;
gpu::Texture::setEnableSparseTextures(checked);
});