bool configwidget::avalibelGlobalShortcuts(const QKeySequence& seq) { bool ok = false; QxtGlobalShortcut tmpShortcut; if (tmpShortcut.setShortcut(QKeySequence(seq)) == true) { tmpShortcut.setDisabled(true); ok = true; } return ok; }
void FaceTrackNoIR::bind_keyboard_shortcut(QxtGlobalShortcut& key, key_opts& k) { key.setShortcut(QKeySequence::fromString("")); key.setDisabled(); const int idx = k.key_index; if (idx > 0) { QString seq(global_key_sequences.value(idx, "")); if (!seq.isEmpty()) { if (k.shift) seq = "Shift+" + seq; if (k.alt) seq = "Alt+" + seq; if (k.ctrl) seq = "Ctrl+" + seq; key.setShortcut(QKeySequence::fromString(seq, QKeySequence::PortableText)); key.setEnabled(); } else { key.setDisabled(); } } }