Example #1
0
  public Icons() {
    centralWidget = new QWidget();
    setCentralWidget(centralWidget);

    createPreviewGroupBox();
    createImagesGroupBox();
    createIconSizeGroupBox();

    createActions();
    createMenus();
    createContextMenu();

    QGridLayout mainLayout = new QGridLayout();
    mainLayout.addWidget(previewGroupBox, 0, 0, 1, 2);
    mainLayout.addWidget(imagesGroupBox, 1, 0);
    mainLayout.addWidget(iconSizeGroupBox, 1, 1);
    centralWidget.setLayout(mainLayout);

    setWindowTitle(tr("Icons"));
    otherRadioButton.click();

    setTextOnRadioButtons();

    resize(minimumSizeHint());
  }
Example #2
0
 @Override
 protected void resizeEvent(QResizeEvent event) {
   if (width() > image.width() || height() > image.height()) {
     int newWidth = Math.max(width() + 128, image.width());
     int newHeight = Math.max(height() + 128, image.height());
     image = resizeImage(image, new QSize(newWidth, newHeight));
     update();
   }
   super.resizeEvent(event);
 }