How to make a new line on TextEdit Box in QErrorMessage ? and How to trim the blank space in windows headings? Here is My Code,
self.error_msg = QErrorMessage()
self.error_msg.setFixedSize(500,200)
exc_type, exc_value, exc_traceback = sys.exc_info()
filename = exc_traceback.tb_frame.f_code.co_filename
lineno = exc_traceback.tb_lineno
name = exc_traceback.tb_frame.f_code.co_name
type = exc_type.__name__
message = exc_value
nl = '\n'
self.error_msg.setWindowTitle(f'{type}')
self.error_msg.showMessage(f'File Name : {filename[:-3]}{nl}Line No. : {lineno}')
print(f'File Name : {filename[:-2]}{nl} Line No. : {lineno}')
This code produces the following result:
How to trim the blank space in windows headings ( Space between AttributeError and question mark) and How to make a new line in Qtextedit box ( File name is in first line, Line No in next line)
