Qt: Ensure frame size options stay checked

This commit is contained in:
Jeffrey Pfau 2015-08-07 20:26:19 -07:00
parent c39be359df
commit 3dc22d9cc5
1 changed files with 4 additions and 1 deletions

View File

@ -939,9 +939,12 @@ void Window::setupMenu(QMenuBar* menubar) {
for (int i = 1; i <= 6; ++i) { for (int i = 1; i <= 6; ++i) {
QAction* setSize = new QAction(tr("%1x").arg(QString::number(i)), avMenu); QAction* setSize = new QAction(tr("%1x").arg(QString::number(i)), avMenu);
setSize->setCheckable(true); setSize->setCheckable(true);
connect(setSize, &QAction::triggered, [this, i]() { connect(setSize, &QAction::triggered, [this, i, setSize]() {
showNormal(); showNormal();
resizeFrame(VIDEO_HORIZONTAL_PIXELS * i, VIDEO_VERTICAL_PIXELS * i); resizeFrame(VIDEO_HORIZONTAL_PIXELS * i, VIDEO_VERTICAL_PIXELS * i);
bool enableSignals = setSize->blockSignals(true);
setSize->setChecked(true);
setSize->blockSignals(enableSignals);
}); });
m_frameSizes[i] = setSize; m_frameSizes[i] = setSize;
addControlledAction(frameMenu, setSize, QString("frame%1x").arg(QString::number(i))); addControlledAction(frameMenu, setSize, QString("frame%1x").arg(QString::number(i)));