示例#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;
      }
    }
  }
示例#2
0
  private void changeStyle(boolean checked) {
    if (!checked) return;

    QAction action = (QAction) QSignalEmitter.signalSender();
    QStyle style = QStyleFactory.create((String) action.data());

    if (style != null) {
      QApplication.setStyle(style);
      QApplication.setPalette(style.standardPalette());
    }

    setTextOnRadioButtons();

    changeSize(true);
  }