Answer the question
In order to leave comments, you need to log in
How to pass text on button click in python qt?
Hello everyone, please tell me how to transfer the text from the line edit when you click on the button to the text browser? I kind of did it, but for some reason it doesn't work, I'm new to programming. please tell me what is wrong and how to fix it.
from PySide2 import QtCore, QtGui, QtWidgets
import sys
from ui import Ui_MainWindow
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
def save():
ui.textBrowser.setText(int(ui.LineEdit))
ui.pushButton.clicked.connect(save)
Answer the question
In order to leave comments, you need to log in
function mergeIntervals(intervals) {
intervals = intervals.map(n => [...n]);
if (intervals.length < 2) {
return intervals;
}
intervals.sort((a, b) => a[0] - b[0]);
const stack = [ intervals.shift() ];
intervals.forEach(n => {
const top = stack[stack.length - 1];
if (top[1] < n[0]) {
stack.push(n);
} else if (top[1] < n[1]) {
top[1] = n[1];
}
});
return stack;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question