Ejemplo n.º 1
0
DkTransferToolBar::DkTransferToolBar(QWidget * parent)
    : QToolBar(tr("Pseudo Color Toolbar"), parent) {

    loadSettings();


    enableTFCheckBox = new QCheckBox(tr("Enable"));
    enableTFCheckBox->setStatusTip(tr("Enables the Pseudo Color function"));

    this->addWidget(enableTFCheckBox);

    // >DIR: more compact gui [2.3.2012 markus]
    this->addSeparator();
    //this->addWidget(new QLabel(tr("Active channel:")));

    channelComboBox = new QComboBox(this);
    channelComboBox->setStatusTip(tr("Changes the displayed color channel"));
    this->addWidget(channelComboBox);

    historyCombo = new QComboBox(this);

    QAction* delGradientAction = new QAction(tr("Delete"), historyCombo);
    connect(delGradientAction, SIGNAL(triggered()), this, SLOT(deleteGradient()));

    historyCombo->addAction(delGradientAction);
    historyCombo->setContextMenuPolicy(Qt::ActionsContextMenu);

    updateGradientHistory();
    connect(historyCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(switchGradient(int)));
    connect(historyCombo, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(deleteGradientMenu(QPoint)));

    this->addWidget(historyCombo);

    createIcons();

    gradient = new DkGradient(this);
    gradient->setStatusTip(tr("Click into the field for a new slider"));
    this->addWidget(gradient);

    effect = new QGraphicsOpacityEffect(gradient);
    effect->setOpacity(1);
    gradient->setGraphicsEffect(effect);

    // Disable the entire transfer toolbar:
    //enableTF(Qt::Unchecked);

    // Initialize the combo box for color images:
    imageMode = mode_uninitialized;
    applyImageMode(mode_rgb);

    enableToolBar(false);
    enableTFCheckBox->setEnabled(true);

    connect(enableTFCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableTFCheckBoxClicked(int)));
    connect(gradient, SIGNAL(gradientChanged()), this, SLOT(applyTF()));

    // needed for initialization
    connect(this, SIGNAL(gradientChanged()), gradient, SIGNAL(gradientChanged()));

    if (!oldGradients.empty())
        gradient->setGradient(oldGradients.first());

};
Ejemplo n.º 2
0
void DkTransferToolBar::setImageMode(int mode) {

    applyImageMode(mode);

};
Ejemplo n.º 3
0
void DkTransferToolBar::setImageMode(int mode) {

	qDebug() << "and I received...";
	applyImageMode(mode);

};