Examples of QGridLayout


Examples of com.trolltech.qt.gui.QGridLayout

  // Constructor
  public DatabaseLoginDialog() {
    okPressed = false;
    setWindowTitle(tr("Database Password"));
    setWindowIcon(new QIcon(iconPath+"password.png"));
    QGridLayout grid = new QGridLayout();
    setLayout(grid);
    QGridLayout passwordGrid = new QGridLayout();
    QGridLayout buttonGrid = new QGridLayout();
   
    String passwordValue = "";
   
    password = new QLineEdit(passwordValue);
    password.setEchoMode(QLineEdit.EchoMode.Password);
   
    password.textChanged.connect(this, "validateInput()");
   
    passwordGrid.addWidget(new QLabel(tr("Password")), 2,1);
    passwordGrid.addWidget(password, 2, 2);
    passwordGrid.setContentsMargins(10, 10,  -10, -10);
    grid.addLayout(passwordGrid,1,1);
   
    ok = new QPushButton(tr("OK"));
    ok.clicked.connect(this, "okButtonPressed()");
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "cancelButtonPressed()");
    buttonGrid.addWidget(ok, 1, 1);
    buttonGrid.addWidget(cancel, 1,2);
    grid.addLayout(buttonGrid,2,1);
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QGridLayout

  // Constructor
  public TableDialog() {
    okPressed = false;
    setWindowTitle(tr("Insert Table"));
    setWindowIcon(new QIcon(iconPath+"table.png"));
    QGridLayout grid = new QGridLayout();
    QGridLayout input = new QGridLayout();
    QGridLayout msgGrid = new QGridLayout();
    QGridLayout button = new QGridLayout();
    setLayout(grid);
   
    unit = new QComboBox(this);
    unit.addItem(tr("Percent"),new Boolean(true));
    unit.addItem(tr("Pixels"),new Boolean(false));
   
   
    width = new QLineEdit("80");
    widthValidator = new QIntValidator(0,100, this);
    width.setValidator(widthValidator);
    width.textChanged.connect(this, "validateWidth()");
    rows = new QSpinBox();
    cols = new QSpinBox();
    rows.setMaximum(30);
    rows.setMinimum(1);
    cols.setMaximum(30);
    cols.setMinimum(1);
   
    unit.activated.connect(this, "unitChanged()");
   
    input.addWidget(new QLabel(tr("Rows")), 1,1);
    input.addWidget(rows, 1, 2);
    input.addWidget(new QLabel(tr("Columns")), 2,1);
    input.addWidget(cols, 2, 2);
    input.addWidget(new QLabel(tr("Width")), 3,1);
    input.addWidget(width, 3, 2);
    input.addWidget(new QLabel(tr("Unit")),4,1);
    input.addWidget(unit,4,2);
     input.setContentsMargins(10, 10,  -10, -10);
    grid.addLayout(input, 1,1);
   
    error = new QLabel();
    msgGrid.addWidget(error, 1, 1);
    grid.addLayout(msgGrid, 2, 1);
   
    ok = new QPushButton(tr("OK"));
    ok.clicked.connect(this, "okButtonPressed()");
   
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "cancelButtonPressed()");
    button.addWidget(ok, 1, 1);
    button.addWidget(cancel, 1,2);
    grid.addLayout(button, 3, 1);
   
//    width.textChanged.connect(this, "validateInput()");
   
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QGridLayout

  // Constructor
  public DBEncryptDialog() {
    okPressed = false;
    setWindowTitle(tr("Database Encryption"));
    setWindowIcon(new QIcon(iconPath+"password.png"));
    QGridLayout grid = new QGridLayout();
    setLayout(grid);
    QGridLayout passwordGrid = new QGridLayout();
    QGridLayout buttonGrid = new QGridLayout();
       
    password1 = new QLineEdit();
    password1.setEchoMode(QLineEdit.EchoMode.Password);
    password2 = new QLineEdit();
    password2.setEchoMode(QLineEdit.EchoMode.Password);
   
    password1.textChanged.connect(this, "validateInput()");
    password2.textChanged.connect(this, "validateInput()");
   
    encryptionLabel = new QLabel(tr("Encryption Method"));
    encryptionType = new QComboBox();
    encryptionType.addItem(tr("AES"), "AES");
    encryptionType.addItem(tr("XTEA"), "XTEA");
   
    passwordGrid.addWidget(new QLabel(tr("Password")), 1,1);
    passwordGrid.addWidget(password1, 1, 2);
    passwordGrid.addWidget(new QLabel(tr("Verify Password")), 2,1);
    passwordGrid.addWidget(password2, 2, 2);
    passwordGrid.addWidget(encryptionLabel, 3,1);
    passwordGrid.addWidget(encryptionType, 3,2);
    passwordGrid.setContentsMargins(10, 10,  -10, -10);
    grid.addLayout(passwordGrid,1,1);
   
   
   
    ok = new QPushButton(tr("OK"));
    ok.setEnabled(false);
    ok.clicked.connect(this, "okButtonPressed()");
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "cancelButtonPressed()");
    buttonGrid.addWidget(ok, 1, 1);
    buttonGrid.addWidget(cancel, 1,2);
    grid.addLayout(buttonGrid,2,1);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.