QtCreator:是否可以调试远程GUI应用程序? (GDB)

时间:2017-07-10 20:20:40

标签: c++ ssh gdb qt-creator x11-forwarding

  1. 主持并定位ubuntu 16.04
  2. 正在使用GDB
  3. ssh工作正常,启用了X11转发 - 启动内置应用程序与GUI一起工作
  4. 还创建了qtcreator中的远程linux配置,并成功用于控制台应用程序。
  5. 〜/ .ssh / config包含X11Forward true
  6. 问题 - 应用失败并显示错误"未找到显示" 。似乎qtcreator没有使用带有标准配置的系统ssh。 另一方面,我无法在qtcreator中找到启用X11应用程序的选项

    有人在qtcreattor下进行远程GUI调试吗?

    有可能吗?

1 个答案:

答案 0 :(得分:1)

QtCreator似乎真的使用集成的SSH实现,并且不允许您自定义其选项。 除此之外,你可以解决这个问题。为此,请按以下步骤操作:

  1. 使用真实SSH并使用-X选项激活到要调试的主机。您必须在整个测试期间保持此连接打开。
  2. 使用例如<?php require_once('init.php'); $query="SELECT * FROM `bannerStock`"; $result = mysqli_query($db_conx, $query); $myArray=[]; while($row=mysqli_fetch_assoc($result)) { $name=$row['name']; $categorytoadd=""; if($row['Automotive']==1){$categorytoadd.=' Automotive';} if($row['Backgrounds']==1){$categorytoadd.=' Backgrounds';} if($row['Church']==1){$categorytoadd.=' Church';} if($row['Community']==1){$categorytoadd.=' Community';} if($row['Money']==1){$categorytoadd.=' Money';} if($row['Food']==1){$categorytoadd.=' Food';} if($row['Gaming']==1){$categorytoadd.=' Gaming';} if($row['Healthcare']==1){$categorytoadd.=' Healthcare';} if($row['Holidays']==1){$categorytoadd.=' Holidays';} if($row['Sports']==1){$categorytoadd.=' Sports';} if($row['Patriotic']==1){$categorytoadd.=' Patriotic';} if($row['Retail']==1){$categorytoadd.=' Retail';} if($row['Education']==1){$categorytoadd.=' Education';} if($row['Misc']==1){$categorytoadd.=' Misc';} $rowNumb=$row['id']; $poster = "<video style='width:400px; height=200px;' controls loop preload=\"none\" poster=\"https://www.siteaddress.com/ce/bannerStockUpload/" . $row['name'] ."/". $row['name'] ."_thumb.jpg\"><source src=\"https://www.siteaddress.com/ce/bannerStockUpload/". $row['name'] ."/". $row['name'] ."_thumb.mp4\" type=\"video/mp4\"><source src=\"https://www.siteaddress.com/ce/bannerStockUpload/". $row['name'] ."/". $row['name'] ."_thumb.webm\" type=\"video/webm\">"; $link1 = 'https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_1080.mp4'; $link2 = 'https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_1080.wmv'; $link3 = 'https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_1080.jpg'; $link4 = 'https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_432.mp4'; $link5 = 'https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_432.wmv'; $link6 = 'https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_432.jpg'; $link7 = 'https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_324.mp4'; $link8 = 'https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_324.wmv'; $link9 = 'https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_324.jpg'; $link10 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_216.mp4'; $link11 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_216.wmv'; $link12 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_216.jpg'; $link13 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_184.mp4'; $link14 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_184.wmv'; $link15 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_184.jpg'; $link16 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_160.mp4'; $link17 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_160.wmv'; $link18 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_160.jpg'; $link19 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_128.mp4'; $link20 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_128.wmv'; $link21 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_128.jpg'; $link22 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_108.mp4'; $link23 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_108.wmv'; $link24 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_108.jpg'; $link25 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_80.mp4'; $link26 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_80.wmv'; $link27 ='https://www.siteaddress.com/ce/bannerStockUpload/'.$name.'/'.$name.'_80.jpg'; if(file_exists($link1)){ $row['link1'] = $link1; } else {$row['link1']='';} if(file_exists($link2)){ $row['link2'] = $link2; } else {$row['link2']='';} if(file_exists($link3)){ $row['link3'] = $link3; } else {$row['link3']='';} if(file_exists($link4)){ $row['link4'] = $link4; } else {$row['link4']='';} if(file_exists($link5)){ $row['link5'] = $link5; } else {$row['link5']='';} if(file_exists($link6)){ $row['link6'] = $link6; } else {$row['link6']='';} if(file_exists($link7)){ $row['link7'] = $link7; } else {$row['link7']='';} if(file_exists($link8)){ $row['link8'] = $link8; } else {$row['link8']='';} if(file_exists($link9)){ $row['link9'] = $link9; } else {$row['link9']='';} if(file_exists($link10)){ $row['link10'] = $link10; } else {$row['link10']='';} if(file_exists($link11)){ $row['link11'] = $link11; } else {$row['link11']='';} if(file_exists($link12)){ $row['link12'] = $link12; } else {$row['link12']='';} if(file_exists($link13)){ $row['link13'] = $link13; } else {$row['link13']='';} if(file_exists($link14)){ $row['link14'] = $link14; } else {$row['link14']='';} if(file_exists($link15)){ $row['link15'] = $link15; } else {$row['link15']='';} if(file_exists($link16)){ $row['link16'] = $link16; } else {$row['link16']='';} if(file_exists($link17)){ $row['link17'] = $link17; } else {$row['link17']='';} if(file_exists($link18)){ $row['link18'] = $link18; } else {$row['link18']='';} if(file_exists($link19)){ $row['link19'] = $link19; } else {$row['link19']='';} if(file_exists($link20)){ $row['link20'] = $link20; } else {$row['link20']='';} if(file_exists($link21)){ $row['link21'] = $link21; } else {$row['link21']='';} if(file_exists($link22)){ $row['link22'] = $link22; } else {$row['link22']='';} if(file_exists($link23)){ $row['link23'] = $link23; } else {$row['link23']='';} if(file_exists($link24)){ $row['link24'] = $link24; } else {$row['link24']='';} if(file_exists($link25)){ $row['link25'] = $link25; } else {$row['link25']='';} if(file_exists($link26)){ $row['link26'] = $link26; } else {$row['link26']='';} if(file_exists($link27)){ $row['link27'] = $link27; } else {$row['link27']='';} $row['class']= $categorytoadd; $row['poster'] = $poster; array_push($myArray, $row); } ?> <!doctype html> <html> <head> <script src="https://unpkg.com/vue"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body> <div id="app"> <input type='text' v-model='keyword' placeholder='search item'> <button v-on:click='showall'>ALL</button> <button v-on:click="showauto">Auto</button> <button v-on:click="showbackgrounds">Backgrounds</button> <button v-on:click="showchurch">Church</button> <button v-on:click="showcommunity">Community</button> <button v-on:click="showmoney">Money</button> <button v-on:click="showfood">Food</button> <button v-on:click="showgaming">Gaming</button> <button v-on:click="showhealthcare">Healthcare</button> <button v-on:click="showholidays">Holidays</button> <button v-on:click="showsports">Sports</button> <button v-on:click="showpatriotic">Patriotic</button> <button v-on:click="showretail">Retail</button> <button v-on:click="showeducation">Education</button> <button v-on:click="showmisc">Misc</button> <div v-for="item in filteredItemList"> <div :class="['video', item.class]"> <div v-html='item.poster'> </div> <p>{{ item.name_short }} - {{item.id}}</p> <select> <option v-if="link1!===''"> <a :href="item.link1">1920x1080.mp4</a> </option> <option v-if="link2!===''"> <a :href="item.link2">1920x1080.wmv</a> </option> <option v-if="link3!===''"> <a :href="item.link3">1920x1080.jpg</a> </option> <option v-if="link4!===''"> <a :href="item.link4">432x432.mp4</a> </option> <option v-if="link5!===''"> <a :href="item.link5">432x432.wmv</a> </option> <option v-if="link6!===''"> <a :href="item.link6">432x432.jpg</a> </option> <option v-if="link7!===''"> <a :href="item.link7">432x324.mp4</a> </option> <option v-if="link8!===''"> <a :href="item.link8">432x324.wmv</a> </option> <option v-if="link9!===''"> <a :href="item.link9">432x324.jpg</a> <option v-if="link10!===''"> <a :href="item.link10">432x216.mp4</a> </option> <option v-if="link11!===''"> <a :href="item.link11">432x216.wmv</a> </option> <option v-if="link12!===''"> <a :href="item.link12">432x216.jpg</a> </option> <option v-if="link13!===''"> <a :href="item.link13">432x184.mp4</a> </option> <option v-if="link14!===''"> <a :href="item.link14">432x184.wmv</a> </option> <option v-if="link15!===''"> <a :href="item.link15">432x184.jpg</a> </option> <option v-if="link16!===''"> <a :href="item.link16">432x160.mp4</a> </option> <option v-if="link17!===''"> <a :href="item.link17">432x160.wmv</a> </option> <option v-if="link18!===''"> <a :href="item.link18">432x160.jpg</a> </option> <option v-if="link19!===''"> <a :href="item.link19">432x128.mp4</a> </option> <option v-if="link20!===''"> <a :href="item.link20">432x128.wmv</a> </option> <option v-if="link21!===''"> <a :href="item.link21">432x128.jpg</a> <option v-if="link22!===''"> <a :href="item.link22">432x108.mp4</a> </option> <option v-if="link23!===''"> <a :href="item.link23">432x108.wmv</a> </option> <option v-if="link24!===''"> <a :href="item.link24">432x108.jpg</a> </option> <option v-if="link25!===''"> <a :href="item.link25">432x80.mp4</a> </option> <option v-if="link26!===''"> <a :href="item.link26">432x80.wmv</a> </option> <option v-if="link27!===''"> <a :href="item.link27">432x80.jpg</a> </option> </select> </div> </div> </div> <script> var app = new Vue({ el: '#app', data: { itemList: [], keyword:'', }, created: function() { this.loaddata(); }, methods: { loaddata: function(){ var vueapp = this; vueapp.itemList = <?php echo json_encode($myArray, JSON_PRETTY_PRINT); ?>; }, showall: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); }, showauto: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Automotive)').hide(); }, showbackgrounds: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Backgrounds)').hide(); }, showchurch: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Church)').hide(); }, showcommunity: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Community)').hide(); }, showmoney: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Money)').hide(); }, showfood: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Food)').hide(); }, showgaming: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Gaming)').hide(); }, showhealthcare: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Healthcare)').hide(); }, showholidays: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Holidays)').hide(); }, showsports: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Sports)').hide(); }, showpatriotic: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Patriotic)').hide(); }, showretail: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Retail)').hide(); }, showeducation: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Education)').hide(); }, showmisc: function(){ $('.video:not(.all)').hide(); $('.video:not(.all)').show(); $('.video:not(.Misc)').hide(); }, }, computed:{ filteredItemList(){ return this.itemList.filter((item) => { return item.name_short.toLowerCase().includes(this.keyword.toLowerCase()); }); }, } }); </script> </body> </html> 找出在此会话中导出的显示内容 bash_display

  3. 在QtCreator上,使用QtCreator左侧面板上的“Projects”图标打开Project属性。 qtcreator_projects

  4. 在套件“运行”选项中,进入“运行环境”,单击“详细信息”,这将打开一个列表,并添加变量“DISPLAY”,其值等于步骤2中显示的值 enter image description here

  5. 现在运行您的应用程序。您的图形部分现在应该正确显示,因为它将使用其他会话转发频道。