QT在嵌入式Linux环境下运行

2019-07-12 22:05发布

运行嵌入式程序

在嵌入式QT版本中,程序需要服务器或自己作为服务器程序。服务器程序构造的方法是构造一个QApplication::GuiServe类型的QApplication对象。或者使用-qws命令选项启动程序。
Using a Single Display
使用-qws选项
接下来的程序可以当做客户端来运行,只要不使用-qws选项。那么客户端程序就会自动连接到服务程序中。

using Mutiple Displays
嵌入式版本中运行多个县市同时运行。两种方式可以实现,要么多次运行服务程序,要么使用read-mae Multi screen driver
当多个服务程序运行时,每个程序必须使用-display选项指定显示驱动,或者使用QWS_DISPLAY环境变量来指定。
服务程序运行时:
./mysecondserverapplication -qws -display "QVFb:2"
客户程序运行时:
./myclientapplication -display "QVFb:2"
若想在不同显示器移动应用程序,则只能通过Muti显示器实现。
./myserverapplication -qws -display "Multi: QVFb:0
QVFb:1:offset=0,0 VNC:offset=640,0 :2"
程序启动命令选项:
-fn         定义程序的字体,例如./myapplication -fn helvetica
-bg                设置程序默认背景颜 {MOD} 例如./myapplication -bg blue,颜 {MOD}名称必须能被QColor类构造函数识别 -btn                设置默认的按钮颜 {MOD},例如./myapplication -btn green 同样颜 {MOD}必须被认识 -fg                设置foreground颜 {MOD},例如./myapplication -fg 'dark blue' 同上需被认识 -name     设置应用程序名字 例如./myapplication -name texteditapplication -title         设置应用程序标题。./myapplication -title 'Text Edit'</span> <span style="font-size:24px;">-geometry <width>x<height>+<Xoffset>+<Yoffset><br /> 设置窗口大小, ./myapplication -geometry 300x200+50+50</span> <span style="font-size:24px;">-keyboard                    启动键盘</span> <span style="font-size:24px;">-nokeyboard                关闭键盘</span> <span style="font-size:24px;">-mouse                        启动鼠标</span> <span style="font-size:24px;">-nomouse                    关闭鼠标</span> <span style="font-size:24px;">-qws                            设置为服务程序</span> <span style="font-size:24px;">-display                    设置显示器驱动</span> <span style="font-size:24px;">-decoration<style><br /> 设置程序的风格,例如./myapplication -decoration windows,只支持windows default styled</span> <br /> </div> </div> </div> </div> </div> </div> <hr> <div class="index"> <div class="row"> <div class=" main" style="padding:10px"> <div class="note"> <div class="post"> <!-- cdn节点 文章评论 --> <div class="cdn_ajax_articlecomment"></div> </div> </div> </div> </div> </div> </div> <div class="col-md-7 aside"> <div class="standing" style="margin-top: 20px;"> <div class="positions bb" id="rankScroll"> <h3 class="title">Ta的文章 <a target="_blank" href="https://www.xiaopingtou.net/ut-2418.html" class="more">更多<font> >> </font></a></h3> <ul> <li class="no-video"> <a href="https://www.xiaopingtou.net/article-81998.html" title="高通滤波(2)" > 高通滤波(2)</a> <div class="num-ask"> <a href="https://www.xiaopingtou.net/article-81998.html" title="高通滤波(2)" class="anum"> 0 个评论</a> </div> </li> <li class="no-video"> <a href="https://www.xiaopingtou.net/article-69179.html" title="QT在嵌入式Linux环境下运行" > QT在嵌入式Linux环境下运行</a> <div class="num-ask"> <a href="https://www.xiaopingtou.net/article-69179.html" title="QT在嵌入式Linux环境下运行" class="anum"> 0 个评论</a> </div> </li> </ul> </div> </div> <div class="standing"> <div class="positions bb" id="rankScroll"> <h3 class="title" style="float: none">热门文章</h3> <ul style="padding-top: 10px;"> </ul> </div> </div> </div> </div> </div> </div> <!-- 举报 --> <div class="modal fade panel-report" id="dialog_inform"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <h4 class="modal-title">举报内容</h4> </div> <div class="modal-body"> <form id="rp_form" class="rp_form" action="https://www.xiaopingtou.net/inform/add.html" method="post"> <input value="" type="hidden" name="qid" id="myqid"> <input value="" type="hidden" name="aid" id="myaid"> <input value="" type="hidden" name="qtitle" id="myqtitle"> <div class="js-group-type group group-2"> <h4>检举类型</h4><ul> <li class="js-report-con"> <label><input type="radio" name="group-type" value="1"><span>检举内容</span></label> </li> <li class="js-report-user"> <label><input type="radio" name="group-type" value="2"><span>检举用户</span></label> </li> </ul> </div> <div class="group group-2"> <h4>检举原因</h4><div class="list"> <ul> <li> <label class="reason-btn"><input type="radio" name="type" value="4"><span>广告推广</span></label> </li> <li> <label class="reason-btn"><input type="radio" name="type" value="5"><span>恶意灌水</span></label> </li> <li> <label class="reason-btn"><input type="radio" name="type" value="6"><span>回答内容与提问无关</span> </label> </li> <li> <label class="copy-ans-btn"><input type="radio" name="type" value="7"><span>抄袭答案</span></label> </li> <li> <label class="reason-btn"><input type="radio" name="type" value="8"><span>其他</span></label> </li> </ul> </div> </div> <div class="group group-3"> <h4>检举说明(必填)</h4> <div class="textarea"> <ul class="anslist" style="display:none;line-height:20px;overflow:auto;height:171px;"> </ul> <textarea name="content" maxlength="200" placeholder="请输入描述200个字以内"> </textarea> </div> </div> <div class="mar-t-1"> <button type="submit" id="btninform" class="btn btn-success">提交</button> <button type="button" class="btn btn-default mar-ly-1" data-dismiss="modal">关闭</button> </div> </form> </div> </div> </div> </div> <div class="modal share-wechat animated" style="display: none;"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" data-dismiss="modal" class="close">×</button></div> <div class="modal-body"><h5>打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮</h5> <div data-url="https://www.xiaopingtou.net/article-69179.html" class="qrcode" title="https://www.xiaopingtou.net/article-69179.html"><canvas width="170" height="170" style="display: none;"></canvas> <div id="qr_wxcode"> </div></div></div> <div class="modal-footer"></div></div></div></div> <script type="text/javascript" src="https://www.xiaopingtou.net/static/ckplayer/ckplayer.js" charset="utf-8"></script> <script type="text/javascript" src="https://www.xiaopingtou.net/static/ckplayer/video.js" charset="utf-8"></script> <script> getarticlecaozuo(1,69179); getarticlecaozuo(2,69179); getarticlecaozuo(3,69179); getarticlecaozuo(4,69179); getarticlecaozuo(5,69179); $(".work-show-box").find("img").each(function(){ var imgurl=$(this).attr("data-original"); $(this).attr("src",imgurl); }) $(".work-show-box").find("img").attr("data-toggle","lightbox"); $(".getcommentlist").each(function(){ var _id=$(this).attr("dataid"); var _tid=$(this).attr("datatid"); $("#articlecommentlist"+_id).toggleClass("hide"); var flag=$("#articlecommentlist"+_id).attr("dataflag"); if(flag==1){ flag=0; }else{ flag=1; //加载评论 loadarticlecommentlist(_id,_tid); } $("#articlecommentlist"+_id).attr("dataflag",flag); }) function showeditor(){ scrollTo(0,$('#comment-list').offset().top-100); $(".comment-area").focus(); } //投诉 function openinform(qid ,qtitle,aid) { $("#myqid").val(qid); $("#myqtitle").val(qtitle); $("#myaid").val(aid); $('#dialog_inform').modal('show'); } function deletewenzhang(current_aid){ window.location.href=g_site_url + "index.php" + query + "topic/deletearticlecomment/"+current_aid+"/69179"; } $(function(){ $(".edui-upload-video").attr("preload",""); //微信二维码生成 $('#qr_wxcode').qrcode("https://www.xiaopingtou.net/article-69179.html"); //显示微信二维码 $(".share-weixin").click(function(){ $(".share-wechat").show(); }); //关闭微信二维码 $(".close").click(function(){ $(".share-wechat").hide(); }) }) </script> <script src="https://www.xiaopingtou.net/static/js/jquery.lazyload.min.js"></script> <script> $("img.lazy").lazyload({effect: "fadeIn" }); </script> <div class="side-tool" id="to_top"><ul><li data-placement="left" data-toggle="tooltip" data-container="body" data-original-title="回到顶部" > <a href="#" class="function-button"><i class="fa fa-angle-up"></i></a> </li> </ul></div> <script> window.onload = function(){ $("img").each(function(){ $(this).attr("src",$(this).attr("src")+'?t='+(+new Date())); }); $(".edui-upload-video").attr("preload",""); var oTop = document.getElementById("to_top"); var screenw = document.documentElement.clientWidth || document.body.clientWidth; var screenh = document.documentElement.clientHeight || document.body.clientHeight; window.onscroll = function(){ var scrolltop = document.documentElement.scrollTop || document.body.scrollTop; if(scrolltop<=screenh){ oTop.style.display="none"; }else{ oTop.style.display="block"; } if(scrolltop>30){ $(".scrollshow").show(); }else{ $(".scrollshow").hide(); } } oTop.onclick = function(){ document.documentElement.scrollTop = document.body.scrollTop =0; } } </script> <footer id="footer"> <div class="copyrigth-wrap small"> <div class="content copyrigth"> Copyright © 2024 平头弟 <a href="https://beian.miit.gov.cn/" target="blank">京ICP备15032243号-1</a> <a > </a> 投诉举报邮箱:nettui@qq.com </div> </div> </footer> </body> </html>