2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Get rid of Q_OBJECT in HistoryInner

This commit is contained in:
Ilya Fedin
2022-03-01 04:32:12 +04:00
committed by John Preston
parent f469cab7b0
commit 1c8d4ee7ab
3 changed files with 7 additions and 10 deletions

View File

@@ -351,7 +351,7 @@ void SendKeySequence(
const auto focused = QApplication::focusWidget();
if (qobject_cast<QLineEdit*>(focused)
|| qobject_cast<QTextEdit*>(focused)
|| qobject_cast<HistoryInner*>(focused)) {
|| dynamic_cast<HistoryInner*>(focused)) {
QApplication::postEvent(
focused,
new QKeyEvent(QEvent::KeyPress, key, modifiers));
@@ -826,12 +826,12 @@ void MainWindow::updateGlobalMenuHook() {
canRedo = edit->document()->isRedoAvailable();
canPaste = clipboardHasText;
if (canCopy) {
if (const auto inputField = qobject_cast<Ui::InputField*>(
if (const auto inputField = dynamic_cast<Ui::InputField*>(
focused->parentWidget())) {
markdownEnabled = inputField->isMarkdownEnabled();
}
}
} else if (const auto list = qobject_cast<HistoryInner*>(focused)) {
} else if (const auto list = dynamic_cast<HistoryInner*>(focused)) {
canCopy = list->canCopySelected();
canDelete = list->canDeleteSelected();
}