public static void main(String args[]) {
    QApplication.initialize(args);
    // ! [0]
    QLabel label = new QLabel();
    label.setFrameStyle(QFrame.Shadow.Sunken.value() | QFrame.Shape.Panel.value());
    label.setText("first line\nsecond line");
    label.setAlignment(Qt.AlignmentFlag.AlignBottom, Qt.AlignmentFlag.AlignRight);
    // ! [0]

    // ! [1]
    QLineEdit phoneEdit = new QLineEdit();
    QLabel phoneLabel = new QLabel("Phone:");
    phoneLabel.setBuddy(phoneEdit);
    // ! [1]

    // ! [2]
    QLineEdit nameEd = new QLineEdit();
    QLabel nameLb = new QLabel("Name:");
    nameLb.setBuddy(nameEd);
    QLineEdit phoneEd = new QLineEdit();
    QLabel phoneLb = new QLabel("Phone:");
    phoneLb.setBuddy(phoneEd);
    // (layout setup not shown)
    // ! [2]

  }
예제 #2
0
  public static void main(String args[]) {
    QApplication.initialize(args);

    new Icons().show();

    QApplication.exec();
  }
예제 #3
0
  public static void main(String args[]) {
    QApplication.initialize(args);

    new Scribble().show();

    QApplication.execStatic();
    QApplication.shutdown();
  }
예제 #4
0
  public static void main(String args[]) {
    QApplication.initialize(args);

    QApplication.setWindowIcon(new QIcon(QPixmap.fromImage(qoffeyLogo(64))));

    // QPixmap pm = QPixmap.fromImage(qoffeyLogo(400));

    Image im = new Image();
    im.show();

    QApplication.execStatic();
    QApplication.shutdown();
  }