本文整理汇总了C++中QScreen::physicalHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ QScreen::physicalHeight方法的具体用法?C++ QScreen::physicalHeight怎么用?C++ QScreen::physicalHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScreen
的用法示例。
在下文中一共展示了QScreen::physicalHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setImageMetrics
static inline void setImageMetrics(QImage &img, QWidget *window) {
QScreen *myScreen = getScreen(window);
if (myScreen) {
int dpmx = myScreen->width()*1000 / myScreen->physicalWidth();
int dpmy = myScreen->height()*1000 / myScreen->physicalHeight();
img.setDotsPerMeterX(dpmx);
img.setDotsPerMeterY(dpmy);
}
}
示例2: connect
bool QMultiScreen::connect(const QString &displaySpec)
{
QString dSpec = displaySpec;
if (dSpec.startsWith(QLatin1String("Multi:"), Qt::CaseInsensitive))
dSpec = dSpec.mid(QString::fromLatin1("Multi:").size());
const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
if (dSpec.endsWith(displayIdSpec))
dSpec = dSpec.left(dSpec.size() - displayIdSpec.size());
QStringList specs = dSpec.split(QLatin1Char(' '), QString::SkipEmptyParts);
foreach (QString spec, specs) {
const int id = getDisplayId(spec);
if (spec.startsWith("vnc:", Qt::CaseInsensitive)) {
spec.append(":noDisablePainting");
}
const QPoint offset = filterDisplayOffset(spec);
QScreen *s = qt_get_screen(id, spec.toLatin1().constData());
s->setOffset(offset);
addSubScreen(s);
}
QScreen *firstScreen = d_ptr->screens.at(0);
Q_ASSERT(firstScreen);
// XXX
QScreen::d = firstScreen->depth();
QScreen::lstep = 0;
QScreen::data = 0;
QScreen::size = 0;
QScreen::w = d_ptr->region.boundingRect().width();
QScreen::h = d_ptr->region.boundingRect().height();
QScreen::dw = QScreen::w;
QScreen::dh = QScreen::h;
// XXX - Extend the physical size based on the first screen
// to encompass all screens, so that code that uses the multi
// screen to calculate dpi values will get the right numbers.
QScreen::physWidth = firstScreen->physicalWidth() * w / firstScreen->width();
QScreen::physHeight = firstScreen->physicalHeight() * h / firstScreen->height();
// XXXXX
qt_screen = this;
return true;
}