how can i make a label stretch automatically depending on the string length in PyQt5?

时间:2018-09-19 08:23:55

标签: python pyqt5

I am using PyQt5 and i want to make all labels stretch its space automatically depending on the string length.

The issue that i encountered for example that the length of the displayed "date and time" is bigger than the space of label which araised that a part of the "date and time" is not shown as described in the picture below :

enter image description here

The object called "dateTime" in the code what line should i add it to these two lines please ? thank you

self.dateTime_Text = QtWidgets.QLabel(self.deviceInfo_Page)
self.dateTime_Text.setGeometry(QtCore.QRect(246, 158, 67, 13))

0 个答案:

没有答案