예제 #1
0
 private void about() {
   QMessageBox.about(
       this,
       tr("About Icons"),
       tr(
           "The <b>Icons</b> example illustrates how Qt renders an icon in "
               + "different modes (active, normal, disabled, and selected) and "
               + "states (on and off) based on a set of images."));
 }
예제 #2
0
 private void about() {
   QMessageBox.about(
       this,
       tr("About Scribble"),
       tr(
           "<p>The <b>Scribble</b> example shows how to use QMainWindow as the "
               + "base widget for an application, and how to reimplement some of "
               + "QWidget's event handlers to receive the events generated for "
               + "the application's widgets:</p><p> We reimplement the mouse event "
               + "handlers to facilitate drawing, the paint event handler to "
               + "update the application and the resize event handler to optimize "
               + "the application's appearance. In addition we reimplement the "
               + "close event handler to intercept the close events before "
               + "terminating the application.</p><p> The example also demonstrates "
               + "how to use QPainter to draw an image in real time, as well as "
               + "to repaint widgets.</p>"));
 }
예제 #3
0
  public void delete() {
    boolean status = Controller.getInstance().deleteStudent(_id);
    QMessageBox t = new QMessageBox();
    t.setWindowIcon(new QIcon(new QPixmap("classpath:admin_resource/eot_icon.png")));

    if (status) {
      holder.hide();
      holder.close();
      t.setText("The deletion was a success");
      t.setWindowTitle("Success");
      t.exec();
      // Controller.getInstance().work();
    } else {
      t.setText("The deletion failed");
      t.setWindowTitle("Failed");
      t.exec();
      // Controller.getInstance().work();
    }
  }
예제 #4
0
  private boolean maybeSave() {
    if (scribbleArea.isModified()) {
      QMessageBox.StandardButton ret;
      ret =
          QMessageBox.warning(
              this,
              tr("Scribble"),
              tr("The image has been modified.\n" + "Do you want to save your changes?"),
              new QMessageBox.StandardButtons(
                  QMessageBox.StandardButton.Save, QMessageBox.StandardButton.Discard));

      if (ret == QMessageBox.StandardButton.Save) {
        return saveFile("png");
      } else if (ret == QMessageBox.StandardButton.Cancel) {
        return false;
      }
    }
    return true;
  }