亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? simple-qfont-demo-walkthrough.html

?? QT 下載資料僅供參考
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
    {        <a href="qfont.html">QFont</a> font( "Newyork", 18 );</pre><p> The slot to change the greeting font to sans serifis quite similar to <a href="#setDefault()">setDefault().</a>Here we save a line of code and define the (non-existant) font family (NewYork)and size (18 points) at once.<p> <pre>    <a name="x2116"></a>    font.<a href="qfont.html#setStyleHint">setStyleHint</a>( QFont::SansSerif );</pre><p> We use a style hint to ask <a href="qfont.html">QFont</a> for a sans serif font(<em>SansSerif</em> is a member of the QFont::StyleHint enumeration). <p> As a member of the NewYork family is quite unlikely to be installedon your computer, QFont will try to follow the style hint and the font sizeand use this information to find a replacement font.<p> <pre>        greetings-&gt;<a href="qwidget.html#setFont">setFont</a>( font );</pre><p> Finally we apply the requested font to the content of the<em>greetings</em> textview ...<p> <pre>        showFontInfo( font );    }</pre><p> ... and display the appropriate font information in the <em>fontInfo</em> textview. <p> <a name="setItalics()"></a><p> <pre>    void Viewer::setItalics()    {        <a href="qfont.html">QFont</a> font( "Tokyo" );        font.<a href="qfont.html#setPointSize">setPointSize</a>( 32 );        font.<a href="qfont.html#setWeight">setWeight</a>( QFont::Bold );    <a name="x2114"></a>    font.<a href="qfont.html#setItalic">setItalic</a>( TRUE );</pre><p> The <a href="#setItalics()">setItalics()</a> slot changes the greetings'font to a 32 pt bold and italic member of the (again non-existant)Tokyo family. Note that <a href="#setFontSubstitutions()">setFontSubstitutions()</a> defines a substitution family for Tokyo. <p> <pre>        greetings-&gt;<a href="qwidget.html#setFont">setFont</a>( font );</pre><p> We set the font of the <em>greetings</em> textview to <em>font</em>, and ...<p> <pre>        showFontInfo( font );    }</pre><p> ... display the appropriate font information in the <em>fontInfo</em> textview.<p> <a name="showFontInfo()"></a><p> <pre>    void Viewer::showFontInfo( <a href="qfont.html">QFont</a> &amp; font )    {</pre><p> Now, how do we show the font information?<p> <pre>        <a href="qfontinfo.html">QFontInfo</a> info( font );</pre><p> First we obtain information about the font that is actually used when the font <em>font</em> is required, and store it in <em>info</em>.<p> <pre>        <a href="qstring.html">QString</a> messageText;        messageText = "Font requested: \"" +                      font.<a href="qfont.html#family">family</a>() + "\" " +</pre><p> Then we start compiling the message that we want to show in the <em>fontInfo</em>textview.First, we print out the <em>requested</em> font family name. As we want toframe the family name with quotation marks, we have to escape the <em>"</em>character so that it is not confused with the C++ quotation marksused to terminate strings.<p> <pre>    <a name="x2123"></a><a name="x2113"></a>                  QString::<a href="qstring.html#number">number</a>( font.<a href="qfont.html#pointSize">pointSize</a>() ) + "pt&lt;BR&gt;" +</pre><p> We obtain the <em>requested</em> font size in points and convert it toa <a href="qstring.html">QString</a> using <a href="qstring.html#number">QString::number</a>(). Using <em>&lt;BR&gt</em>; we add a rich-textlinebreak to the <em>messageText</em> string.<p> <pre>                      "Font used: \"" +</pre><p> After we have displayed information about the <em>required</em> fontwe want to contrast it with the one <em>actually</em> used.This is stored in the <a href="qfontinfo.html">QFontInfo</a> <em>info</em> variable. <p> <pre>    <a name="x2120"></a>                  info.<a href="qfontinfo.html#family">family</a>() + "\" " +</pre><p> First we display the font family, ...<p> <pre>    <a name="x2121"></a>                  QString::<a href="qstring.html#number">number</a>( info.<a href="qfontinfo.html#pointSize">pointSize</a>() ) + "pt&lt;P&gt;";</pre><p> ... and then we append the actual font size, converted to a QString,  to the message string. The unit abbreviation and a rich-textparagraph (<em>&lt;P&gt;</em>) follow.<p> If custom substitutions are available for the requested <em>font</em>,we're going to show them as well:<p> <a name="showFontInfo()_QStringList"></a><pre>    <a name="x2119"></a><a name="x2110"></a>    <a href="qstringlist.html">QStringList</a> substitutions = QFont::<a href="qfont.html#substitutes">substitutes</a>( font.<a href="qfont.html#family">family</a>() );</pre><p> First we store the entire list of substitutes in a string list.<p> <pre>    <a name="x2128"></a>    if ( ! substitutions.<a href="qvaluelist.html#isEmpty">isEmpty</a>() ){</pre><p> If it contains at least one substitute ...<p> <pre>            messageText += "The following substitutions exist for " + \                           font.<a href="qfont.html#family">family</a>() + ":&lt;UL&gt;";</pre><p> ... we say so in the <em>messageText</em>, ...<p> <pre>    <a name="x2126"></a>        QStringList::Iterator i = substitutions.<a href="qvaluelist.html#begin">begin</a>();</pre><p> ... and prepare ourselves to step through the list. For thispurpose we set the list iterator <em>i</em> to the first list memberof the <em>substitutions</em> string list.<p> <pre>    <a name="x2127"></a>        while ( i != substitutions.<a href="qvaluelist.html#end">end</a>() ){</pre><p> As long as we haven't reached the last list member ...<p> <pre>                messageText += "&lt;LI&gt;\"" + (* i) + "\"";</pre><p> we add a bullet list entry (<em>&lt;LI&gt;</em>)of the current list member (i.e. the font family nameof the substitute), ...<p> <pre>                i++;            }</pre><p> ... and move the iterator one step further.<a name="setFontSubstitutions()"></a><p> <pre>             messageText += "&lt;/UL&gt;";</pre><p> Finally we add the end-of-bullet-list rich-text tag to the <em>messageText</em>string.<p> <pre>        } else {            messageText += "No substitutions exist for " + \                           font.<a href="qfont.html#family">family</a>() + ".";        }</pre><p> If the substitution list was empty, we make a note aboutit in the <em>messageText</em> string.<p> <pre>        fontInfo-&gt;<a href="qtextedit.html#setText">setText</a>( messageText );    }</pre><p> Now that we have the <em>messageText</em> string ready we enter it intothe <em>fontInfo</em> textview.<p> <pre>    void Viewer::setFontSubstitutions()    {</pre><p> With this function we finally reveal the secret of how todefine custom substitutions for a font family.<p> <pre>        <a href="qstringlist.html">QStringList</a> substitutes;</pre><p> All we need is a string list.<p> <pre>    <a name="x2125"></a>    substitutes.<a href="qvaluelist.html#append">append</a>( "Times" );        substitutes +=  "Mincho",        substitutes &lt;&lt; "Arabic Newspaper" &lt;&lt; "crox";</pre><p> In a real world application you will probably stick to one of the abovemethods to add strings to a string list. Here all possible ones are outlinedto give you an overview. <p> After these append operations <em>substitutes</em> consists of four members:<em>Times</em>, <em>Mincho</em>, <em>Arabic Newspaper</em>, and <em>Crox</em> in thisorder. These are the font families that in the first place are searched for characters the base font does not provide.<p> <pre>    <a name="x2112"></a>    QFont::<a href="qfont.html#insertSubstitutions">insertSubstitutions</a>( "Bavaria", substitutes );</pre><p> In <em>Viewer</em> objects, these four families provide a fallbackfor the Bavaria font family requested by the <a href="#setDefault()">setDefault()</a> slot.<p> <pre>    <a name="x2111"></a>    QFont::<a href="qfont.html#insertSubstitution">insertSubstitution</a>( "Tokyo", "Lucida" );    }</pre><p> For the Tokyo family used in <a href="#setItalics()">setItalics()</a>we provide only one substitute family, Lucida. Because it isonly one and not many as for Bavaria, we use <a href="qfont.html#insertSubstitution">QFont::insertSubstitution</a>() instead of <a href="qfont.html#insertSubstitutions">QFont::insertSubstitutions</a>().<p> If you usually create your GUIs using Qt Designer this walkthroughhas already come to an end. If this is one of your first encounterswith Qt you might however continue with the explanationof the very simple <a href="#simple-qfont-demo.cpp">main() function.</a><p> <a name="layout()"></a><p> <pre>    <a name="x2130"></a>void Viewer::<a href="qwidget.html#layout">layout</a>()    {</pre><p> This last member function of the <em>Viewer</em> class does not coverany more <a href="qfont.html">QFont</a> details. All it does is creating a nice automaticlayout for the three push buttons and the two text views.<p> The best solution for this task is to have the two <a href="qtextview.html">QTextView</a>slined up horizontally. The same applies to the <a href="qpushbutton.html">QPushButton</a>s.Finally both of these layouts are placed together into a verticallayout container. Qt takes care of the proportions so that everythinglooks nice.<p> <pre>        <a href="qhboxlayout.html">QHBoxLayout</a> * textViewContainer = new <a href="qhboxlayout.html">QHBoxLayout</a>();</pre><p> Let's create the first layout that aligns its members horizontally, ...<p> <pre>    <a name="x2108"></a>    textViewContainer-&gt;<a href="qboxlayout.html#addWidget">addWidget</a>( greetings );</pre><p> ... and add the QTextView with the greetings, ...<p> <pre>        textViewContainer-&gt;<a href="qboxlayout.html#addWidget">addWidget</a>( fontInfo );</pre><p> ... as well as the text view with the font information. <em>fontInfo</em> appearsto the right of <em>greetings</em> because it was added later.<p> <pre>        <a href="qhboxlayout.html">QHBoxLayout</a> * buttonContainer = new <a href="qhboxlayout.html">QHBoxLayout</a>();</pre><p> Now we create the second layout for the push buttons.<p> <pre>        buttonContainer-&gt;<a href="qboxlayout.html#addWidget">addWidget</a>( defaultButton );</pre><p> <em>defaultButton</em> is placed on the left hand side of the layout, ...<p> <pre>        buttonContainer-&gt;<a href="qboxlayout.html#addWidget">addWidget</a>( sansSerifButton );</pre><p> ... <em>sansSerifButton</em> in the middle, ...<p> <pre>        buttonContainer-&gt;<a href="qboxlayout.html#addWidget">addWidget</a>( italicsButton );</pre><p> ... and <em>italicsButton</em> on the right hand side.<p> Unfortunately we face a tiny problem: remember that (a highly unusualthing to do in a real world application) the labels of the threebuttons are drawn in different fonts. Whilst the automatic layoutaccounts for the fact all three buttons have the same width, the uncommonoccurrence of different character heights leads to different button heights.<p> To make the application window look nice we have to help it a little.<p> <pre>    <a name="x2129"></a>    int maxButtonHeight = defaultButton-&gt;<a href="qwidget.html#height">height</a>();        if ( sansSerifButton-&gt;<a href="qwidget.html#height">height</a>() &gt; maxButtonHeight )            maxButtonHeight = sansSerifButton-&gt;<a href="qwidget.html#height">height</a>();        if ( italicsButton-&gt;<a href="qwidget.html#height">height</a>() &gt; maxButtonHeight )            maxButtonHeight = italicsButton-&gt;<a href="qwidget.html#height">height</a>();</pre><p> By comparing the three button heights we find the largest oneand store it in <em>maxButtonHeight</em>.<p> <pre>    <a name="x2131"></a>    defaultButton-&gt;<a href="qwidget.html#setFixedHeight">setFixedHeight</a>( maxButtonHeight );        sansSerifButton-&gt;<a href="qwidget.html#setFixedHeight">setFixedHeight</a>( maxButtonHeight );        italicsButton-&gt;<a href="qwidget.html#setFixedHeight">setFixedHeight</a>( maxButtonHeight );</pre><p> Now we set the height of each button to this maximum value and make surethat the automatic layout does not change it.  <p> This was the hardest part of the entire layout process. There is one taskleft:<p> <pre>        <a href="qvboxlayout.html">QVBoxLayout</a> * container = new <a href="qvboxlayout.html">QVBoxLayout</a>( this );</pre><p> We create a layout that arranges its members vertically.<p> <pre>    <a name="x2107"></a>    container-&gt;<a href="qboxlayout.html#addLayout">addLayout</a>( textViewContainer );</pre><p> This <em>container</em> layout contains the text views on top, ...<p> <pre>        container-&gt;<a href="qboxlayout.html#addLayout">addLayout</a>( buttonContainer );</pre><p> ... and the button row below.<p> <pre>        <a href="qwidget.html#resize">resize</a>( 700, 250 );    }</pre><p> Finally we set the size of the entire main window to a width of 700 pixelsand a height of 250 pixels.<p> <h3><a name="simple-qfont-demo.cpp">The main program</a></h3><p> There is not much to say about the main program.<p> <pre>    #include "viewer.h"    #include &lt;<a href="qapplication-h.html">qapplication.h</a>&gt;    int main( int argc, char **argv )    {        <a href="qapplication.html">QApplication</a> app( argc, argv );        Viewer * textViewer = new Viewer();</pre><p> We create an instance of the <a href="#viewer.cpp">Viewer</a>class, ...<p> <pre>    <a name="x2134"></a>    app.<a href="qapplication.html#setMainWidget">setMainWidget</a>( textViewer );</pre><p> ... make it the main widget of the application object <em>app</em>, ...<p> <pre>    <a name="x2135"></a>    textViewer-&gt;<a href="qwidget.html#show">show</a>();</pre><p> ... display it to the user ...<p> <pre>    <a name="x2133"></a>    return app.<a href="qapplication.html#exec">exec</a>();    }</pre><p> ... and enter the application loop. Well done, that was all for today ...<p> <p>See also <a href="step-by-step-examples.html">Step-by-step Examples</a>.<!-- eof --><p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美成人一区| 国产欧美日韩在线看| 久久不见久久见中文字幕免费| 国产精品免费久久久久| 91精品国产高清一区二区三区蜜臀 | caoporen国产精品视频| 亚洲国产成人av| 中文字幕一区视频| 精品国产乱码久久久久久老虎| 91浏览器打开| 风间由美一区二区av101| 日韩av一级片| 亚洲综合精品久久| 国产三区在线成人av| 欧美日韩小视频| 91麻豆免费视频| 国产精品亚洲专一区二区三区| 日韩精品高清不卡| 亚洲一区二区在线免费观看视频| 国产精品高潮呻吟久久| 精品入口麻豆88视频| 91 com成人网| 欧美精品自拍偷拍动漫精品| 91色|porny| 色香色香欲天天天影视综合网| www.在线成人| 成人va在线观看| 丁香天五香天堂综合| 国产揄拍国内精品对白| 国内精品在线播放| 国产一区在线观看视频| 激情国产一区二区| 国产一区二区三区四区五区美女 | 欧美情侣在线播放| 欧美性猛片xxxx免费看久爱 | 日韩精品一区二区三区在线| 欧美精品视频www在线观看| 欧美日韩成人综合天天影院| 欧美日韩在线播放| 欧美精品粉嫩高潮一区二区| 欧美亚洲丝袜传媒另类| 欧美日韩视频第一区| 91麻豆精品国产| 欧美一区二区在线免费播放| 日韩一区二区精品| 精品福利一区二区三区| 久久精品一区二区三区不卡| 久久蜜桃av一区精品变态类天堂| 国产亚洲欧美日韩日本| 国产精品家庭影院| 亚洲日本在线a| 一二三四区精品视频| 午夜精品影院在线观看| 免费xxxx性欧美18vr| 久久国产剧场电影| 国产精品888| 一本在线高清不卡dvd| 91国产免费观看| 欧美一区二区国产| 久久精品亚洲麻豆av一区二区| 中文字幕的久久| 亚洲精品国产品国语在线app| 亚洲国产一区视频| 久久99日本精品| 丁香婷婷综合网| 色呦呦一区二区三区| 91精品在线观看入口| 精品国产乱码久久久久久久| 国产欧美日韩在线| 亚洲福利国产精品| 国模冰冰炮一区二区| av资源网一区| 91精品国产综合久久精品图片| 久久久久综合网| 亚洲精品福利视频网站| 老司机免费视频一区二区| 不卡大黄网站免费看| 在线一区二区三区四区| 精品国内片67194| 夜夜嗨av一区二区三区网页| 美国av一区二区| av电影在线观看不卡| 日韩欧美一二区| 亚洲免费观看高清在线观看| 六月丁香婷婷色狠狠久久| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美日韩一区二区在线观看视频| 久久综合久久99| 亚洲成人资源在线| 成人免费视频国产在线观看| 91精品国产91久久久久久最新毛片| 国产日韩高清在线| 日本亚洲三级在线| 色94色欧美sute亚洲线路一ni| 欧美精品一区二区三区四区| 一区二区三区精品久久久| 国产一区二区美女诱惑| 欧美久久久久久久久中文字幕| 国产精品毛片a∨一区二区三区| 免费的成人av| 欧美日韩一级片在线观看| 国产精品乱码久久久久久| 麻豆国产91在线播放| 欧美三级视频在线播放| 亚洲天堂精品在线观看| 国产乱淫av一区二区三区| 3d成人动漫网站| 一区二区三区在线观看欧美 | 欧美在线不卡一区| 亚洲国产精品精华液2区45| 男人操女人的视频在线观看欧美| 在线精品视频免费观看| 中文字幕字幕中文在线中不卡视频| 国产一区欧美日韩| 精品免费视频.| 免费精品视频在线| 欧美影院精品一区| 亚洲精品一二三| 一本色道a无线码一区v| 国产精品福利电影一区二区三区四区| 国产一区二区三区综合| 欧美乱妇23p| 亚洲国产精品精华液网站| 色老汉一区二区三区| 中文字幕在线观看不卡| 北岛玲一区二区三区四区| 国产亚洲精久久久久久| 国模套图日韩精品一区二区| 欧美岛国在线观看| 狠狠色综合日日| 精品久久久久久久久久久久包黑料| 日韩黄色免费网站| 日韩一级片在线观看| 亚洲地区一二三色| 欧美日韩1区2区| 日韩高清一区在线| 欧美大片在线观看一区二区| 老司机一区二区| 久久久久久久久久久久久夜| 狠狠色丁香九九婷婷综合五月| 日韩精品中文字幕一区二区三区 | 午夜精品久久久久久久久久久| 欧美在线视频你懂得| 亚洲sss视频在线视频| 3d动漫精品啪啪1区2区免费| 日本视频中文字幕一区二区三区| 91精品国产综合久久久久| 久久成人麻豆午夜电影| 日韩欧美国产午夜精品| 麻豆精品视频在线| 久久精品夜夜夜夜久久| 91在线小视频| 亚洲国产一二三| 日韩一卡二卡三卡| 国产精品自在在线| 国产精品人妖ts系列视频| 91在线国产福利| 日韩一区精品视频| 精品国产污污免费网站入口| 国产成人综合在线观看| 亚洲男人天堂av网| 这里只有精品免费| 国产一区二区精品久久99| 最新国产成人在线观看| 欧美日高清视频| 国产黄人亚洲片| 亚洲乱码一区二区三区在线观看| 欧美日韩免费观看一区三区| 激情综合色播激情啊| 成人免费在线播放视频| 欧美精品一二三| 福利一区二区在线| 三级久久三级久久| 日本一区二区视频在线| 欧美性猛交xxxx黑人交| 国产在线日韩欧美| 亚洲综合久久av| 久久久久久久网| 欧美性猛片aaaaaaa做受| 国产乱子轮精品视频| 亚洲激情第一区| 免费成人av资源网| 国产精品超碰97尤物18| 欧美美女一区二区在线观看| 福利视频网站一区二区三区| 亚洲成人激情自拍| 国产精品美女一区二区| 日韩免费在线观看| 91福利在线播放| 国产成人av福利| 日韩vs国产vs欧美| 亚洲色欲色欲www| 精品动漫一区二区三区在线观看| 91在线观看视频| 国产福利一区二区| 日精品一区二区三区| 亚洲三级久久久| 欧美国产精品专区| 日韩视频一区在线观看| 欧美在线一二三四区|