Example #1
0
 private QLabel createPixmapLabel() {
   QLabel label = new QLabel();
   label.setEnabled(false);
   label.setAlignment(Qt.AlignmentFlag.AlignCenter);
   label.setFrameShape(QFrame.Shape.Box);
   label.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding);
   label.setBackgroundRole(QPalette.ColorRole.Base);
   label.setAutoFillBackground(true);
   label.setMinimumSize(132, 132);
   return label;
 }
Example #2
0
  void setData(String mimetype, QByteArray newData) {
    mimeType = mimetype;
    data = new QByteArray(newData);

    dragDropLabel.setText(String.valueOf(data.size()) + " bytes.");

    List<String> formats = new Vector<String>();
    formats.add(mimetype);
    mimeTypes.emit(formats);
  }
Example #3
0
  public dragwidget(QWidget parent) {
    super(parent);

    setFrameStyle(QFrame.Shape.StyledPanel.value() | QFrame.Shadow.Sunken.value());
    dragDropLabel = new QLabel("", this);
    dragDropLabel.setAlignment(new Qt.Alignment(Qt.AlignmentFlag.AlignHCenter));

    QHBoxLayout layout = new QHBoxLayout(this);
    layout.addStretch(0);
    layout.addWidget(dragDropLabel);
    layout.addStretch(0);

    setAcceptDrops(true);
  }
Example #4
0
 private QLabel createHeaderLabel(String text) {
   QLabel label = new QLabel(tr("<b>" + text + "</b>"));
   label.setAlignment(Qt.AlignmentFlag.AlignCenter);
   return label;
 }