Exemple #1
0
  private void createImagesGroupBox() {
    imagesGroupBox = new QGroupBox(tr("Images"));

    imagesTable = new QTableWidget();
    imagesTable.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection);
    imagesTable.setItemDelegate(new ImageDelegate(this));

    List<String> labels = new LinkedList<String>();
    labels.add(tr("Image"));
    labels.add(tr("Mode"));
    labels.add(tr("State"));

    imagesTable.horizontalHeader().setDefaultSectionSize(90);
    imagesTable.setColumnCount(3);
    imagesTable.setHorizontalHeaderLabels(labels);
    imagesTable.horizontalHeader().setResizeMode(0, QHeaderView.ResizeMode.Stretch);
    imagesTable.horizontalHeader().setResizeMode(1, QHeaderView.ResizeMode.Fixed);
    imagesTable.horizontalHeader().setResizeMode(2, QHeaderView.ResizeMode.Fixed);
    imagesTable.verticalHeader().hide();

    imagesTable.itemChanged.connect(this, "changeIcon()");

    QVBoxLayout layout = new QVBoxLayout();
    layout.addWidget(imagesTable);
    imagesGroupBox.setLayout(layout);
  }
Exemple #2
0
  private void createPreviewGroupBox() {
    previewGroupBox = new QGroupBox(tr("Preview"));

    previewArea = new IconPreviewArea();

    QVBoxLayout layout = new QVBoxLayout();
    layout.addWidget(previewArea);
    previewGroupBox.setLayout(layout);
  }
Exemple #3
0
  private void createIconSizeGroupBox() {
    iconSizeGroupBox = new QGroupBox(tr("Icon Size"));

    smallRadioButton = new QRadioButton();
    largeRadioButton = new QRadioButton();
    toolBarRadioButton = new QRadioButton();
    listViewRadioButton = new QRadioButton();
    iconViewRadioButton = new QRadioButton();
    tabBarRadioButton = new QRadioButton();
    otherRadioButton = new QRadioButton(tr("Other:"));

    otherSpinBox = new IconSizeSpinBox();
    otherSpinBox.setRange(8, 128);
    otherSpinBox.setValue(64);

    smallRadioButton.toggled.connect(this, "changeSize(boolean)");
    largeRadioButton.toggled.connect(this, "changeSize(boolean)");
    toolBarRadioButton.toggled.connect(this, "changeSize(boolean)");
    listViewRadioButton.toggled.connect(this, "changeSize(boolean)");
    iconViewRadioButton.toggled.connect(this, "changeSize(boolean)");
    tabBarRadioButton.toggled.connect(this, "changeSize(boolean)");
    otherRadioButton.toggled.connect(this, "changeSize(boolean)");
    otherSpinBox.valueChanged.connect(this, "changeSize(int)");

    QHBoxLayout otherSizeLayout = new QHBoxLayout();
    otherSizeLayout.addWidget(otherRadioButton);
    otherSizeLayout.addWidget(otherSpinBox);
    otherSizeLayout.addStretch();

    QGridLayout layout = new QGridLayout();
    layout.addWidget(smallRadioButton, 0, 0);
    layout.addWidget(largeRadioButton, 1, 0);
    layout.addWidget(toolBarRadioButton, 2, 0);
    layout.addWidget(listViewRadioButton, 0, 1);
    layout.addWidget(iconViewRadioButton, 1, 1);
    layout.addWidget(tabBarRadioButton, 2, 1);
    layout.addLayout(otherSizeLayout, 3, 0, 1, 2);
    layout.setRowStretch(4, 1);
    iconSizeGroupBox.setLayout(layout);
  }