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

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

?? simple-qfont-demo-walkthrough.html

?? QT 下載資料僅供參考
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/doc/simple-qfont-demo-walkthrough.doc:5 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Walkthrough: A simple QFont demonstration</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>Walkthrough: A simple QFont demonstration</h1> <p> <p> The following walkthroughwill show you how to make use of the font setting and manipulation techniques  provided by <a href="qfont.html">QFont</a>.<p> In addition it will show some aspects of widget layout -- if you prefer leavingthis job to Qt Designer simply skip the <a href="#layout()">relevant paragraphs.</a> Moreover, if youhave asked yourself how to add strings to a <a href="qstringlist.html">QStringList</a> and how tostep through its members, you will know after reading this walkthrough,or skipping to the relevant explanations in <a href="#showFontInfo()_QStringList">Viewer::showFontInfo()</a> and <a href="#setFontSubstitutions()">Viewer::setFontSubstitutions().</a><p> To get the most out of the walkthrough you should at least be familiar with<a href="signalsandslots.html">signals and slots.</a><p> The <a href="simple-font-demo-example.html">example program</a> consists of a widget containing two <a href="qtextview.html">QTextView</a>s side by side.The one on the left shows greetings in English, Russian, and Hebrew.The one on the right shows some information about the fonts used todraw these greetings. Three push buttons in the bottom of the main windowchange the font used to display the greetings.<p> Note that the fonts and font characteristics in the example have been chosenfor demonstration purposes only -- in a real world application theywould rather count for bad design. <p> <h3><a name="viewer.h">The API of the custom widget</a></h3><p> The widget used in this example is a custom widget named<em>Viewer</em>.<p> <pre>    #include &lt;<a href="qwidget-h.html">qwidget.h</a>&gt;    #include &lt;<a href="qfont-h.html">qfont.h</a>&gt;</pre><p> As we derive it from <a href="qwidget.html">QWidget</a> we include the relevant header file.Additionally we use a <a href="qfont.html">QFont</a> object as a function argument, andtherefore include the QFont class.<p> <pre>    class QTextView;    class QPushButton;</pre><p> Furthermore we declare the use of the QTextView and the<a href="qpushbutton.html">QPushButton</a> classes for class variables (we don't need toinclude them at this stage yet because we only use pointers to these classes).<p> <pre>    class Viewer : public <a href="qwidget.html">QWidget</a>    {    <a href="metaobjects.html#Q_OBJECT">Q_OBJECT</a></pre><p> The <em>Viewer</em> widget will have slots, so don't forget to add the<em>Q_OBJECT</em> macro.<p> <pre>    public:        Viewer();</pre><p> As we won't use more than one instance of this class there is no need for any complex constructors, a simple one withoutany arguments should be sufficient.<p> <pre>    private slots:        void setDefault();</pre><p> As previously mentioned we're going to have three push buttons. When the userclicks on them, something should happen. Thus we define <a href="#setDefault()">one slot thatsets the font in the greeting window back to the default,</a> ...<p> <pre>        void setSansSerif();</pre><p> ... <a href="#setSansSerif()">one that switches to a sans serif font,</a>and ...<p> <pre>        void setItalics();</pre><p> ... <a href="#setItalics()">one that shows the greetings in italics.</a><p> <pre>    private:        void setFontSubstitutions();</pre><p> Will will write the greetings using different alphabets. For users who don'thave Unicode fonts installed we want to tell the application to tryto exchange missing characters in one font with appropriate charactersfrom other fonts. <a href="qfont.html">QFont</a> does such font substitutions on its own butwith <a href="#setFontSubstitutions()">this helper function</a>we can define our preferred substitution pattern.<p> <pre>        void layout();</pre><p> The task of putting the buttons and text views together we will put into a separate <a href="#layout()">layout()</a> function. This will make the code easier to understand and read.<p> <pre>        void showFontInfo( <a href="qfont.html">QFont</a> &amp; );</pre><p> <a href="#showFontInfo()">The last private function</a> reveals font information in the text view on the right.<p> <pre>        <a href="qtextview.html">QTextView</a> * greetings;        <a href="qtextview.html">QTextView</a> * fontInfo;        <a href="qpushbutton.html">QPushButton</a> * defaultButton;        <a href="qpushbutton.html">QPushButton</a> * sansSerifButton;        <a href="qpushbutton.html">QPushButton</a> * italicsButton;    };</pre><p> Last but not least we define the elements of our GUI as privateclass variables.<p> <h3><a name="viewer.cpp">The implementation of the Viewer widget</a></h3><p> Now we will implement the <em>Viewer</em> class.<p> <pre>    #include "viewer.h"    #include &lt;<a href="qstring-h.html">qstring.h</a>&gt;    #include &lt;<a href="qstringlist-h.html">qstringlist.h</a>&gt;    #include &lt;<a href="qtextview-h.html">qtextview.h</a>&gt;    #include &lt;<a href="qpushbutton-h.html">qpushbutton.h</a>&gt;    #include &lt;<a href="qlayout-h.html">qlayout.h</a>&gt;</pre><p> First we include the relevant header files -- obviously the <a href="#viewer.h">header of the Viewer class</a> itself,of the <a href="qpushbutton.html">QPushButton</a> and QTextView widgets, and of the <a href="qstring.html">QString</a>and <a href="qstringlist.html">QStringList</a> classes. <em>qlayout.h</em> providesclasses for horizontal and vertical layout and will be usedin the <a href="#layout()">layout()</a> function.<p> <a name="Viewer()"></a><p> <pre>    Viewer::Viewer()           :<a href="qwidget.html">QWidget</a>()    {</pre><p> As already mentioned the finger print of the <em>Viewer</em> constructoris as simple as possible, without any arguments, derived fromthe <a href="qwidget.html">QWidget</a> default constructor.<p> <pre>        setFontSubstitutions();</pre><p> First we define the font substitutions -- for clarity reasons wedo this in a <a href="#setFontSubstitutions()">separate function.</a><p> <pre>    <a name="x2122"></a>    <a href="qstring.html">QString</a> greeting_heb = QString::<a href="qstring.html#fromUtf8">fromUtf8</a>( "\327\251\327\234\327\225\327\235" );        <a href="qstring.html">QString</a> greeting_ru = QString::<a href="qstring.html#fromUtf8">fromUtf8</a>( "\320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265" );</pre><p> The Hebrew and the Russian greeting we have readily available as UTF8 encodedstrings.To use them in a <a href="qstring.html">QString</a> we "import" them with <a href="qstring.html#fromUtf8">QString::fromUtf8</a>(). <p> <pre>        <a href="qstring.html">QString</a> greeting_en( "Hello" );</pre><p> Dor the English greeting we use a simple QString. <p> <pre>        greetings = new <a href="qtextview.html">QTextView</a>( this, "textview" );</pre><p> Now we create the first widget as a child of <em>this</em> widget, the QTextView with the identity name <em>textview</em> that shows the greetings. <p> <pre>        greetings-&gt;<a href="qtextedit.html#setText">setText</a>( greeting_en + "\n" +                           greeting_ru + "\n" +                           greeting_heb );</pre><p> Now we set the text shown by <em>greetings</em> to the three greetings.<p> <pre>        fontInfo = new <a href="qtextview.html">QTextView</a>( this, "fontinfo" );</pre><p> The second text view we call <em>fontinfo</em> and createit as a child of <em>this</em> <em>Viewer</em> widget.<p> <pre>        setDefault();</pre><p> Using the <a href="#setDefault()">setDefault()</a> function weapply the initial font to the greetings <em>greetings</em> and fill the <em>fontInfo</em> textview with information about  the font used.<p> <pre>        defaultButton = new <a href="qpushbutton.html">QPushButton</a>( "Default", this,                                                       "pushbutton1" );</pre><p> Now we create the first of the three push buttons -- the onethat changes the font to the initial one -- with the label <em>Default</em>.<p> <pre>    <a name="x2132"></a>    defaultButton-&gt;<a href="qwidget.html#setFont">setFont</a>( QFont( "times" ) );</pre><p> The label should be printed in a member font of the Times family.In the unlikely case that the user does not have installed amatching font, <a href="qfont.html">QFont</a> is responsible in finding a replacement.Note that case-sensitivity is no issue when specifying the font family.<p> As we don't explicitly request a font size or weight, QFont tries tofind a default 12 pt font with normal boldness. <p> <pre>    <a name="x2109"></a>    <a href="qobject.html#connect">connect</a>( defaultButton, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ),                 this, SLOT( setDefault() ) );</pre><p> In order to make something happening when the user clicks the<em>defaultButton</em>, we connect the <a href="qbutton.html#clicked">QPushButton::clicked</a>() signalsissued from it to the <em>Viewer</em>'s <a href="#setDefault()">setDefault()</a>slot.<p> <pre>        sansSerifButton = new <a href="qpushbutton.html">QPushButton</a>( "Sans Serif", this,                                                         "pushbutton2" );        sansSerifButton-&gt;<a href="qwidget.html#setFont">setFont</a>( QFont( "Helvetica", 12 ) );</pre><p> The newly created second button is labelled <em>Sans Serif</em>in a 12 pt Helvetica font. Again if this is not possible becausethe requested font is not available on the system, <a href="qfont.html">QFont</a> dealswith it and finds a replacement.<p> <pre>        <a href="qobject.html#connect">connect</a>( sansSerifButton, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ),                 this, SLOT( setSansSerif() ) );</pre><p> We connect the clicked() signal of the <em>sansSerifButton</em> to the <a href="#setSansSerif()">setSansSerif()</a> slot.<p> <pre>        italicsButton = new <a href="qpushbutton.html">QPushButton</a>( "Italics", this,                                                       "pushbutton3" );        italicsButton-&gt;<a href="qwidget.html#setFont">setFont</a>( QFont( "lucida", 12, QFont::Bold, TRUE ) );</pre><p> <em>italicsButton</em>, the last push button, is labelled <em>Italics</em>.This time we specify even more characteristics of thelabel font. We wish it to be a 12 pt bold member of the Lucida family.Also it should be in italics, indicated by the fourth QFont argumentbeing TRUE.<p> <pre>        <a href="qobject.html#connect">connect</a>( italicsButton, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ),                 this, SLOT( setItalics() ) );</pre><p> Again, the <em>italicsButton</em>'s clicked() signal is connected toa slot of <em>this</em> <em>Viewer</em> object <a href="#setItalics()">setItalics().</a><p> <pre>        <a href="qwidget.html#layout">layout</a>();    }</pre><p> Finally we arrange all five child widgets of <em>this</em> main windownicely using <a href="#layout()">layout().</a><p> <a name="setDefault()"></a><p> <pre>    void Viewer::setDefault()    {        <a href="qfont.html">QFont</a> font( "Bavaria" );</pre><p> For demonstration purposes on how the <a href="qfont.html">QFont</a> substitution workswe use a non-existant font family, Bavaria, as the default font forthe greetings.<p> <pre>    <a name="x2115"></a>    font.<a href="qfont.html#setPointSize">setPointSize</a>( 24 );</pre><p> This font should have a size of 24 points, ...<p> <pre>    <a name="x2118"></a>    font.<a href="qfont.html#setWeight">setWeight</a>( QFont::Bold );</pre><p> ... it should be bold, ...<p> <pre>    <a name="x2117"></a>    font.<a href="qfont.html#setUnderline">setUnderline</a>( TRUE );</pre><p> ... and the text written should be underlined.<p> <pre>        greetings-&gt;<a href="qwidget.html#setFont">setFont</a>( font );</pre><p> Now we ask the <em>greetings</em> widget to use the font <em>font</em>.<p> As a member of the Bavaria font family is unlikely tobe installed on your machine, run the program and observehow QFont finds a substitute. Later on we will definecustom substitutions for Bavaria in the <a href="#setFontSubstitutions()">setFontSubstitutions()</a> function.<p> <pre>        showFontInfo( font );    }</pre><p> Finally we use the function <a href="#showFontInfo()">showFontInfo()</a> to display appropriate informationabout the current font and how it maybe differs from the one requested.<p> <a name="setSansSerif()"></a><p> <pre>    void Viewer::setSansSerif()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩欧美一区二区| 欧美bbbbb| 91污在线观看| 国产精品久线在线观看| 国产激情一区二区三区桃花岛亚洲| 欧美日韩一区二区三区四区| 夜夜嗨av一区二区三区中文字幕| 欧美日韩中文字幕一区二区| 日本少妇一区二区| 久久日一线二线三线suv| 不卡av免费在线观看| 亚洲精品欧美激情| 日韩欧美成人激情| 成人a区在线观看| 天天影视网天天综合色在线播放| 精品粉嫩超白一线天av| 成人精品国产一区二区4080| 亚洲成人激情av| 久久精品在线观看| 欧美日精品一区视频| 国产一区二区三区免费播放| 亚洲蜜臀av乱码久久精品蜜桃| 欧美日韩国产一区| 国产成a人亚洲精品| 亚洲精品国产一区二区精华液| 美国三级日本三级久久99| 欧美日韩一区二区三区四区| 国产亚洲欧美在线| 91免费看片在线观看| 免费在线看成人av| 国产精品视频一二| 欧美日韩一二区| 国产精品一区二区在线播放| 亚洲一区在线观看网站| 欧美大片一区二区| 色噜噜久久综合| 国产黄色91视频| 午夜免费久久看| 亚洲视频在线观看三级| 久久亚洲综合色| 91精品免费观看| 91免费国产视频网站| 国内外精品视频| 天天操天天干天天综合网| 亚洲色图视频网站| 国产欧美日韩三级| 欧美大白屁股肥臀xxxxxx| 91精品办公室少妇高潮对白| 成人高清视频在线| 国产一区美女在线| 男女性色大片免费观看一区二区 | av高清不卡在线| 久久成人麻豆午夜电影| 亚洲一卡二卡三卡四卡五卡| 中文字幕中文字幕一区二区| 欧美精品一区男女天堂| 6080亚洲精品一区二区| 色婷婷综合久久久中文一区二区| 国产高清无密码一区二区三区| 日日夜夜免费精品| 亚洲国产精品久久一线不卡| 亚洲人成网站影音先锋播放| 国产精品视频一二三| 欧美精品一区二| 精品美女一区二区| 日韩女同互慰一区二区| 欧美一三区三区四区免费在线看| 日本久久一区二区三区| 91麻豆国产在线观看| 成人h动漫精品一区二区| 成人午夜在线播放| 岛国一区二区三区| 成人av网站在线观看免费| 国产99久久久久| 成人性生交大合| 99久久久无码国产精品| 成人美女视频在线观看| 国产精品一区二区男女羞羞无遮挡| 久久国产生活片100| 久久se精品一区二区| 九九国产精品视频| 韩国av一区二区三区| 黑人巨大精品欧美一区| 激情综合网av| 国产成人午夜精品影院观看视频| 国产精品1024久久| 成人国产一区二区三区精品| 91女厕偷拍女厕偷拍高清| 91视频你懂的| 欧美午夜视频网站| 欧美精品日韩一本| 欧美一级片在线观看| 精品日韩一区二区三区| 久久精品一区二区三区不卡牛牛 | 欧美一区二区三区视频免费| 91精品欧美一区二区三区综合在 | 欧美国产精品久久| 亚洲欧美日本韩国| 性做久久久久久久免费看| 午夜精品久久久久久久| 日本不卡的三区四区五区| 国产乱子伦一区二区三区国色天香| 国产一区二区三区免费| 色偷偷成人一区二区三区91| 9191国产精品| 国产午夜精品一区二区三区嫩草 | 亚洲国产另类av| 精油按摩中文字幕久久| 99精品视频在线观看免费| 在线不卡中文字幕播放| 久久久www成人免费无遮挡大片| 中文字幕乱码亚洲精品一区| 亚洲国产精品天堂| 国产成人免费9x9x人网站视频| 91视频在线观看| 日韩一级视频免费观看在线| 国产精品久久午夜夜伦鲁鲁| 亚洲国产综合在线| 国产一区二区三区观看| 99re热这里只有精品视频| 91.com在线观看| 中文字幕在线观看一区二区| 日韩高清不卡一区二区| va亚洲va日韩不卡在线观看| 91精品福利在线一区二区三区 | 99久久久精品| 欧美变态凌虐bdsm| 一级女性全黄久久生活片免费| 国产一区二区三区在线看麻豆| 在线看国产一区| 国产精品美女久久久久av爽李琼| 日本特黄久久久高潮| 色8久久精品久久久久久蜜| 久久久国产精品麻豆| 日韩综合小视频| 色诱视频网站一区| 国产精品丝袜在线| 韩日av一区二区| 6080日韩午夜伦伦午夜伦| 亚洲欧美成人一区二区三区| 国产精品99久久久久久久vr| 7777精品伊人久久久大香线蕉经典版下载 | 久久综合久久鬼色| 香蕉乱码成人久久天堂爱免费| 成人中文字幕合集| 欧美精品一区二区三区四区| 亚洲与欧洲av电影| 91麻豆精品视频| 国产精品天干天干在观线| 激情综合网激情| 欧美电视剧免费全集观看| 午夜激情久久久| 91福利社在线观看| 亚洲欧美激情一区二区| 成人蜜臀av电影| 国产精品水嫩水嫩| 国产91精品在线观看| 国产午夜精品久久久久久久| 精一区二区三区| 亚洲精品在线观看网站| 久久精品国产亚洲aⅴ| 欧美一区二区三区四区五区 | 久久久久久久久久久黄色| 久久精品国产一区二区三区免费看| 精品1区2区3区| 亚洲宅男天堂在线观看无病毒| 色综合久久中文综合久久97| 日韩理论片网站| 欧美综合天天夜夜久久| 亚洲综合999| 欧美日韩激情在线| 午夜成人在线视频| 日韩欧美在线影院| 国产一区二区三区四| 日本一区二区视频在线| 成人午夜电影久久影院| 亚洲乱码日产精品bd| 日本韩国一区二区| 日韩电影在线一区| 日韩精品一区二区三区老鸭窝| 国产精品自拍在线| 亚洲色欲色欲www| 欧美午夜精品久久久| 欧美aaaaa成人免费观看视频| 欧美精品一区二区在线播放| 成人av电影观看| 亚洲韩国一区二区三区| 日韩欧美国产成人一区二区| 国产酒店精品激情| 亚洲视频一区在线| 7777精品伊人久久久大香线蕉| 精一区二区三区| 亚洲欧美福利一区二区| 欧美一区中文字幕| 不卡av在线网| 免费在线观看一区| 国产精品的网站| 日韩一区二区三区免费观看| 成人深夜在线观看| 日韩高清在线一区|