示例#1
0
void Viewport::toggleHQ()
{
	if (drawHQ->isChecked()) {
		// triggers drawing update
		endNoHQ();
	} else {
		startNoHQ();
		// deliberately make display worse for user to see effect
		updateBuffers();
	}
}
示例#2
0
void DistViewGUI::initVC(representation::t type)
{
	/* create VC, apply UI to it, then add to GV */
	vc = new AutohideWidget();
	uivc = new Ui::ViewportControl();
	uivc->setupUi(vc);
	ui->gv->addWidget(AutohideWidget::LEFT, vc);
	// small hack to enable proximity trigger for said autohide widget
	ui->gv->fitContentRect(QRect(20, 0, 0, 0)); //!! change when adding widgets!

	/* we are ready to connect signals/slots */

	// let user see how many bins he will end up with
	connect(uivc->binSlider, SIGNAL(sliderMoved(int)),
	        this, SLOT(setBinLabel(int)));
	connect(uivc->binSlider, SIGNAL(valueChanged(int)),
	        this, SLOT(setBinCount(int)));
	connect(uivc->alphaSlider, SIGNAL(valueChanged(int)),
	        this, SLOT(setAlpha(int)));

	// low quality drawing while user works the slider
	connect(uivc->alphaSlider, SIGNAL(sliderPressed()),
	        vp, SLOT(startNoHQ()));
	connect(uivc->alphaSlider, SIGNAL(sliderReleased()),
	        vp, SLOT(endNoHQ()));

	connect(uivc->limiterButton, SIGNAL(toggled(bool)),
	        vp, SLOT(setLimitersMode(bool)));
	connect(uivc->limiterMenuButton, SIGNAL(clicked()),
	        this, SLOT(showLimiterMenu()));

	connect(uivc->formatButton, SIGNAL(released()),
	        this, SLOT(showFrameBufferMenu()));

	// default UI stuff
	if (type != representation::IMG)
		uivc->rgbButton->setVisible(false);

	setAlpha(uivc->alphaSlider->value());
	setBinCount(uivc->binSlider->value());

	createFrameBufferMenu();
	// initialize from VP as we only implicitely store it
	updateBufferFormat(vp->format());

	initVPActions();
}