Also connect up the "Delete" action

Sun, 09 Apr 2023 16:30:33 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Sun, 09 Apr 2023 16:30:33 +0300
changeset 367
df61cd3d5ab4
parent 366
ea656dead697
child 368
9444de9762c3

Also connect up the "Delete" action

src/main.cpp file | annotate | diff | comparison | revisions
--- a/src/main.cpp	Sun Apr 09 16:27:22 2023 +0300
+++ b/src/main.cpp	Sun Apr 09 16:30:33 2023 +0300
@@ -673,6 +673,14 @@
 			});
 		}
 	);
+	QObject::connect(
+		state.mainWindow.actionDelete,
+		&QAction::triggered,
+		[&state]{
+			QTextCursor cursor = state.mainWindow.modelEdit->textCursor();
+			cursor.removeSelectedText();
+		}
+	);
 	restoreSettings(&state);
 	updateRenderPreferences(&state.mainWindow, &state.renderPreferences, &state.documents);
 	const int result = app.exec();

mercurial