gotocelldialog.java

来自「QT4 gui programming的随书光盘」· Java 代码 · 共 31 行

JAVA
31
字号
import com.trolltech.qt.core.*;import com.trolltech.qt.gui.*;public class GoToCellDialog extends QDialog {    private Ui_GoToCellDialogClass ui = new Ui_GoToCellDialogClass();    public GoToCellDialog(QWidget parent) {        super(parent);        ui.setupUi(this);        ui.okButton.setEnabled(false);        QRegExp regExp = new QRegExp("[A-Za-z][1-9][0-9]{0,2}");        ui.lineEdit.setValidator(new QRegExpValidator(regExp, this));        ui.okButton.clicked.connect(this, "accept()");        ui.cancelButton.clicked.connect(this, "reject()");    }    private void on_lineEdit_textChanged(String text) {        ui.okButton.setEnabled(!text.isEmpty());    }    public static void main(String[] args) {        QApplication.initialize(args);        GoToCellDialog testGoToCellDialog = new GoToCellDialog(null);        testGoToCellDialog.show();        QApplication.exec();    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?