In my application there is QTextBrowser widget and the data will be appended to it for every 1 second. I know that when data hits the bottom of the widget, a vertical scroll bar will be created. But, Is it possible to expand the size of QTextBrowser widget (not using QLayout) by the user via mouse drag whenever it is required ?
If yes, please help me out.
Here's my piece of code.
#!/usr/bin/python
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4.QtGui import QSplitter
from PyQt4.QtGui import QTextEdit
import sys
class Commit(QtGui.QMainWindow):
def __init__(self):
super(Commit, self).__init__()
self.initUI()
def initUI(self):
self.qle = QtGui.QLineEdit(self)
self.qle.setFixedWidth(450) # tab width
self.qle.move(20, 35) # tab position
self.browser = QtGui.QTextBrowser(self)
self.browser.resize(420, 100)
self.browser.move(34, 100)
self.lbl = QtGui.QLabel(self)
self.lbl.setGeometry(10, 55,200,20)
self.lbl.setText("Enter input here")
self.lbl.move(200,10) # label position
self.setGeometry(300, 300, 500, 250)
self.show()
def main():
app = QtGui.QApplication(sys.argv)
commit = Commit()
commit.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()