コード例 #1
0
PipelineWidgetFilterLine::PipelineWidgetFilterLine(QWidget* parent, FilterPtr filter, QButtonGroup* buttonGroup) :
    BaseWidget(parent, "PipelineWidgetFilterLine", "PipelineWidgetFilterLine"),
    mFilter(filter)
{
	QHBoxLayout* layout = new QHBoxLayout(this);
	connect(this, SIGNAL(requestRunFilter()), this, SLOT(requestRunFilterSlot()));

	mRadioButton = new QRadioButton(this);
	buttonGroup->addButton(mRadioButton);
	connect(mRadioButton, SIGNAL(toggled(bool)), this, SLOT(radioButtonSelectedSlot(bool)));
	layout->addWidget(mRadioButton);
	layout->setMargin(0);
	layout->setSpacing(2);

	mAlgoNameLabel = new QLabel(QString("<b>%1</b>").arg(mFilter->getName()), this);
	mAlgoNameLabel->setToolTip(mFilter->getHelp());
	layout->addWidget(mAlgoNameLabel);

	mTimedAlgorithmProgressBar = new TimedAlgorithmProgressBar;
	mTimedAlgorithmProgressBar->setShowTextLabel(false);
	layout->addWidget(mTimedAlgorithmProgressBar, 1);

	mAction = this->createAction(this,
	                             QIcon(":/icons/open_icon_library/arrow-right-3.png"),
	                             "Run Filter", "",
	                             SIGNAL(requestRunFilter()),
	                             NULL);
	mAction->setData(mFilter->getUid());

	CXSmallToolButton* button = new CXSmallToolButton();
	button->setObjectName("RunFilterButton");
	button->setDefaultAction(mAction);
	layout->addWidget(button);

}
コード例 #2
0
ファイル: cxHelpWidget.cpp プロジェクト: c0ns0le/CustusX
void HelpWidget::addToggleTabWidgetButton(QBoxLayout* buttonLayout)
{
	QAction* action = this->createAction(this,
										   QIcon(":/icons/open_icon_library/view-list-tree.png"),
										   "Toggle show navigation controls", "",
										   SLOT(toggleShowNavigationControls()),
										   NULL);
	action->setCheckable(true);
	CXSmallToolButton* button = new CXSmallToolButton();
	button->setDefaultAction(action);
	buttonLayout->addWidget(button);
	mShowNavigationControlsAction = action;
}
コード例 #3
0
void FiltersWidget::addRunButton(QHBoxLayout* filterLayout)
{
    QAction* runAction = this->createAction(this,
                                            QIcon(":/icons/open_icon_library/arrow-right-3.png"),
                                            "Run Filter", "",
                                            SLOT(runFilterSlot()),
                                            NULL);

    CXSmallToolButton* button = new CXSmallToolButton();
    button->setObjectName("RunFilterButton");
    button->setDefaultAction(runAction);
    filterLayout->addWidget(button);
}
コード例 #4
0
DataSelectWidget::DataSelectWidget(ViewServicePtr viewService, PatientModelServicePtr patientModelService, QWidget *parent, SelectDataStringPropertyBasePtr data, QGridLayout* gridLayout, int row) :
    BaseWidget(parent, "DataSelectWidget", "DataSelectWidget"),
	mData(data),
	mViewService(viewService),
	mPatientModelService(patientModelService)
{

    QHBoxLayout* layout = new QHBoxLayout(this);
    layout->setMargin(0);
    layout->setSpacing(0);

	QWidget* widget = sscCreateDataWidget(this, mData, gridLayout, row);

    mToggleShowAction = this->createAction(this,
                    QIcon(":/icons/open_icon_library/eye.png.png"),
                    "Toggle show data in view", "",
                    SLOT(toggleShowData()),
                    NULL);
    mToggleShowAction->setCheckable(true);
    CXSmallToolButton* toggleShowButton = new CXSmallToolButton();
    toggleShowButton->setDefaultAction(mToggleShowAction);

	mRemoveButton = new EraseDataToolButton(this);
	connect(mRemoveButton, &EraseDataToolButton::eraseData, this, &DataSelectWidget::eraseData);

    if(gridLayout)
    {
    	gridLayout->setMargin(0);
    	gridLayout->setSpacing(0);
    	QHBoxLayout* lay = new QHBoxLayout;
    	lay->addWidget(toggleShowButton);
		lay->addWidget(mRemoveButton);
    	gridLayout->addLayout(lay, row, 2);
    }else
    {
		layout->addWidget(widget);
		layout->addWidget(toggleShowButton);
		layout->addWidget(mRemoveButton);
    }

	connect(mViewService.get(), SIGNAL(activeViewChanged()), this, SLOT(viewGroupChangedSlot()));
    connect(mData.get(), SIGNAL(changed()), this, SLOT(updateDataVisibility()));

	this->viewGroupChangedSlot();
}