本文整理汇总了C++中QStatusBar::height方法的典型用法代码示例。如果您正苦于以下问题:C++ QStatusBar::height方法的具体用法?C++ QStatusBar::height怎么用?C++ QStatusBar::height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStatusBar
的用法示例。
在下文中一共展示了QStatusBar::height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: event
bool event(QEvent* event) {
if (event->type() == QEvent::User) {
FrameEvent* frameEvent = (FrameEvent*)event;
if (close && frameEvent->getFrame()->getType() == Frame::typeNormal) {
double t = 1.0+frameId;
Frame frame_t = *frameEvent->getFrame();
if (frameId) {
meanFrame *= (t-1.0)/t;
meanFrame += frame_t*(1.0/t);
varianceFrame *= (t-1.0)/t;
frame_t -= meanFrame;
frame_t *= frame_t;
frame_t *= 1.0/(t-1.0);
varianceFrame += frame_t;
}
else {
meanFrame = frame_t*(1.0/t);
varianceFrame.resize(meanFrame.getWidth(), meanFrame.getHeight());
}
++frameId;
}
if (frameEvent->getFrame()->getType() == Frame::typeNormal) {
frame = *frameEvent->getFrame();
size_t width = frame.getWidth();
size_t height = frame.getHeight();
if (!calibrationFrame.isEmpty())
frame -= calibrationFrame;
else if (!lastCalibrationFrame.isEmpty())
frame -= lastCalibrationFrame;
float epsilon = std::numeric_limits<float>::epsilon();
if (!varianceFrame.isEmpty()) {
for (size_t x = 0; x < width; ++x)
for (size_t y = 0; y < height; ++y)
if (varianceFrame(x, y) < epsilon)
frame.close(x, y);
}
frame.normalize();
if (blur)
frame.gaussianBlur();
QImage image(width, height, QImage::Format_RGB888);
for (size_t x = 0; x < width; ++x)
for (size_t y = 0; y < height; ++y) {
float value = frame(x, y)*255.0;
image.setPixel(x, y, qRgb(value, value, value));
}
label.setPixmap(QPixmap::fromImage(
image.scaled(image.size()*scale)));
setFixedSize(label.pixmap()->width(), label.pixmap()->height()+
statusBar.height());
if (underMouse())
updateValue(centralWidget()->mapFromGlobal(QCursor::pos()));
}
else if (frameEvent->getFrame()->getType() == Frame::typeCalibration)
lastCalibrationFrame = *frameEvent->getFrame();
}
else
QMainWindow::event(event);
}