This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from PyQt5.QtCore import QTimer | |
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QProgressBar, QApplication, QPushButton, QLabel, QMessageBox | |
from mergin import ( | |
MerginClient, | |
MerginProject, | |
InvalidProject, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from PyQt5.QtCore import QTimer | |
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QProgressBar, QApplication, QPushButton, QLabel, QMessageBox | |
from mergin import ( | |
MerginClient, | |
MerginProject, | |
InvalidProject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt4.QtGui import * | |
from qgis import DefaultPlugin, plugin_action | |
def classFactory(iface): | |
return DefaultPlugin(iface) | |
@plugin_action("Go!") | |
def my_action(): | |
QMessageBox.information(None, "Minimal plugin", "Do something useful here") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/qgsmaprendererjob.cpp b/src/core/qgsmaprendererjob.cpp | |
index 7b341d7..38f4f5d 100644 | |
--- a/src/core/qgsmaprendererjob.cpp | |
+++ b/src/core/qgsmaprendererjob.cpp | |
@@ -242,6 +242,8 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin | |
layerJobs.removeLast(); | |
continue; | |
} | |
+ mypFlattenedImage->setDotsPerMeterX( mSettings.outputDpi() / 25.4 * 1000 ); | |
+ mypFlattenedImage->setDotsPerMeterY( mSettings.outputDpi() / 25.4 * 1000 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
content = """<!DOCTYPE html><html><head> | |
<script type="text/javascript" src="http://jplayer.org/latest/lib/jquery.min.js"></script> | |
<script type="text/javascript" src="http://jplayer.org/latest/dist/jplayer/jquery.jplayer.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ var stream = { title: "ABC Lounge", mp3: "http://listen.radionomy.com/abc-lounge" }, ready = false; | |
$("#jquery_jplayer_1").jPlayer({ ready: function (event) { ready = true; $(this).jPlayer("setMedia", stream).jPlayer("play"); }, | |
supplied: "mp3", }); });</script></head><body><div id="jquery_jplayer_1" class="jp-jplayer"></div></body></html>""" | |
from PyQt4.QtWebKit import QWebView | |
v = QWebView() | |
v.setHtml(content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QApplication> | |
#include <QTime> | |
#include <gperftools/profiler.h> | |
#include <qgsapplication.h> | |
#include <qgsgeometry.h> | |
#include <qgsmaplayerregistry.h> | |
#include <qgsmaprenderersequentialjob.h> | |
#include <qgsmapsettings.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
from qgis.core import * | |
class LegendView(QLabel): | |
def __init__(self, root, parent=None): | |
QLabel.__init__(self, parent) | |
self.root = root | |
self.model = QgsLayerTreeModel(self.root) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
from qgis.core import * | |
# iface.activeLayer().setLegend(RasterRampLegend(iface.activeLayer())) | |
# nodeLayer = QgsProject.instance().layerTreeRoot().children()[0] | |