How to convert My QLineEdit into a Capitalize or all upper Case at Entry Level ?
( If I enter string into my text box (QLineEdit), automatically its converts or format the input string to, as per user defined method. ( Capitalize or Upper Case ))
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
class textbox_example(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle(" QLine Edit Example")
self.setGeometry(50, 50, 1500, 600)
self.tbx_search = QLineEdit(self)
self.tbx_search.setGeometry(50, 50, 300, 30)
self.tbx_search.setPlaceholderText("Enter,Name of the Company")
self.tbx_search.setFont(QFont("caliber", 10, QFont.Capitalize))
def main():
myapp = QApplication(sys.argv)
mywindow = textbox_example()
mywindow.show()
sys.exit(myapp.exec_())
if __name__ == "__main__":
main()
If I enter a name of the company as "google inc" then its converts as follows " Google Inc" .