Esempio n. 1
0
void patternWindow::constructToolbar() {

  saveToPdfButton_ = new QPushButton(tr("To pdf (4/4)"), this);
  saveToPdfButton_->setShortcut(QKeySequence("Ctrl+return"));
  saveToPdfButton_->setToolTip(tr("Save the pattern as a pdf file"));
  connect(saveToPdfButton_, SIGNAL(clicked()),
          this, SLOT(saveSlot()));
  imageListBox_ = new comboBox(this);
  connect(imageListBox_, SIGNAL(activated(const QString& )),
          this, SLOT(processImageBox(const QString& )));
  addToolbarSeparator();
  addToolbarSeparator();
  addToolbarWidget(saveToPdfButton_);
  addToolbarSeparator();
  addToolbarSeparator();
  addToolbarAction(switchAction_);
  addToolbarAction(gridAction_);
  addToolbarSeparator();
  addToolbarSeparator();
  addToolbarAction(backHistoryAction_);
  addToolbarAction(forwardHistoryAction_);
  addToolbarSeparator();
  addToolbarSeparator();
  addToolbarAction(zoomInAction());
  addToolbarAction(zoomOutAction());
  addToolbarAction(originalSizeAction());
  addToolbarSeparator();
  addToolbarSeparator();
  addToolbarWidget(imageListBox_);
  addToolbarSeparator();
  addToolbarSeparator();
}
Esempio n. 2
0
void imageCompareBase::addLeftRightToolBarBoxes() {

  LLabel_ = new stateLabel("L");
  LLabel_->off();
  addToolbarWidget(LLabel_);
  addToolbarWidget(leftImageListBox_);
  addToolbarSeparator();

  RLabel_ = new stateLabel("R");
  RLabel_->off();
  addToolbarWidget(RLabel_);
  addToolbarWidget(rightImageListBox_);

  LLabel_->setBuddy(RLabel_);
  RLabel_->setBuddy(LLabel_);
}
Esempio n. 3
0
void colorChooser::constructProcessingObjects() {

  processButton_ = new QPushButton(QIcon(":colorCompare.png"),
                                   tr("Choose colors (1/4)"), this);
  processButton_->setShortcut(QKeySequence("Ctrl+return"));
  processButton_->
    setToolTip(tr("Process this image and move to color compare (2/4)"));
  // a spin box to choose the number of colors for chooseNumColors
  numColorsBox_ = new QSpinBox(this);
  numColorsBox_->setToolTip(tr("The number of colors to choose"));
  numColorsBox_->setRange(0, symbolChooser::maxNumberOfSymbols());
  numColorsBox_->setValue(80);
  numColorsBox_->setEnabled(false);

  // the processing type chooser
  processModeBox_ = new QComboBox(this);
  processModeBox_->setToolTip(tr("Select the mode used to choose colors"));
  // first is the item text, second is the toolTip for that item
  QList<QStringPair> modeStrings = processMode_.modeStrings();
  for (int i = 0, size = modeStrings.size(); i < size; ++i) {
    processModeBox_->addItem(modeStrings[i].first);
    processModeBox_->setItemData(i, modeStrings[i].second, Qt::ToolTipRole);
  }

  addToolbarSeparator();
  addToolbarSeparator();
  addToolbarWidget(processModeBox_);
  addToolbarWidget(numColorsBox_);
  addToolbarSeparator();
  addToolbarSeparator();
  addToolbarWidget(processButton_);
  addToolbarSeparator();
  addToolbarSeparator();
  addToolbarZoomIcons();
  addToolbarSeparator();
  addToolbarSeparator();

  const int boxHeight = numColorsBox_->height();
  processButton_->resize(processButton_->width(), boxHeight);
  processModeBox_->resize(processModeBox_->width(), boxHeight);

  connect(processModeBox_, SIGNAL(currentIndexChanged(int )),
          this, SLOT(processProcessChange(int )));
  connect(processButton_, SIGNAL(clicked()),
          this, SLOT(processProcessing()));

}