
{"id":327,"date":"2022-05-18","slug":"%e6%89%b9%e9%87%8f%e5%a4%84%e7%90%86qt%e7%95%8c%e9%9d%a2%e4%b8%8a%e7%9a%84%e6%8e%a7%e4%bb%b6","link":"http:\/\/to3.top\/wordpress\/327","title":{"rendered":"\u6279\u91cf\u5904\u7406QT\u754c\u9762\u4e0a\u7684\u63a7\u4ef6"},"content":{"rendered":"<p>\u5982\u4f55\u6279\u91cf\u5904\u7406QT\u754c\u9762\u4e0a\u7684\u63a7\u4ef6\u3002<br \/>\n\u63a7\u4ef6\u6700\u597d\u662f\u6309\u6570\u5b57\u6392\u5e8f\u7684\uff0c\u6700\u597d\u4e0d\u8981\u81ea\u5b9a\u4e49\u3002<\/p>\n<blockquote><p>void MainWindow::setUi(QString currency, QString num)<br \/>\n{<br \/>\nQList&lt;QLabel*&gt; labelList;<br \/>\nQList&lt;QPushButton*&gt; buttonList;<br \/>\nQList&lt;QLineEdit*&gt; lineEditList;<br \/>\nfor (int i = 1; i &lt; 9; i++) {<br \/>\nlabelList &lt;&lt; findChild&lt;QLabel*&gt;(&#8220;label_&#8221; + QString::number(i));<br \/>\nbuttonList &lt;&lt; findChild&lt;QPushButton*&gt;(&#8220;pushButton_&#8221; + QString::number(i));<br \/>\nlineEditList &lt;&lt; findChild&lt;QLineEdit*&gt;(&#8220;lineEdit_&#8221; + QString::number(i));<br \/>\n}<\/p>\n<p>if (num.toInt() == 0 || num.toInt() &gt;= 9) {<br \/>\nreturn;<br \/>\n}<br \/>\nqDebug() &lt;&lt; &#8220;MainWindow::setUi&#8212;&gt;currency:num=&#8221; &lt;&lt; currency &lt;&lt; &#8220;:&#8221; &lt;&lt; num;<br \/>\nQString appPath = QCoreApplication::applicationDirPath() + &#8220;\/currency\/&#8221; + currency + &#8220;.png&#8221;;<br \/>\nlabelList.at(num.toInt() &#8211; 1)-&gt;setPixmap(QPixmap(appPath));<br \/>\nlabelList.at(num.toInt() &#8211; 1)-&gt;setMaximumSize(157, 110);<br \/>\nlabelList.at(num.toInt() &#8211; 1)-&gt;setScaledContents(true);<br \/>\nlineEditList.at(num.toInt() &#8211; 1)-&gt;setText(num);<br \/>\nbuttonList.at(num.toInt() &#8211; 1)-&gt;setText(currency);<br \/>\n}<\/p>\n<p>\u6ce8\u610f\uff1a<br \/>\nlabelList .at(i)&#8212;&#8212;&#8212;&#8212;\u5b9e\u73b0\u8c03\u7528<br \/>\nlabelList [i]&#8212;&#8212;&#8212;&#8212;&#8212;-\u5b9e\u73b0\u4fee\u6539<br \/>\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br \/>\n\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3aCSDN\u535a\u4e3b\u300c\u5eb7\u95ef\u300d\u7684\u539f\u521b\u6587\u7ae0\uff0c\u9075\u5faaCC 4.0 BY-SA\u7248\u6743\u534f\u8bae\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u539f\u6587\u51fa\u5904\u94fe\u63a5\u53ca\u672c\u58f0\u660e\u3002<br \/>\n\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/blog.csdn.net\/sirkang\/article\/details\/124342629<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u6279\u91cf\u5904\u7406QT\u754c\u9762\u4e0a\u7684\u63a7\u4ef6\u3002 \u63a7\u4ef6\u6700\u597d\u662f\u6309\u6570\u5b57\u6392\u5e8f\u7684\uff0c\u6700\u597d\u4e0d\u8981\u81ea\u5b9a\u4e49\u3002 void MainWindow::setUi(QString currency, QString num) { QList&lt;QLabel*&gt; labelList; QList&lt;QPushB [&hellip;]<\/p>\n","protected":false},"featured_media":140,"categories":[5],"tags":[42],"post_thumbnail_image":"http:\/\/to3.top\/wordpress\/wp-content\/uploads\/2018\/08\/2018-08-08_092414-1.png","content_first_image":"","post_medium_image_300":"http:\/\/to3.top\/wordpress\/wp-content\/uploads\/2018\/08\/2018-08-08_092414-1.png","post_thumbnail_image_624":"http:\/\/to3.top\/wordpress\/wp-content\/uploads\/2018\/08\/2018-08-08_092414-1.png","post_frist_image":"","post_medium_image":"http:\/\/to3.top\/wordpress\/wp-content\/uploads\/2018\/08\/2018-08-08_092414-1.png","post_large_image":"http:\/\/to3.top\/wordpress\/wp-content\/uploads\/2018\/08\/2018-08-08_092414-1.png","post_full_image":"http:\/\/to3.top\/wordpress\/wp-content\/uploads\/2018\/08\/2018-08-08_092414-1.png","post_all_images":[],"total_comments":1,"category_name":"\u6280\u672f","like_count":"0","avatarurls":[],"related_posts":[],"pageviews":44,"next_post_id":341,"next_post_title":"ToolBox\u5de5\u5177\u7bb1\u4e0b\u8f7d","previous_post_id":230,"previous_post_title":"Java\u7a0b\u5e8f\u542f\u52a8\u754c\u9762","_links":{"self":[{"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/posts\/327"}],"collection":[{"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/comments?post=327"}],"version-history":[{"count":2,"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/posts\/327\/revisions"}],"predecessor-version":[{"id":329,"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/posts\/327\/revisions\/329"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/media\/140"}],"wp:attachment":[{"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/media?parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/categories?post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/to3.top\/wordpress\/wp-json\/wp\/v2\/tags?post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}