Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getButton = (
label: string,
value: number | string,
type: "value" | "command"
) => {
const button = new QPushButton();
button.setText(label);
button.setObjectName(`btn${value}`);
button.addEventListener(QPushButtonEvents.clicked, () => {
onBtnClick(value, type);
});
return {
ui: button,
value,
type
};
};