Ejemplo n.º 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);
  }
Ejemplo n.º 2
0
  private void createPreviewGroupBox() {
    previewGroupBox = new QGroupBox(tr("Preview"));

    previewArea = new IconPreviewArea();

    QVBoxLayout layout = new QVBoxLayout();
    layout.addWidget(previewArea);
    previewGroupBox.setLayout(layout);
  }
Ejemplo n.º 3
0
  // ! [0]
  public window(QWidget parent) {
    super(parent);
    // ! [0]
    QLabel textLabel = new QLabel(tr("Data:"), this);
    textBrowser = new QTextBrowser(this);

    QLabel mimeTypeLabel = new QLabel(tr("MIME types:"), this);
    mimeTypeCombo = new QComboBox(this);

    QVBoxLayout layout = new QVBoxLayout(this);
    layout.addWidget(textLabel);
    layout.addWidget(textBrowser);
    layout.addWidget(mimeTypeLabel);
    layout.addWidget(mimeTypeCombo);

    // ! [1]
    setAcceptDrops(true);
    // ! [1]
    setWindowTitle(tr("Drop Events"));
    // ! [2]
  }