QLineEdit *lEdit = new QLineEdit(); lEdi -> setReadOnly(true); //只读 或者 lEdi ->setEnabled(False); //不可编辑 —(20201213)