7#include "ui_MapWizard.h"
9#include "DgmlElementDictionary.h"
10#include "GeoSceneDocument.h"
11#include "GeoSceneGeodata.h"
12#include "GeoSceneHead.h"
13#include "GeoSceneIcon.h"
14#include "GeoSceneItem.h"
15#include "GeoSceneLayer.h"
16#include "GeoSceneLegend.h"
17#include "GeoSceneMap.h"
18#include "GeoSceneProperty.h"
19#include "GeoSceneSection.h"
20#include "GeoSceneSettings.h"
21#include "GeoSceneTileDataset.h"
22#include "GeoSceneVector.h"
23#include "GeoSceneZoom.h"
25#include "MarbleDebug.h"
26#include "MarbleDirs.h"
27#include "MarbleGlobal.h"
30#include "OwsServiceManager.h"
31#include "ServerLayout.h"
34#include <QColorDialog>
35#include <QDialogButtonBox>
40#include <QImageReader>
42#include <QNetworkReply>
43#include <QNetworkRequest>
46#include <QSharedPointer>
47#include <QSortFilterProxyModel>
48#include <QStandardItemModel>
51#include <QXmlStreamWriter>
56int const layerIdRole = 1001;
62 GlobalSourceImagePage,
73 : m_serverCapabilitiesValid(false)
74 , m_levelZeroTileValid(false)
75 , m_previewImageValid(false)
76 , m_legendImageValid(false)
86 void pageEntered(
int id);
88 Ui::MapWizard uiWidget;
92 OwsServiceManager owsManager;
97 bool m_serverCapabilitiesValid;
98 bool m_levelZeroTileValid;
99 bool m_previewImageValid;
100 bool m_legendImageValid;
112 mapType mapProviderType;
130class PreviewDialog :
public QDialog
138 bool deleteTheme(
const QString &directory);
142PreviewDialog::PreviewDialog(
QWidget *parent,
const QString &mapThemeId)
144 , m_mapThemeId(mapThemeId)
147 auto widget =
new MarbleWidget();
148 auto navigator =
new MarbleNavigator();
150 connect(navigator, SIGNAL(goHome()), widget, SLOT(goHome()));
151 connect(navigator, SIGNAL(moveUp()), widget, SLOT(moveUp()));
152 connect(navigator, SIGNAL(moveDown()), widget, SLOT(moveDown()));
153 connect(navigator, SIGNAL(moveLeft()), widget, SLOT(moveLeft()));
154 connect(navigator, SIGNAL(moveRight()), widget, SLOT(moveRight()));
157 connect(navigator, SIGNAL(zoomChanged(
int)), widget, SLOT(setZoom(
int)));
159 widget->setMapThemeId(m_mapThemeId);
160 widget->setZoom(1000);
162 layout->addWidget(navigator, 1, 1);
163 layout->addWidget(widget, 1, 2);
164 layout->setContentsMargins({});
165 layout->setSpacing(0);
167 this->setMinimumSize(640, 480);
168 this->setWindowTitle(tr(
"Preview Map"));
175 this->deleteTheme(directory);
179bool PreviewDialog::deleteTheme(
const QString &directory)
184 if (
dir.exists(directory)) {
187 result = deleteTheme(info.absoluteFilePath());
196 result =
dir.rmdir(directory);
202void MapWizardPrivate::pageEntered(
int id)
204 if (
id == WmsSelectionPage) {
205 m_serverCapabilitiesValid =
false;
206 uiWidget.lineEditWmsUrl->setFocus();
207 }
else if (
id == LayerSelectionPage ||
id == GlobalSourceImagePage) {
208 m_legendImageValid =
false;
209 m_previewImageValid =
false;
211 uiWidget.comboBoxStaticUrlServer->clear();
212 uiWidget.comboBoxStaticUrlServer->addItems(staticUrlServerList);
213 uiWidget.comboBoxStaticUrlServer->addItem(QStringLiteral(
"http://"));
214 }
else if (
id == ThemeInfoPage) {
215 m_legendImageValid =
false;
216 if (mapProviderType == MapWizardPrivate::StaticImageMap) {
220 }
else if (
id == LegendPage) {
221 m_levelZeroTileValid =
false;
225MapWizard::MapWizard(
QWidget *parent)
227 , d(new MapWizardPrivate)
231 connect(
this, SIGNAL(currentIdChanged(
int)),
this, SLOT(pageEntered(
int)));
233 connect(&d->owsManager, &OwsServiceManager::wmsCapabilitiesReady,
this, &MapWizard::processCapabilitiesResults);
234 connect(&d->owsManager, &OwsServiceManager::imageRequestResultReady,
this, &MapWizard::processImageResults);
236 connect(&d->owsManager, &OwsServiceManager::wmtsCapabilitiesReady,
this, &MapWizard::processCapabilitiesResults);
242 connect(d->uiWidget.comboBoxWmsServer, SIGNAL(textActivated(
QString)),
this, SLOT(setLineEditWms(
QString)));
250 connect(d->uiWidget.comboBoxWmsMaps, SIGNAL(currentIndexChanged(
int)),
this, SLOT(updateBackdropCheckBox()));
255 updateListViewSelection();
257 d->uiWidget.checkBoxWmsMultipleSelections->setVisible(
true);
258 d->uiWidget.checkBoxWmsBackdrop->setVisible(
true);
259 d->uiWidget.listViewWmsLayers->setModel(d->sortModel);
262 d->uiWidget.progressBarWmsCapabilities->setVisible(
false);
263 setLayerButtonsVisible(
true);
265 d->uiWidget.tabWidgetLayers->setCurrentIndex(0);
267 QPalette p = d->uiWidget.labelBackgroundColor->palette();
269 d->uiWidget.labelBackgroundColor->setAutoFillBackground(
true);
270 d->uiWidget.labelBackgroundColor->setPalette(p);
272 d->uiWidget.radioButtonXYZServer->setVisible(
false);
275MapWizard::~MapWizard()
280void MapWizard::processCapabilitiesResults()
282 d->uiWidget.progressBarWmsCapabilities->setVisible(
false);
284 button(MapWizard::NextButton)->setEnabled(
true);
286 if (d->owsManager.capabilitiesStatus() == OwsCapabilitiesReplyUnreadable) {
290 if (d->owsManager.capabilitiesStatus() == OwsCapabilitiesNoOwsServer) {
296 OwsMappingCapabilities owsCapabilities;
297 if (d->owsManager.owsServiceType() == WmsType) {
298 owsCapabilities = d->owsManager.wmsCapabilities();
299 }
else if (d->owsManager.owsServiceType() == WmtsType) {
300 owsCapabilities = d->owsManager.wmtsCapabilities();
303 d->uiWidget.labelWmsTitle->setText(QStringLiteral(
"Web Service: <b>%1</b>").arg(owsCapabilities.title()));
304 d->uiWidget.labelWmsTitle->setToolTip(QStringLiteral(
"<small>%1</small>").arg(owsCapabilities.abstract()));
306 for (
const auto &layer : owsCapabilities.layers()) {
307 if (!layer.isEmpty()) {
309 item->setData(layer, layerIdRole);
310 item->setToolTip(owsCapabilities.abstract(layer));
311 d->model->appendRow(item);
316 d->uiWidget.listViewWmsLayers->setCurrentIndex(d->sortModel->index(0, 0));
317 d->uiWidget.lineEditWmsSearch->setText(
QString());
319 d->uiWidget.comboBoxWmsFormat->clear();
320 if (d->owsManager.owsServiceType() == WmsType) {
321 d->uiWidget.comboBoxWmsFormat->addItems(d->owsManager.wmsCapabilities().formats());
324 d->uiWidget.comboBoxWmsFormat->setCurrentText(QStringLiteral(
"png"));
325 if (d->uiWidget.comboBoxWmsFormat->currentText() != QStringLiteral(
"png")) {
326 d->uiWidget.comboBoxWmsFormat->setCurrentText(QStringLiteral(
"jpeg"));
331 serviceInfo += QStringLiteral(
"<html>");
332 serviceInfo += d->owsManager.wmsCapabilities().abstract();
333 serviceInfo += QStringLiteral(
"<br><br><i>Contact:</i> %1").
arg(d->owsManager.wmsCapabilities().contactInformation());
334 serviceInfo += QStringLiteral(
"<br><br><i>Fees:</i> %1").
arg(d->owsManager.wmsCapabilities().fees());
335 serviceInfo += QStringLiteral(
"</html>");
337 d->uiWidget.textEditWmsServiceInfo->setText(serviceInfo);
338 d->uiWidget.tabServiceInfo->setEnabled(!serviceInfo.
isEmpty());
340 if (d->uiWidget.listViewWmsLayers->model()->rowCount() > 0) {
341 processSelectedLayerInformation();
344 d->m_serverCapabilitiesValid =
true;
346 if (d->owsManager.owsServiceType() == WmsType) {
347 if (!d->wmsServerList.contains(d->uiWidget.lineEditWmsUrl->text())) {
348 d->wmsServerList.append(d->uiWidget.lineEditWmsUrl->text());
350 setWmsServers(d->wmsServerList);
351 }
else if (d->owsManager.owsServiceType() == WmtsType) {
352 if (!d->wmtsServerList.contains(d->uiWidget.lineEditWmsUrl->text())) {
353 d->wmtsServerList.append(d->uiWidget.lineEditWmsUrl->text());
355 setWmtsServers(d->wmtsServerList);
360 setSearchFieldVisible(d->model->rowCount() > 20);
363void MapWizard::processSelectedLayerInformation()
365 updateListViewSelection();
368 QModelIndexList selectedIndexes = d->uiWidget.listViewWmsLayers->selectionModel()->selectedIndexes();
369 for (
auto selectedIndex : std::as_const(selectedIndexes)) {
370 selectedList << d->sortModel->
data(selectedIndex, layerIdRole).toString();
372 d->selectedLayers = selectedList;
373 OwsMappingCapabilities owsCapabilities;
374 if (d->owsManager.owsServiceType() == WmsType) {
375 owsCapabilities = d->owsManager.wmsCapabilities();
376 }
else if (d->owsManager.owsServiceType() == WmtsType) {
377 owsCapabilities = d->owsManager.wmtsCapabilities();
379 d->uiWidget.comboBoxWmsMaps->
clear();
381 epsgToText[QStringLiteral(
"epsg:3857")] = tr(
"Web Mercator (epsg:3857)");
382 epsgToText[QStringLiteral(
"epsg:4326")] = tr(
"Equirectangular (epsg:4326)");
383 epsgToText[QStringLiteral(
"crs:84")] = tr(
"Equirectangular (crs:84)");
385 if (d->selectedLayers.isEmpty()) {
389 if (d->owsManager.owsServiceType() == WmsType) {
390 WmsCapabilities
capabilities = d->owsManager.wmsCapabilities();
391 for (
const auto &projection :
capabilities.projections(d->selectedLayers.first())) {
392 projectionTextList << epsgToText[projection];
394 d->uiWidget.labelWmsTileProjection->setText(tr(
"Tile Projection:"));
395 d->uiWidget.comboBoxWmsMaps->addItems(projectionTextList);
398 d->uiWidget.comboBoxWmsMaps->setCurrentText(tr(
"Web Mercator (epsg:3857)"));
400 updateBackdropCheckBox();
407 if (d->owsManager.owsServiceType() == WmtsType) {
408 WmtsCapabilities
capabilities = d->owsManager.wmtsCapabilities();
410 d->uiWidget.labelWmsTileProjection->setText(tr(
"Tile Matrix Set:"));
411 d->uiWidget.comboBoxWmsMaps->addItems(
capabilities.wmtsTileMatrixSets()[selectedLayer]);
412 d->uiWidget.comboBoxWmsFormat->addItems(
capabilities.wmtsTileResource()[selectedLayer].keys());
414 d->uiWidget.comboBoxWmsFormat->setCurrentText(QStringLiteral(
"png"));
415 if (d->uiWidget.comboBoxWmsFormat->currentText() != QStringLiteral(
"png")) {
416 d->uiWidget.comboBoxWmsFormat->setCurrentText(QStringLiteral(
"jpeg"));
420 d->uiWidget.lineEditTitle->setText(owsCapabilities.title(d->selectedLayers.first()));
426 d->uiWidget.lineEditTheme->setText(themeString);
429 d->uiWidget.lineEditTheme->setValidator(validator);
432 description += QStringLiteral(
"<html>");
433 description += owsCapabilities.abstract(d->selectedLayers.first());
434 if (d->owsManager.owsServiceType() == WmsType) {
435 description += QStringLiteral(
"<br><br><i>Contact:</i> %1").
arg(d->owsManager.wmsCapabilities().contactInformation());
436 description += QStringLiteral(
"<br><br><i>Fees:</i> %1").
arg(d->owsManager.wmsCapabilities().fees());
438 description += QStringLiteral(
"</html>");
439 d->uiWidget.textEditDesc->setText(description);
442 layerInfo += owsCapabilities.abstract(d->selectedLayers.first());
443 d->uiWidget.tabLayerInfo->setEnabled(!layerInfo.
isEmpty());
444 d->uiWidget.textEditWmsLayerInfo->setText(layerInfo);
447void MapWizard::processImageResults()
449 setLayerButtonsVisible(
true);
451 if (d->owsManager.imageRequestResult().resultType() == PreviewImage) {
452 d->m_previewImageValid =
true;
453 imageType = tr(
"Preview Image");
455 if (d->owsManager.imageRequestResult().resultType() == LevelZeroTile) {
456 d->m_levelZeroTileValid =
true;
457 imageType = tr(
"Base Tile");
459 if (d->owsManager.imageRequestResult().resultType() == LevelZeroTile) {
460 d->m_legendImageValid =
true;
461 imageType = tr(
"Legend Image");
464 button(MapWizard::NextButton)->setEnabled(
true);
466 if (d->owsManager.imageRequestResult().imageStatus() == WmsImageFailed) {
468 if (imageType ==
QChar(PreviewImage))
469 d->m_previewImageValid =
false;
470 if (imageType ==
QChar(LevelZeroTile))
471 d->m_levelZeroTileValid =
false;
472 if (imageType ==
QChar(LegendImage))
473 d->m_legendImageValid =
false;
474 }
else if (d->owsManager.imageRequestResult().imageStatus() == WmsImageFailedServerMessage) {
477 tr(
"%1").arg(imageType),
478 tr(
"The %1 could not be downloaded successfully. The server replied:\n\n%2").arg(imageType,
QString::fromLatin1(d->owsManager.resultRaw())));
479 if (imageType ==
QChar(PreviewImage))
480 d->m_previewImageValid =
false;
481 if (imageType ==
QChar(LevelZeroTile))
482 d->m_levelZeroTileValid =
false;
483 if (imageType ==
QChar(LegendImage))
484 d->m_legendImageValid =
false;
486 if (d->owsManager.imageRequestResult().resultType() == PreviewImage) {
489 d->uiWidget.labelThumbnail->setPixmap(previewPixmap);
490 d->uiWidget.labelThumbnail->resize(
QSize(100, 100));
491 d->uiWidget.labelPreview->setPixmap(previewPixmap);
492 d->uiWidget.labelPreview->resize(
QSize(100, 100));
494 if (d->owsManager.imageRequestResult().resultType() == LevelZeroTile) {
495 d->levelZeroTile = d->owsManager.resultImage();
496 d->levelZero = d->owsManager.resultRaw();
498 if (d->owsManager.imageRequestResult().resultType() == LegendImage) {
499 d->legendImage = d->owsManager.resultImage();
500 d->legend = d->owsManager.resultRaw();
502 d->uiWidget.labelLegendImage->resize(legendPixmap.
size());
503 d->uiWidget.labelLegendImage->setPixmap(legendPixmap);
509void MapWizard::createWmsLegend()
512 if (!
map.exists(QStringLiteral(
"legend"))) {
513 map.mkdir(QStringLiteral(
"legend"));
518 image.write(d->legend);
521 const QString legendHtml = createLegendHtml();
522 createLegendFile(legendHtml);
525void MapWizard::setWmsServers(
const QStringList &uris)
527 d->wmsServerList = uris;
532 return d->wmtsServerList;
535void MapWizard::setWmtsServers(
const QStringList &uris)
537 d->wmtsServerList = uris;
542 return d->wmsServerList;
547 return d->staticUrlServerList;
550void MapWizard::setStaticUrlServers(
const QStringList &uris)
552 d->staticUrlServerList = uris;
555void MapWizard::setLineEditWms(
const QString &text)
557 if (text == tr(
"Custom")) {
558 d->uiWidget.lineEditWmsUrl->setText(
QString());
560 d->uiWidget.lineEditWmsUrl->setText(text);
564void MapWizard::setLayerButtonsVisible(
bool visible)
566 d->uiWidget.checkBoxWmsMultipleSelections->setVisible(visible);
567 d->uiWidget.checkBoxWmsBackdrop->setVisible(visible);
568 d->uiWidget.comboBoxWmsFormat->setVisible(visible);
569 d->uiWidget.comboBoxWmsMaps->setVisible(visible);
570 d->uiWidget.labelWmsTileFormat->setVisible(visible);
571 d->uiWidget.labelWmsTileProjection->setVisible(visible);
572 d->uiWidget.progressBarWmsLayers->setVisible(!visible);
575void MapWizard::setSearchFieldVisible(
bool visible)
577 d->uiWidget.labelWmsSearch->setVisible(visible);
578 d->uiWidget.lineEditWmsSearch->setText(
QString());
579 d->uiWidget.lineEditWmsSearch->setVisible(visible);
580 d->uiWidget.lineEditWmsSearch->setFocus();
583bool MapWizard::createFiles(
const GeoSceneDocument *document)
587 if (!maps.exists(document->head()->theme())) {
588 maps.mkdir(document->head()->theme());
590 if (d->mapProviderType == MapWizardPrivate::StaticImageMap) {
592 QFile sourceImage(d->sourceImage);
593 d->format = d->sourceImage.right(d->sourceImage.length() - d->sourceImage.lastIndexOf(
QLatin1Char(
'.')) - 1).toLower();
594 sourceImage.copy(QStringLiteral(
"%1/%2/%2.%3").arg(maps.absolutePath(), document->head()->theme(), d->format));
597 else if (d->mapProviderType == MapWizardPrivate::WmsMap || d->mapProviderType == MapWizardPrivate::WmtsMap) {
598 maps.mkdir(QStringLiteral(
"%1/0/").arg(document->head()->theme()));
599 maps.mkdir(QStringLiteral(
"%1/0/0").arg(document->head()->theme()));
600 const QString path = QStringLiteral(
"%1/%2/0/0/0.%3").
arg(maps.absolutePath(), document->head()->theme(), d->owsManager.resultFormat());
601 QFile baseTile(path);
603 baseTile.write(d->levelZero);
606 else if (d->mapProviderType == MapWizardPrivate::StaticUrlMap) {
607 maps.mkdir(QStringLiteral(
"%1/0/").arg(document->head()->theme()));
608 maps.mkdir(QStringLiteral(
"%1/0/0").arg(document->head()->theme()));
609 const QString path = QStringLiteral(
"%1/%2/0/0/0.%3").
arg(maps.absolutePath(), document->head()->theme(), d->format);
610 QFile baseTile(path);
612 baseTile.write(d->levelZero);
616 QString pixmapPath = QStringLiteral(
"%1/%2/%3").
arg(maps.absolutePath(), document->head()->theme(), document->head()->icon()->pixmap());
617 d->previewImage.save(pixmapPath);
620 QFile file(QStringLiteral(
"%1/%2/%2.dgml").arg(maps.absolutePath(), document->head()->theme()));
624 geoWriter.write(&file, document);
638 stream.writeStartDocument();
639 stream.writeStartElement(
"html");
640 stream.writeStartElement(
"head");
642 stream.writeTextElement(
"title",
"Marble: Legend");
643 stream.writeStartElement(
"link");
644 stream.writeAttribute(
"href",
"legend.css");
645 stream.writeAttribute(
"rel",
"stylesheet");
646 stream.writeAttribute(
"type",
"text/css");
647 stream.writeEndElement();
649 stream.writeStartElement(
"body");
650 stream.writeStartElement(
"img");
651 stream.writeAttribute(
"src", image);
652 stream.writeEndElement();
653 stream.writeComment(
" ##customLegendEntries:all## ");
654 stream.writeEndElement();
655 stream.writeEndElement();
660void MapWizard::createLegendFile(
const QString &legendHtml)
670void MapWizard::createLegend()
673 if (!
map.exists(QStringLiteral(
"legend"))) {
674 map.mkdir(QStringLiteral(
"legend"));
678 image.
setFileName(d->uiWidget.lineEditLegend_2->text());
681 const QString legendHtml = createLegendHtml();
682 createLegendFile(legendHtml);
685void MapWizard::querySourceImage()
690void MapWizard::queryPreviewImage()
693 d->previewImage =
QImage(fileName);
696 d->uiWidget.labelThumbnail->setPixmap(preview);
697 d->uiWidget.labelThumbnail->resize(preview.
width(), preview.
height());
700void MapWizard::queryLegendImage()
703 d->uiWidget.lineEditLegend_2->setText(fileName);
704 QImage legendImage(fileName);
706 d->uiWidget.labelLegendImage->setPixmap(legendPixmap);
717 tarArgs.
append(QStringLiteral(
"--create"));
718 tarArgs.
append(QStringLiteral(
"--gzip"));
719 tarArgs.
append(QStringLiteral(
"--file"));
721 tarArgs.
append(QStringLiteral(
"--directory"));
723 if (
QFile::exists(QStringLiteral(
"%1/maps/%2").arg(MarbleDirs::localPath(), mapId))) {
724 tarArgs.
append(QStringLiteral(
"%1/maps/").arg(MarbleDirs::localPath()));
725 themeDir.
cd(QStringLiteral(
"%1/maps/%2/%3").arg(MarbleDirs::localPath(), body, theme));
728 else if (
QFile::exists(QStringLiteral(
"%1/maps/%2").arg(MarbleDirs::systemPath(), mapId))) {
729 tarArgs.
append(QStringLiteral(
"%1/maps/").arg(MarbleDirs::systemPath()));
730 themeDir.
cd(QStringLiteral(
"%1/maps/%2/%3").arg(MarbleDirs::systemPath(), body, theme));
734 tarArgs.
append(QStringLiteral(
"%1/%2/%2.dgml").arg(body, theme));
738 tarArgs.
append(QStringLiteral(
"%1/%2/legend.html").arg(body, theme));
742 tarArgs.
append(QStringLiteral(
"%1/%2/legend").arg(body, theme));
746 tarArgs.
append(QStringLiteral(
"%1/%2/0/000000").arg(body, theme));
750 previewFilters << QStringLiteral(
"preview.*");
753 tarArgs.
append(QStringLiteral(
"%1/%2/%3").arg(body).arg(theme, preview[0]));
760 tarArgs.
append(QStringLiteral(
"%1/%2/%3").arg(body).arg(theme, sourceImg[0]));
764 switch (archiver.
execute(QStringLiteral(
"tar"), tarArgs)) {
772 mDebug() <<
"Archived the theme successfully.";
776 return QStringLiteral(
"%1/%2.tar.gz").arg(
QDir::tempPath(), theme);
779void MapWizard::deleteArchive(
const QString &mapId)
786bool MapWizard::validateCurrentPage()
788 if (currentId() == WelcomePage) {
789 updateOwsServiceType();
792 if (currentId() == WmsSelectionPage && !d->m_serverCapabilitiesValid) {
793 d->uiWidget.progressBarWmsCapabilities->setVisible(
true);
794 QString serviceString = d->uiWidget.radioButtonWms->isChecked() ? QStringLiteral(
"WMS")
795 : d->uiWidget.radioButtonWmts->isChecked() ? QStringLiteral(
"WMTS")
797 d->owsManager.queryOwsCapabilities(
QUrl(d->uiWidget.lineEditWmsUrl->text()), serviceString);
798 button(MapWizard::NextButton)->setEnabled(
false);
802 if ((currentId() == LayerSelectionPage && !d->m_previewImageValid) || (currentId() == XYZUrlPage && !d->m_previewImageValid)) {
803 if (d->mapProviderType == MapWizardPrivate::WmsMap && d->uiWidget.listViewWmsLayers->currentIndex().isValid()) {
805 QModelIndexList selectedIndexes = d->uiWidget.listViewWmsLayers->selectionModel()->selectedIndexes();
806 for (
auto selectedIndex : std::as_const(selectedIndexes)) {
807 selectedList << d->sortModel->
data(selectedIndex, layerIdRole).toString();
809 d->selectedLayers = selectedList;
812 if (d->uiWidget.comboBoxWmsMaps->currentText() == tr(
"Equirectangular (epsg:4326)"))
813 projection = QStringLiteral(
"epsg:4326");
814 else if (d->uiWidget.comboBoxWmsMaps->currentText() == tr(
"Equirectangular (crs:84)"))
815 projection = QStringLiteral(
"crs:84");
817 projection = QStringLiteral(
"epsg:3857");
818 d->selectedProjection = projection;
819 QString format = d->uiWidget.comboBoxWmsFormat->currentText();
820 QStringList styles = d->owsManager.wmsCapabilities().styles(d->selectedLayers);
821 d->owsManager.queryWmsPreviewImage(
QUrl(d->uiWidget.lineEditWmsUrl->text()),
826 setLayerButtonsVisible(
false);
827 button(MapWizard::NextButton)->setEnabled(
false);
828 }
else if (d->mapProviderType == MapWizardPrivate::WmtsMap && d->uiWidget.listViewWmsLayers->currentIndex().isValid()) {
830 QModelIndexList selectedIndexes = d->uiWidget.listViewWmsLayers->selectionModel()->selectedIndexes();
831 for (
auto selectedIndex : std::as_const(selectedIndexes)) {
832 selectedList << d->sortModel->
data(selectedIndex, layerIdRole).toString();
834 d->selectedLayers = selectedList;
836 QString tileMatrixSet = d->uiWidget.comboBoxWmsMaps->currentText();
837 QString tileFormat = d->uiWidget.comboBoxWmsFormat->currentText();
838 QString url = d->owsManager.wmtsCapabilities().wmtsTileResource()[d->selectedLayers.first()][tileFormat];
839 QString style = d->owsManager.wmtsCapabilities().style(d->selectedLayers.first());
840 d->owsManager.queryWmtsPreviewImage(url, style, tileMatrixSet);
841 setLayerButtonsVisible(
false);
842 button(MapWizard::NextButton)->setEnabled(
false);
843 }
else if (d->mapProviderType == MapWizardPrivate::StaticUrlMap) {
844 QString urlString = d->uiWidget.comboBoxStaticUrlServer->currentText();
845 d->owsManager.queryXYZPreviewImage(urlString);
846 d->staticUrlServerList.removeAll(urlString);
847 d->staticUrlServerList.
prepend(urlString);
849 d->uiWidget.lineEditTitle->
clear();
850 d->uiWidget.lineEditTheme->clear();
851 d->uiWidget.textEditDesc->clear();
852 d->uiWidget.labelPreview->clear();
853 d->uiWidget.lineEditTitle->setFocus();
854 button(MapWizard::NextButton)->setEnabled(
false);
859 if (currentId() == GlobalSourceImagePage) {
860 d->sourceImage = d->uiWidget.lineEditSource->text();
861 if (d->sourceImage.isEmpty()) {
863 d->uiWidget.lineEditSource->setFocus();
868 QMessageBox::information(
this, tr(
"Source Image"), tr(
"The source image you specified does not exist. Please specify a different one."));
869 d->uiWidget.lineEditSource->setFocus();
870 d->uiWidget.lineEditSource->selectAll();
877 tr(
"The source image you specified does not seem to be an image. Please specify a different image file."));
878 d->uiWidget.lineEditSource->setFocus();
879 d->uiWidget.lineEditSource->selectAll();
883 d->uiWidget.lineEditTitle->clear();
884 d->uiWidget.lineEditTheme->clear();
885 d->uiWidget.textEditDesc->clear();
886 d->uiWidget.labelPreview->clear();
890 d->uiWidget.labelPreview->setPixmap(previewPixmap);
891 d->uiWidget.labelPreview->resize(
QSize(100, 100));
892 d->uiWidget.labelThumbnail->setPixmap(previewPixmap);
893 d->uiWidget.labelThumbnail->resize(
QSize(100, 100));
896 if (currentId() == ThemeInfoPage) {
897 if (d->mapProviderType == MapWizardPrivate::WmsMap && !d->m_legendImageValid) {
898 QString legendUrl = d->owsManager.wmsCapabilities().legendUrl(d->selectedLayers.first());
900 d->m_legendImageValid =
true;
901 d->owsManager.queryWmsLegendImage(
QUrl(legendUrl));
902 button(MapWizard::NextButton)->setEnabled(
false);
906 if (d->uiWidget.lineEditTitle->text().isEmpty()) {
908 d->uiWidget.lineEditTitle->setFocus();
912 d->mapTheme = d->uiWidget.lineEditTheme->text();
913 if (d->mapTheme.isEmpty()) {
915 d->uiWidget.lineEditTheme->setFocus();
919 const QDir destinationDir(QStringLiteral(
"%1/maps/earth/%2").arg(MarbleDirs::localPath(), d->mapTheme));
920 if (destinationDir.exists()) {
921 QMessageBox::information(
this, tr(
"Map Name"), tr(
"Please specify another map name, since there is already a map named \"%1\".").arg(d->mapTheme));
922 d->uiWidget.lineEditTheme->setFocus();
923 d->uiWidget.lineEditTheme->selectAll();
927 if (d->previewImage.isNull()) {
929 d->uiWidget.pushButtonPreview->setFocus();
933 if (currentId() == LegendPage && !d->m_levelZeroTileValid && d->mapProviderType != MapWizardPrivate::StaticImageMap) {
934 if (d->mapProviderType == MapWizardPrivate::WmsMap) {
936 if (d->uiWidget.comboBoxWmsMaps->currentText() == tr(
"Equirectangular (epsg:4326)"))
937 projection = QStringLiteral(
"epsg:4326");
938 else if (d->uiWidget.comboBoxWmsMaps->currentText() == tr(
"Equirectangular (crs:84)"))
939 projection = QStringLiteral(
"crs:84");
941 projection = QStringLiteral(
"epsg:3857");
942 d->selectedProjection = projection;
943 QString format = d->uiWidget.comboBoxWmsFormat->currentText();
944 QStringList styles = d->owsManager.wmsCapabilities().styles(d->selectedLayers);
945 d->owsManager.queryWmsLevelZeroTile(
QUrl(d->uiWidget.lineEditWmsUrl->text()), d->selectedLayers.first(), projection, format, styles.
first());
946 }
else if (d->mapProviderType == MapWizardPrivate::WmtsMap) {
948 QModelIndexList selectedIndexes = d->uiWidget.listViewWmsLayers->selectionModel()->selectedIndexes();
949 for (
auto selectedIndex : std::as_const(selectedIndexes)) {
950 selectedList << d->sortModel->
data(selectedIndex, layerIdRole).toString();
952 d->selectedLayers = selectedList;
954 QString tileMatrixSet = d->uiWidget.comboBoxWmsMaps->currentText();
955 QString tileFormat = d->uiWidget.comboBoxWmsFormat->currentText();
956 QString url = d->owsManager.wmtsCapabilities().wmtsTileResource()[d->selectedLayers.first()][tileFormat];
957 QString style = d->owsManager.wmtsCapabilities().style(d->selectedLayers.first());
958 d->owsManager.queryWmtsLevelZeroTile(url, style, tileMatrixSet);
959 }
else if (d->mapProviderType == MapWizardPrivate::StaticUrlMap) {
960 QString urlString = d->uiWidget.comboBoxStaticUrlServer->currentText();
961 d->owsManager.queryXYZLevelZeroTile(urlString);
963 button(MapWizard::NextButton)->setEnabled(
false);
970int MapWizard::nextId()
const
972 switch (currentId()) {
974 if (d->uiWidget.radioButtonWms->isChecked()) {
975 d->mapProviderType = MapWizardPrivate::WmsMap;
976 return WmsSelectionPage;
977 }
else if (d->uiWidget.radioButtonWmts->isChecked()) {
978 d->mapProviderType = MapWizardPrivate::WmtsMap;
979 return WmsSelectionPage;
980 }
else if (d->uiWidget.radioButtonBitmap->isChecked()) {
981 d->mapProviderType = MapWizardPrivate::StaticImageMap;
982 return GlobalSourceImagePage;
983 }
else if (d->uiWidget.radioButtonStaticUrl->isChecked()) {
984 d->mapProviderType = MapWizardPrivate::StaticUrlMap;
989 case WmsSelectionPage:
990 return LayerSelectionPage;
992 case LayerSelectionPage:
993 return ThemeInfoPage;
995 case GlobalSourceImagePage:
996 return ThemeInfoPage;
1011 return currentId() + 1;
1014void MapWizard::cleanupPage(
int id)
1016 if (d->mapProviderType == MapWizardPrivate::StaticUrlMap) {
1017 if (
id == ThemeInfoPage) {
1018 d->levelZero.clear();
1025GeoSceneDocument *MapWizard::createDocument()
1027 auto document =
new GeoSceneDocument;
1029 GeoSceneHead *head = document->head();
1030 head->setName(d->uiWidget.lineEditTitle->text());
1031 head->setTheme(d->uiWidget.lineEditTheme->text());
1032 head->setTarget(QStringLiteral(
"earth"));
1033 head->setDescription(d->uiWidget.textEditDesc->document()->toHtml());
1034 head->setVisible(
true);
1036 GeoSceneIcon *icon = head->icon();
1037 icon->setPixmap(QStringLiteral(
"%1-preview.png").arg(document->head()->theme()));
1039 GeoSceneZoom *
zoom = head->zoom();
1040 zoom->setMinimum(900);
1041 zoom->setMaximum(3500);
1042 zoom->setDiscrete(
false);
1044 GeoSceneTileDataset *backdropTexture =
nullptr;
1045 bool isBackdropTextureAvailable =
1046 d->uiWidget.checkBoxWmsBackdrop->
isEnabled() && d->uiWidget.checkBoxWmsBackdrop->isChecked() && d->uiWidget.radioButtonOpenStreetMap->isChecked();
1047 if (isBackdropTextureAvailable) {
1048 if (d->uiWidget.radioButtonXYZServer) {
1049 backdropTexture =
new GeoSceneTileDataset(QStringLiteral(
"backdrop"));
1050 backdropTexture->setExpire(31536000);
1052 backdropTexture->setFileFormat(QStringLiteral(
"PNG"));
1053 backdropTexture->addDownloadPolicy(DownloadBrowse, 20);
1054 backdropTexture->addDownloadPolicy(DownloadBulk, 2);
1055 backdropTexture->addDownloadUrl(
QUrl(QStringLiteral(
"https://tile.openstreetmap.org/")));
1056 backdropTexture->setMaximumTileLevel(20);
1057 backdropTexture->setTileSize(
QSize(256, 256));
1058 backdropTexture->setLevelZeroRows(1);
1059 backdropTexture->setLevelZeroColumns(1);
1060 backdropTexture->setServerLayout(
new OsmServerLayout(backdropTexture));
1061 backdropTexture->setTileProjection(GeoSceneAbstractTileProjection::Mercator);
1065 auto texture =
new GeoSceneTileDataset(QStringLiteral(
"map"));
1066 texture->setExpire(31536000);
1068 if (d->mapProviderType == MapWizardPrivate::WmsMap) {
1069 texture->setFileFormat(d->owsManager.resultFormat());
1070 QStringList styles = d->owsManager.wmsCapabilities().styles(d->selectedLayers);
1071 QUrl downloadUrl =
QUrl(d->uiWidget.lineEditWmsUrl->text());
1074 urlQuery.
addQueryItem(QStringLiteral(
"styles"), styles.
join(QStringLiteral(
",")));
1075 bool isBackdropAvailable = d->uiWidget.checkBoxWmsBackdrop->isEnabled() && d->uiWidget.checkBoxWmsBackdrop->isChecked();
1076 urlQuery.
addQueryItem(QStringLiteral(
"transparent"), isBackdropTextureAvailable ? QStringLiteral(
"true") : QStringLiteral(
"false"));
1078 if (d->uiWidget.checkBoxWmsBackdrop->isChecked() && d->uiWidget.radioButtonColor->isChecked()) {
1080 bgColorName = bgColorName.
remove(QStringLiteral(
"#"));
1081 bgColorName = QStringLiteral(
"0x") + bgColorName;
1082 urlQuery.
addQueryItem(QStringLiteral(
"bgcolor"), bgColorName);
1085 texture->addDownloadUrl(downloadUrl);
1086 texture->setMaximumTileLevel(20);
1087 texture->setTileSize(
QSize(256, 256));
1088 texture->setLevelZeroRows(1);
1089 texture->setLevelZeroColumns(1);
1090 texture->setServerLayout(
new WmsServerLayout(texture));
1091 if (d->uiWidget.comboBoxWmsMaps->currentText() == tr(
"Web Mercator (epsg:3857)")) {
1092 texture->setTileProjection(GeoSceneAbstractTileProjection::Mercator);
1094 texture->setTileProjection(GeoSceneAbstractTileProjection::Equirectangular);
1096 if (isBackdropAvailable) {
1097 texture->setBlending(QStringLiteral(
"AlphaBlending"));
1100 if (d->mapProviderType == MapWizardPrivate::WmtsMap) {
1101 QString format = d->uiWidget.comboBoxWmsFormat->currentText();
1102 texture->setFileFormat(format);
1104 QString urlString = d->owsManager.wmtsCapabilities().wmtsTileResource()[selectedLayer][format];
1109 QUrl downloadUrl =
QUrl(urlString);
1110 texture->addDownloadPolicy(DownloadBrowse, 20);
1111 texture->addDownloadPolicy(DownloadBulk, 2);
1112 texture->addDownloadUrl(downloadUrl);
1113 texture->setMaximumTileLevel(20);
1114 texture->setTileSize(
QSize(256, 256));
1115 texture->setLevelZeroRows(1);
1116 texture->setLevelZeroColumns(1);
1117 texture->setServerLayout(
new WmtsServerLayout(texture));
1118 texture->setTileProjection(GeoSceneAbstractTileProjection::Mercator);
1121 else if (d->mapProviderType == MapWizardPrivate::StaticUrlMap) {
1122 texture->setFileFormat(d->format);
1123 QUrl downloadUrl =
QUrl(d->uiWidget.comboBoxStaticUrlServer->currentText());
1124 texture->addDownloadPolicy(DownloadBrowse, 20);
1125 texture->addDownloadPolicy(DownloadBulk, 2);
1126 texture->addDownloadUrl(downloadUrl);
1127 texture->setMaximumTileLevel(20);
1128 texture->setTileSize(
QSize(256, 256));
1129 texture->setLevelZeroRows(1);
1130 texture->setLevelZeroColumns(1);
1131 texture->setServerLayout(
new CustomServerLayout(texture));
1132 texture->setTileProjection(GeoSceneAbstractTileProjection::Mercator);
1135 else if (d->mapProviderType == MapWizardPrivate::StaticImageMap) {
1136 QString image = d->uiWidget.lineEditSource->text();
1138 texture->setFileFormat(d->format.toUpper());
1139 texture->setInstallMap(document->head()->theme() +
QLatin1Char(
'.') + d->format);
1140 texture->setServerLayout(
new MarbleServerLayout(texture));
1141 texture->setTileProjection(GeoSceneAbstractTileProjection::Equirectangular);
1143 int tileSize = c_defaultTileSize;
1145 float approxMaxTileLevel = log(imageWidth / (2.0 * tileSize)) / log(2.0);
1146 int maxTileLevel = 0;
1147 if (approxMaxTileLevel ==
int(approxMaxTileLevel)) {
1148 maxTileLevel =
static_cast<int>(approxMaxTileLevel);
1150 maxTileLevel =
static_cast<int>(approxMaxTileLevel + 1);
1152 texture->setMaximumTileLevel(maxTileLevel);
1155 auto layer =
new GeoSceneLayer(d->uiWidget.lineEditTheme->text());
1156 layer->setBackend(QStringLiteral(
"texture"));
1157 layer->addDataset(backdropTexture);
1158 layer->addDataset(texture);
1160 auto secondLayer =
new GeoSceneLayer(QStringLiteral(
"standardplaces"));
1161 secondLayer->setBackend(QStringLiteral(
"geodata"));
1163 auto cityplacemarks =
new GeoSceneGeodata(QStringLiteral(
"cityplacemarks"));
1164 cityplacemarks->setSourceFile(QStringLiteral(
"cityplacemarks.kml"));
1165 secondLayer->addDataset(cityplacemarks);
1167 auto baseplacemarks =
new GeoSceneGeodata(QStringLiteral(
"baseplacemarks"));
1168 baseplacemarks->setSourceFile(QStringLiteral(
"baseplacemarks.kml"));
1169 secondLayer->addDataset(baseplacemarks);
1171 auto elevplacemarks =
new GeoSceneGeodata(QStringLiteral(
"elevplacemarks"));
1172 elevplacemarks->setSourceFile(QStringLiteral(
"elevplacemarks.kml"));
1173 secondLayer->addDataset(elevplacemarks);
1175 auto observatoryplacemarks =
new GeoSceneGeodata(QStringLiteral(
"observatoryplacemarks"));
1176 observatoryplacemarks->setSourceFile(QStringLiteral(
"observatoryplacemarks.kml"));
1177 secondLayer->addDataset(observatoryplacemarks);
1179 auto otherplacemarks =
new GeoSceneGeodata(QStringLiteral(
"otherplacemarks"));
1180 otherplacemarks->setSourceFile(QStringLiteral(
"otherplacemarks.kml"));
1181 secondLayer->addDataset(otherplacemarks);
1183 auto boundaryplacemarks =
new GeoSceneGeodata(QStringLiteral(
"boundaryplacemarks"));
1184 boundaryplacemarks->setSourceFile(QStringLiteral(
"boundaryplacemarks.kml"));
1185 secondLayer->addDataset(boundaryplacemarks);
1187 GeoSceneMap *
map = document->map();
1189 if (d->mapProviderType == MapWizardPrivate::WmsMap) {
1191 bbox = d->owsManager.wmsCapabilities().boundingBoxNSEWDegrees(d->selectedLayers, d->selectedProjection);
1194 if (bboxList.
at(0).toDouble() < 85 && bboxList.
at(1).toDouble() > -85 && bboxList.
at(2).toDouble() < 179 && bboxList.
at(3).toDouble() > -179) {
1195 map->setCenter(bbox);
1199 map->addLayer(layer);
1200 map->addLayer(secondLayer);
1202 GeoSceneSettings *settings = document->settings();
1359 auto overviewmap =
new GeoSceneProperty(QStringLiteral(
"overviewmap"));
1360 overviewmap->setDefaultValue(
true);
1361 overviewmap->setAvailable(
true);
1362 settings->addProperty(overviewmap);
1364 auto compass =
new GeoSceneProperty(QStringLiteral(
"compass"));
1365 compass->setDefaultValue(
true);
1366 compass->setAvailable(
true);
1367 settings->addProperty(compass);
1369 auto scalebar =
new GeoSceneProperty(QStringLiteral(
"scalebar"));
1370 scalebar->setDefaultValue(
true);
1371 scalebar->setAvailable(
true);
1372 settings->addProperty(scalebar);
1377void MapWizard::accept()
1379 Q_ASSERT(d->mapProviderType != MapWizardPrivate::NoMap);
1381 Q_ASSERT(d->format == d->format.toLower());
1382 Q_ASSERT(!d->mapTheme.isEmpty());
1384 if (d->mapProviderType == MapWizardPrivate::StaticImageMap) {
1385 d->sourceImage = d->uiWidget.lineEditSource->text();
1386 Q_ASSERT(!d->sourceImage.isEmpty());
1388 }
else if (d->mapProviderType == MapWizardPrivate::WmsMap) {
1389 Q_ASSERT(!d->owsManager.wmsCapabilities().layers().isEmpty());
1390 Q_ASSERT(!d->levelZero.isNull());
1391 }
else if (d->mapProviderType == MapWizardPrivate::WmtsMap) {
1392 Q_ASSERT(!d->owsManager.wmtsCapabilities().layers().isEmpty());
1393 Q_ASSERT(!d->levelZero.isNull());
1394 }
else if (d->mapProviderType == MapWizardPrivate::StaticUrlMap) {
1395 Q_ASSERT(!d->levelZero.isNull());
1400 Q_ASSERT(!document->head()->description().isEmpty());
1401 Q_ASSERT(!document->head()->name().isEmpty());
1403 if (createFiles(document.data())) {
1404 if (d->mapProviderType == MapWizardPrivate::WmsMap) {
1405 if (!d->owsManager.wmsCapabilities()
1406 .legendUrl(d->sortModel->data(d->uiWidget.listViewWmsLayers->currentIndex(), layerIdRole).toString())
1410 }
else if (d->mapProviderType == MapWizardPrivate::StaticImageMap || d->mapProviderType == MapWizardPrivate::StaticUrlMap) {
1415 d->uiWidget.lineEditTitle->clear();
1416 d->uiWidget.lineEditTheme->clear();
1417 d->uiWidget.textEditDesc->clear();
1418 d->uiWidget.labelPreview->clear();
1419 d->uiWidget.lineEditSource->clear();
1424 QMessageBox::critical(
this, tr(
"Problem while creating files"), tr(
"Check if a theme with the same name exists."));
1429void MapWizard::showPreview()
1433 if (createFiles(document.data())) {
1434 if (d->mapProviderType == MapWizardPrivate::WmsMap) {
1435 if (!d->owsManager.wmsCapabilities()
1436 .legendUrl(d->sortModel->data(d->uiWidget.listViewWmsLayers->currentIndex(), layerIdRole).toString())
1440 }
else if (d->mapProviderType == MapWizardPrivate::StaticImageMap || d->mapProviderType == MapWizardPrivate::StaticUrlMap) {
1446 previewDialog->exec();
1447 delete previewDialog;
1450void MapWizard::updateSearchFilter(
const QString &text)
1452 d->sortModel->setFilterFixedString(text);
1455void MapWizard::updateListViewSelection()
1460 d->uiWidget.listViewWmsLayers->setSelectionMode(selectionMode);
1461 d->uiWidget.checkBoxWmsMultipleSelections->setVisible(d->uiWidget.radioButtonWms->isChecked());
1464void MapWizard::updateBackdropCheckBox()
1467 bool isMercator = d->uiWidget.comboBoxWmsMaps->currentText() == QStringLiteral(
"Web Mercator (epsg:3857)");
1468 d->uiWidget.checkBoxWmsBackdrop->setEnabled(isMercator);
1469 d->uiWidget.tabCustomizeBackdrop->setEnabled(isMercator && d->uiWidget.checkBoxWmsBackdrop->isChecked());
1472void MapWizard::updateOwsServiceType()
1474 if (d->uiWidget.radioButtonWms->isChecked()) {
1475 d->uiWidget.labelWmsServer->setText(tr(
"WMS Server"));
1476 d->uiWidget.labelOwsServiceHeader->setText(
1477 tr(
"<h4>WMS Server</h4>Please choose a <a href=\"https://en.wikipedia.org/wiki/Web_Map_Service\">WMS</a> server or enter a custom server URL."));
1478 d->uiWidget.comboBoxWmsServer->clear();
1479 d->uiWidget.comboBoxWmsServer->addItems(d->wmsServerList);
1480 d->uiWidget.comboBoxWmsServer->addItem(tr(
"Custom"), QStringLiteral(
"http://"));
1481 d->uiWidget.comboBoxWmsServer->setCurrentText(tr(
"Custom"));
1483 }
else if (d->uiWidget.radioButtonWmts->isChecked()) {
1484 d->uiWidget.labelWmsServer->setText(tr(
"WMTS Server"));
1485 d->uiWidget.labelOwsServiceHeader->setText(
1486 tr(
"<h4>WMTS Server</h4>Please choose a <a href=\"https://de.wikipedia.org/wiki/Web_Map_Tile_Service\">WMTS</a> server or enter a custom server "
1488 d->uiWidget.comboBoxWmsServer->clear();
1489 d->uiWidget.comboBoxWmsServer->addItems(d->wmtsServerList);
1490 d->uiWidget.comboBoxWmsServer->addItem(tr(
"Custom"), QStringLiteral(
"http://"));
1491 d->uiWidget.comboBoxWmsServer->setCurrentText(tr(
"Custom"));
1492 }
else if (d->uiWidget.radioButtonStaticUrl->isChecked()) {
1493 d->uiWidget.comboBoxStaticUrlServer->clear();
1494 d->uiWidget.comboBoxStaticUrlServer->addItems(d->staticUrlServerList);
1500void MapWizard::chooseBackgroundColor()
1503 if (selectedColor.
isValid()) {
1504 d->uiWidget.labelBackgroundColor->setText(selectedColor.
name());
1505 QPalette p = d->uiWidget.labelBackgroundColor->palette();
1507 d->uiWidget.labelBackgroundColor->setPalette(p);
1513#include "MapWizard.moc"
1514#include "moc_MapWizard.cpp"
This file contains the header for MapWizard.
This file contains the header for MarbleNavigator.
Capabilities capabilities()
QAction * restart(const QObject *recvr, const char *slot, QObject *parent)
QString path(const QString &relativePath)
KIOCORE_EXPORT QString dir(const QString &fileClass)
QAction * zoomIn(const QObject *recvr, const char *slot, QObject *parent)
QAction * zoomOut(const QObject *recvr, const char *slot, QObject *parent)
QAction * next(const QObject *recvr, const char *slot, QObject *parent)
QAction * zoom(const QObject *recvr, const char *slot, QObject *parent)
Binds a QML item to a specific geodetic location in screen coordinates.
void pressed(const QModelIndex &index)
bool isEnabled() const const
void stateChanged(int state)
bool isValid() const const
QString name(NameFormat format) const const
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, ColorDialogOptions options)
virtual void closeEvent(QCloseEvent *e) override
QString absolutePath() const const
bool cd(const QString &dirName)
QStringList entryList(Filters filters, SortFlags sort) const const
bool copy(const QString &fileName, const QString &newName)
bool exists(const QString &fileName)
bool exists() const const
void setFileName(const QString &name)
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, Options options)
bool exists() const const
QImage fromData(QByteArrayView data, const char *format)
bool isNull() const const
QImage scaled(const QSize &size, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const const
void setText(const QString &)
void textChanged(const QString &text)
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
bool isEmpty() const const
StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons, StandardButton defaultButton)
QObject * parent() const const
void setColor(ColorGroup group, ColorRole role, const QColor &color)
QPixmap fromImage(QImage &&image, Qt::ImageConversionFlags flags)
int execute(const QString &program, const QStringList &arguments)
bool waitForFinished(int msecs)
void setFilterCaseSensitivity(Qt::CaseSensitivity cs)
virtual void setSourceModel(QAbstractItemModel *sourceModel) override
QString arg(Args &&... args) const const
QString first(qsizetype n) const const
QString fromLatin1(QByteArrayView str)
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
qsizetype lastIndexOf(QChar ch, Qt::CaseSensitivity cs) const const
QString left(qsizetype n) const const
qsizetype length() const const
QString & prepend(QChar ch)
QString & remove(QChar ch, Qt::CaseSensitivity cs)
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
QString right(qsizetype n) const const
QStringList split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
QByteArray toLatin1() const const
QString toLower() const const
QString join(QChar separator) const const
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void setQuery(const QString &query, ParsingMode mode)
void addQueryItem(const QString &key, const QString &value)
virtual void cleanupPage(int id)
virtual bool validateCurrentPage()