marble 基本函数(一)
- . 标记
- GeoDataPlacemark *place = new GeoDataPlacemark( "Bucharest" );
- place->setCoordinate( 25.97, 44.43, 0.0, GeoDataCoordinates::Degree );
- place->setPopulation( );
- place->setCountryCode ( "Romania" );
- GeoDataDocument *document = new GeoDataDocument;
- document->append( place );
- // Add the document to MarbleWidget's tree model
- mapWidget->model()->treeModel()->addDocument( document );
- . 初始位置
- GeoDataCoordinates home(, 30.0, 10.0, GeoDataCoordinates::Degree);
- mapWidget->centerOn(home);
- .鼠标当前位置
- // Connect the map widget to the position label.
- QObject::connect(mapWidget, SIGNAL(mouseMoveGeoPosition(QString)),
- positionLabel, SLOT(setText(QString)));
4.设置投影
mapWidget->setProjection( Mercator );- 5.获取设置控件
foreach ( AbstractFloatItem * floatItem, mapWidget->floatItems() )
- if ( floatItem && floatItem->nameId() == "compass" ) {
- // Put the compass onto the left hand side
- floatItem->setPosition( QPoint( 10, 10 ) );
- // Make the content size of the compass smaller
- floatItem->setContentSize( QSize( 50, 50 ) );
- }
- 6.绘制标记
void MyMarbleWidget::customPaint(GeoPainter* painter)
{
GeoDataCoordinates home(8.4, 49.0, 0.0, GeoDataCoordinates::Degree);
painter->setPen(Qt::green);
painter->drawEllipse(home, 17, 17);
painter->setPen(Qt::red);
painter->drawText(home, "Hello Marble!");
}
marble 基本函数(一)的更多相关文章
- Matlab基本函数-conj函数
Matlab基本函数-conj函数 1.conj函数:用于计算复数的共轭值 2.用法说明:y=conj(x)函数计算复数x的共轭值.输出结果y的维数跟输入x的维数一致,返回值为:real(y)-i*i ...
- 在SQL中使用CLR提供基本函数对二进制数据进行解析与构造
二进制数据包的解析一般是借助C#等语言,在通讯程序中解析后形成字段,再统一单笔或者批量(表类型参数)提交至数据库,在通讯程序中,存在BINARY到struct再到table的转换. 现借助CLR提 ...
- zjuoj 3605 Find the Marble
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3605 Find the Marble Time Limit: 2 Seco ...
- PHP操作Memcache基本函数的方法
Memcache基本函数. Memcache ― Memcache类 Memcache::add ― 增加一个条目到缓存服务器 Memcache::addServer ― 向连接池中添加一个memca ...
- Lua5.1基本函数库介绍
Lua5.1基本函数库介绍assert (v [, message])功能:相当于C的断言,参数:v:当表达式v为nil或false将触发错误,message:发生错误时返回的信息,默认为" ...
- Delphi的基本函数
Delphi的基本函数 函数由一句或多句代码组成,可以实现某个特定的功能.使用函数可以使代码更加易读.易懂,加快编程速度及减少重复代码.过程与函数类似,过程与函数最重要的区别在于,过程没有返回值,而函 ...
- [RxJS] Introduction to RxJS Marble Testing
Marble testing is an expressive way to test observables by utilizing marble diagrams. This lesson wi ...
- Mysql存储过程知识,案例--mysql存储过程基本函数
Mysql存储过程知识,案例: create procedure delete_setting(in p_settingid integer) begin delete from setting wh ...
- 经典SQL语句大全之基本函数
SQL Server基本函数 1.字符串函数 长度与分析用 1,datalength(Char_expr) 返回字符串包含字符数,但不包含后面的空格2,substring(expression,sta ...
随机推荐
- dirty cow exp
公司搞底层的改了一下,说做到了几个不死机 /* * (un)comment correct payload first (x86 or x64)! * * $ gcc cowroot.c -o cow ...
- Word 2016插入公式快捷键
实用的插入公式快捷键"Alt+=", 与君共享
- springmvc框架下ajax请求传参数中文乱码解决
springmvc框架下jsp界面通过ajax请求后台数据,传递中文参数到后台显示乱码 解决方法:js代码 运用encodeURI处理两次 /* *掩码处理 */ function maskWord( ...
- 使用 Python Mock 类进行单元测试
数据类型.模型或节点——这些都只是mock对象可承担的角色.但mock在单元测试中扮演一个什么角色呢? 有时,你需要为单元测试的初始设置准备一些“其他”的代码资源.但这些资源兴许会不可用,不稳定,或者 ...
- 关于RDD
1. transform操作返回的是rdd, action操作返回其它数据类型,可以以此来区分操作类型: 2. Spark懒加载,懒到直到Action操作的时候才会加载数据计算,RDD的create和 ...
- libvirt里的面向对象的C语言
C语言:类的声明和定义 // 通用父类的定义 struct _virClass { virClassPtr parent; unsigned int magic; char *name; size_t ...
- php强制下载文件并显示原始文件名
原来一直没有接触过,这几天一直在玩儿文件上传下载的东西.今天又遇到一个坑. 描述:文件上传至服务器后,如果是rar或则其他的非浏览器直接识别的格式,用户点击链接了后是可以直接就被下载下来的.那么如果上 ...
- iScroll 下 a 标签失效
遇到个莫名其妙的问题,iScroll 下的 a 标签点击没有反应了,不管怎么调整 z-index 都无效果,很是无语. 查找半天后找到解决方法: $(function(){ new IScroll(' ...
- ASP.NET里面,如果设置了form的 onsubmit="return false;"之后,就不能提交按钮了?
我的按钮是写成的服务器控件的形式<asp:Button ID="btnSubmitBR" runat="server" Text="提交&quo ...
- shell获取系统时间
获取系统时间 date -d"yesterday" +"%F %H:%M:%S" #输出昨天这个时候的时间 date -d"tomorrow" ...