Exemple #1
0
  private void checkCurrentStyle() {
    for (QAction action : styleActionGroup.actions()) {
      String styleName = action.data().toString();
      QStyle candidate = QStyleFactory.create(styleName);

      if (candidate.objectName().equals(QApplication.style().objectName())) {
        action.trigger();
        return;
      }
    }
  }
Exemple #2
0
  private void createMenus() {
    fileMenu = menuBar().addMenu(tr("&File"));
    fileMenu.addAction(addImagesAct);
    fileMenu.addAction(removeAllImagesAct);
    fileMenu.addSeparator();
    fileMenu.addAction(exitAct);

    viewMenu = menuBar().addMenu(tr("&View"));
    for (QAction action : styleActionGroup.actions()) viewMenu.addAction(action);
    viewMenu.addSeparator();
    viewMenu.addAction(guessModeStateAct);

    menuBar().addSeparator();

    helpMenu = menuBar().addMenu(tr("&Help"));
    helpMenu.addAction(aboutAct);
    helpMenu.addAction(aboutQtAct);
  }