Implementing a Brush Size Slider under cursor (Workaround with autohotkey)

Check out Krita scripting school:

https://scripting.krita.org/lessons/introduction

Also check out:

This should help you get started once you are done reading:

from krita import *

class TestDialog(QDialog):
    def __init__(self, parent=None):
        super().__init__()
        self.setWindowFlags(Qt.Popup)
        self.move(QCursor.pos())
        
dlg = TestDialog()
dlg.exec_()

To finish this, just have your bar connect to the one in the QDoubleSpinBox in the layout.