PBrockmann / StripesCounter

A PyQt Matplotlib python application to detect automatically peaks from multiple profile segments, modify extracted peaks and count stripes from microscopic images.
MIT License
3 stars 1 forks source link

point rather than comma for QInputDialog.getDouble #4

Closed PBrockmann closed 3 years ago

PBrockmann commented 3 years ago

Solved by using QInputDialog() rather than QInputDialog.getDouble()

       #value, okPressed = QInputDialog.getDouble(self, "Get scale value","Value:", self.scaleValue, 0, 100, 1)
        # --> get comma instead of dot
        dialog = QInputDialog()
        dialog.setInputMode(QInputDialog.DoubleInput)
        dialog.setLocale(QLocale(QLocale.English, QLocale.UnitedStates))
        dialog.setLabelText("Value : ")
        dialog.setDoubleMinimum(0)
        dialog.setDoubleMaximum(100)
        dialog.setDoubleStep(1)
        dialog.setDoubleDecimals(2)
        dialog.setDoubleValue(self.scaleValue)
        dialog.setWindowTitle("Get scale value")
        okPressed = dialog.exec_()
        if okPressed:
            self.scaleValue = dialog.doubleValue()
        else:
            return