本文整理汇总了C++中MapView::verticalScrollBar方法的典型用法代码示例。如果您正苦于以下问题:C++ MapView::verticalScrollBar方法的具体用法?C++ MapView::verticalScrollBar怎么用?C++ MapView::verticalScrollBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapView
的用法示例。
在下文中一共展示了MapView::verticalScrollBar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openLastFiles
void MainWindow::openLastFiles()
{
const QStringList files = recentFiles();
mSettings.beginGroup(QLatin1String("recentFiles"));
int openCount = mSettings.value(QLatin1String("recentOpenedFiles"), 1).toInt();
QStringList mapScales = mSettings.value(
QLatin1String("mapScale")).toStringList();
QStringList scrollX = mSettings.value(
QLatin1String("scrollX")).toStringList();
QStringList scrollY = mSettings.value(
QLatin1String("scrollY")).toStringList();
QStringList selectedLayer = mSettings.value(
QLatin1String("selectedLayer")).toStringList();
for (int i = 0; i < openCount; i++) {
if (!(i < files.size()))
break;
if (!(i < mapScales.size()))
continue;
if (!(i < scrollX.size()))
continue;
if (!(i < scrollY.size()))
continue;
if (!(i < selectedLayer.size()))
continue;
if (openFile(files.at(i))) {
MapView *mapView = mDocumentManager->currentMapView();
// Restore camera to the previous position
qreal scale = mapScales.at(i).toDouble();
if (scale > 0)
mapView->zoomable()->setScale(scale);
const int hor = scrollX.at(i).toInt();
const int ver = scrollY.at(i).toInt();
mapView->horizontalScrollBar()->setSliderPosition(hor);
mapView->verticalScrollBar()->setSliderPosition(ver);
int layer = selectedLayer.at(i).toInt();
if (layer > 0 && layer < mMapDocument->map()->layerCount())
mMapDocument->setCurrentLayerIndex(layer);
}
}
QString lastActiveDocument =
mSettings.value(QLatin1String("lastActive")).toString();
int documentIndex = mDocumentManager->findDocument(lastActiveDocument);
if (documentIndex != -1)
mDocumentManager->switchToDocument(documentIndex);
mSettings.endGroup();
}