Skip to content

Instantly share code, notes, and snippets.

View heuristicus's full-sized avatar

Michal Staniaszek heuristicus

  • Oxford Robotics Institute
  • Oxford
View GitHub Profile
@heuristicus
heuristicus / pre-commit.sh
Last active October 27, 2023 10:35
Tiny modification to default git pre-commit hook to check black output formatting
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
then
@heuristicus
heuristicus / dropdown_filter_combobox.cpp
Last active April 5, 2022 13:29
Implement a combobox where the entries are filtered by the line edit
// Initialise the combobox for the edge selection
// listmodel stores the actual data. This will be populated when we get a map update
edgeIDModel = new QStringListModel();
// Set the model for the combobox as the base stringlist model. If we use the same filter model for both the
// combobox and the completer, there will be weird behaviour, probably because the two objects are fighting
// to define what is in the list of strings.
actionComboBox->setModel(edgeIDModel);
// Need a completer so that the combobox pops up with possible options given typed text
edgeIDCompleter = new QCompleter();
edgeIDCompleter->setParent(parent);