1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011
/// C++ type: <span style='color: green;'>```QFontMetrics```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>The <a href="http://doc.qt.io/qt-5/qfontmetrics.html">QFontMetrics</a> class provides font metrics information.</p>
/// <p><a href="http://doc.qt.io/qt-5/qfontmetrics.html">QFontMetrics</a> functions calculate the size of characters and strings for a given font. There are three ways you can create a <a href="http://doc.qt.io/qt-5/qfontmetrics.html">QFontMetrics</a> object:</p>
/// <ol class="1" type="1"><li>Calling the <a href="http://doc.qt.io/qt-5/qfontmetrics.html">QFontMetrics</a> constructor with a <a href="http://doc.qt.io/qt-5/qfont.html">QFont</a> creates a font metrics object for a screen-compatible font, i.e. the font cannot be a printer font. If the font is changed later, the font metrics object is <i>not</i> updated.<p>(Note: If you use a printer font the values returned may be inaccurate. Printer fonts are not always accessible so the nearest screen font is used if a printer font is supplied.)</p>
/// </li>
/// <li><a href="http://doc.qt.io/qt-5/qwidget.html#fontMetrics">QWidget::fontMetrics</a>() returns the font metrics for a widget's font. This is equivalent to <a href="http://doc.qt.io/qt-5/qfontmetrics.html">QFontMetrics</a>(widget-><a href="http://doc.qt.io/qt-5/stylesheet-reference.html#font">font</a>()). If the widget's font is changed later, the font metrics object is <i>not</i> updated.</li>
/// <li><a href="http://doc.qt.io/qt-5/qpainter.html#fontMetrics">QPainter::fontMetrics</a>() returns the font metrics for a painter's current font. If the painter's font is changed later, the font metrics object is <i>not</i> updated.</li>
/// </ol>
/// <p>Once created, the object provides functions to access the individual metrics of the font, its characters, and for strings rendered in the font.</p>
/// <p>There are several functions that operate on the font: <a href="http://doc.qt.io/qt-5/qfontmetrics.html#ascent">ascent</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#descent">descent</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#height">height</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#leading">leading</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineSpacing">lineSpacing</a>() return the basic size properties of the font. The <a href="http://doc.qt.io/qt-5/qfontmetrics.html#underlinePos">underlinePos</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#overlinePos">overlinePos</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#strikeOutPos">strikeOutPos</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineWidth">lineWidth</a>() functions, return the properties of the line that underlines, overlines or strikes out the characters. These functions are all fast.</p>
/// <p>There are also some functions that operate on the set of glyphs in the font: <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minLeftBearing">minLeftBearing</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minRightBearing">minRightBearing</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#maxWidth">maxWidth</a>(). These are by necessity slow, and we recommend avoiding them if possible.</p>
/// <p>For each character, you can get its <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#leftBearing">leftBearing</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#rightBearing">rightBearing</a>() and find out whether it is in the font using <a href="http://doc.qt.io/qt-5/qfontmetrics.html#inFont">inFont</a>(). You can also treat the character as a string, and use the string functions on it.</p>
/// <p>The string functions include <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>(), to return the width of a string in pixels (or points, for a printer), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>(), to return a rectangle large enough to contain the rendered string, and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#size">size</a>(), to return the size of that rectangle.</p>
/// <p>Example:</p>
/// <pre class="cpp">
/// <span class="type"><a href="http://doc.qt.io/qt-5/qfont.html">QFont</a></span> font(<span class="string">"times"</span><span class="operator">,</span> <span class="number">24</span>);
/// <span class="type"><a href="http://doc.qt.io/qt-5/qfontmetrics.html#QFontMetrics">QFontMetrics</a></span> fm(font);
/// <span class="type">int</span> pixelsWide <span class="operator">=</span> fm<span class="operator">.</span>width(<span class="string">"What's the width of this text?"</span>);
/// <span class="type">int</span> pixelsHigh <span class="operator">=</span> fm<span class="operator">.</span>height();
///
/// </pre></div>
#[repr(C)]
pub struct FontMetrics([u8; ::type_sizes::QT_GUI_FONT_METRICS_FONT_METRICS]);
impl ::cpp_utils::new_uninitialized::NewUninitialized for FontMetrics {
unsafe fn new_uninitialized() -> FontMetrics {
FontMetrics(::std::mem::uninitialized())
}
}
impl FontMetrics {
/// C++ method: <span style='color: green;'>```int QFontMetrics::ascent() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#ascent">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the ascent of the font.</p>
/// <p>The ascent of a font is the distance from the baseline to the highest position characters extend to. In practice, some font designers break this rule, e.g. when they put more than one accent on top of a character, or to accommodate an unusual character in an exotic language, so it is possible (though rare) that this value will be too small.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#descent">descent</a>().</p></div>
pub fn ascent(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_ascent(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::averageCharWidth() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#averageCharWidth">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the average width of glyphs in the font.</p>
/// <p>This function was introduced in Qt 4.2.</p></div>
pub fn average_char_width(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_averageCharWidth(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```QFontMetrics::boundingRect```</span>
///
/// This is an overloaded function. Available variants:
///
///
///
/// ## Variant 1
///
/// Rust arguments: ```fn bounding_rect(&self, &::qt_core::char::Char) -> ::qt_core::rect::Rect```<br>
/// C++ method: <span style='color: green;'>```QRect QFontMetrics::boundingRect(QChar arg1) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the rectangle that is covered by ink if character <i>ch</i> were to be drawn at the origin of the coordinate system.</p>
/// <p>Note that the bounding rectangle may extend to the left of (0, 0) (e.g., for italicized fonts), and that the text output may cover <i>all</i> pixels in the bounding rectangle. For a space character the rectangle will usually be empty.</p>
/// <p>Note that the rectangle usually extends both above and below the base line.</p>
/// <p><b>Warning:</b> The width of the returned rectangle is not the advance width of the character. Use boundingRect(const <a href="http://doc.qt.io/qt-5/qstring.html">QString</a> &) or <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>() instead.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>().</p></div>
///
/// ## Variant 2
///
/// Rust arguments: ```fn bounding_rect(&self, (&::qt_core::rect::Rect, ::libc::c_int, &::qt_core::string::String)) -> ::qt_core::rect::Rect```<br>
/// C++ method: <span style='color: green;'>```QRect QFontMetrics::boundingRect(const QRect& r, int flags, const QString& text) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect-2">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>This is an overloaded function.</p>
/// <p>Returns the bounding rectangle of the characters in the string specified by <i>text</i>, which is the set of pixels the text would cover if drawn at (0, 0). The drawing, and hence the bounding rectangle, is constrained to the rectangle <i>rect</i>.</p>
/// <p>The <i>flags</i> argument is the bitwise OR of the following flags:</p>
/// <ul>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignLeft</a> aligns to the left border, except for Arabic and Hebrew where it aligns to the right.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignRight</a> aligns to the right border, except for Arabic and Hebrew where it aligns to the left.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignJustify</a> produces justified text.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignHCenter</a> aligns horizontally centered.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignTop</a> aligns to the top border.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignBottom</a> aligns to the bottom border.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignVCenter</a> aligns vertically centered</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignCenter</a> (== <code>Qt::AlignHCenter | Qt::AlignVCenter</code>)</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextSingleLine</a> ignores newline characters in the text.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> expands tabs (see below)</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextShowMnemonic</a> interprets "&x" as <u>x</u>; i.e., underlined.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextWordWrap</a> breaks the text to fit the rectangle.</li>
/// </ul>
/// <p><a href="http://doc.qt.io/qt-5/qt.html#Orientation-enum">Qt::Horizontal</a> alignment defaults to <a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignLeft</a> and vertical alignment defaults to <a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignTop</a>.</p>
/// <p>If several of the horizontal or several of the vertical alignment flags are set, the resulting alignment is undefined.</p>
/// <p>If <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> is set in <i>flags</i>, then: if <i>tabArray</i> is non-null, it specifies a 0-terminated sequence of pixel-positions for tabs; otherwise if <i>tabStops</i> is non-zero, it is used as the tab spacing (in pixels).</p>
/// <p>Note that the bounding rectangle may extend to the left of (0, 0), e.g. for italicized fonts, and that the text output may cover <i>all</i> pixels in the bounding rectangle.</p>
/// <p>Newline characters are processed as linebreaks.</p>
/// <p>Despite the different actual character heights, the heights of the bounding rectangles of "Yes" and "yes" are the same.</p>
/// <p>The bounding rectangle returned by this function is somewhat larger than that calculated by the simpler <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>() function. This function uses the <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minLeftBearing">maximum left</a> and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minRightBearing">right</a> font bearings as is necessary for multi-line text to align correctly. Also, fontHeight() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineSpacing">lineSpacing</a>() are used to calculate the height, rather than individual character heights.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>(), <a href="http://doc.qt.io/qt-5/qpainter.html#boundingRect">QPainter::boundingRect</a>(), and <a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::Alignment</a>.</p></div>
///
/// ## Variant 3
///
/// Rust arguments: ```fn bounding_rect(&self, (&::qt_core::rect::Rect, ::libc::c_int, &::qt_core::string::String, ::libc::c_int)) -> ::qt_core::rect::Rect```<br>
/// C++ method: <span style='color: green;'>```QRect QFontMetrics::boundingRect(const QRect& r, int flags, const QString& text, int tabstops = ?) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect-2">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>This is an overloaded function.</p>
/// <p>Returns the bounding rectangle of the characters in the string specified by <i>text</i>, which is the set of pixels the text would cover if drawn at (0, 0). The drawing, and hence the bounding rectangle, is constrained to the rectangle <i>rect</i>.</p>
/// <p>The <i>flags</i> argument is the bitwise OR of the following flags:</p>
/// <ul>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignLeft</a> aligns to the left border, except for Arabic and Hebrew where it aligns to the right.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignRight</a> aligns to the right border, except for Arabic and Hebrew where it aligns to the left.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignJustify</a> produces justified text.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignHCenter</a> aligns horizontally centered.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignTop</a> aligns to the top border.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignBottom</a> aligns to the bottom border.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignVCenter</a> aligns vertically centered</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignCenter</a> (== <code>Qt::AlignHCenter | Qt::AlignVCenter</code>)</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextSingleLine</a> ignores newline characters in the text.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> expands tabs (see below)</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextShowMnemonic</a> interprets "&x" as <u>x</u>; i.e., underlined.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextWordWrap</a> breaks the text to fit the rectangle.</li>
/// </ul>
/// <p><a href="http://doc.qt.io/qt-5/qt.html#Orientation-enum">Qt::Horizontal</a> alignment defaults to <a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignLeft</a> and vertical alignment defaults to <a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignTop</a>.</p>
/// <p>If several of the horizontal or several of the vertical alignment flags are set, the resulting alignment is undefined.</p>
/// <p>If <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> is set in <i>flags</i>, then: if <i>tabArray</i> is non-null, it specifies a 0-terminated sequence of pixel-positions for tabs; otherwise if <i>tabStops</i> is non-zero, it is used as the tab spacing (in pixels).</p>
/// <p>Note that the bounding rectangle may extend to the left of (0, 0), e.g. for italicized fonts, and that the text output may cover <i>all</i> pixels in the bounding rectangle.</p>
/// <p>Newline characters are processed as linebreaks.</p>
/// <p>Despite the different actual character heights, the heights of the bounding rectangles of "Yes" and "yes" are the same.</p>
/// <p>The bounding rectangle returned by this function is somewhat larger than that calculated by the simpler <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>() function. This function uses the <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minLeftBearing">maximum left</a> and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minRightBearing">right</a> font bearings as is necessary for multi-line text to align correctly. Also, fontHeight() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineSpacing">lineSpacing</a>() are used to calculate the height, rather than individual character heights.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>(), <a href="http://doc.qt.io/qt-5/qpainter.html#boundingRect">QPainter::boundingRect</a>(), and <a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::Alignment</a>.</p></div>
///
/// ## Variant 4
///
/// Rust arguments: ```fn bounding_rect(&self, &::qt_core::string::String) -> ::qt_core::rect::Rect```<br>
/// C++ method: <span style='color: green;'>```QRect QFontMetrics::boundingRect(const QString& text) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect-1">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the bounding rectangle of the characters in the string specified by <i>text</i>. The bounding rectangle always covers at least the set of pixels the text would cover if drawn at (0, 0).</p>
/// <p>Note that the bounding rectangle may extend to the left of (0, 0), e.g. for italicized fonts, and that the width of the returned rectangle might be different than what the <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>() method returns.</p>
/// <p>If you want to know the advance width of the string (to lay out a set of strings next to each other), use <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>() instead.</p>
/// <p>Newline characters are processed as normal characters, <i>not</i> as linebreaks.</p>
/// <p>The height of the bounding rectangle is at least as large as the value returned by <a href="http://doc.qt.io/qt-5/qfontmetrics.html#height">height</a>().</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#height">height</a>(), <a href="http://doc.qt.io/qt-5/qpainter.html#boundingRect">QPainter::boundingRect</a>(), and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#tightBoundingRect">tightBoundingRect</a>().</p></div>
///
/// ## Variant 5
///
/// Rust arguments: ```fn bounding_rect(&self, (::libc::c_int, ::libc::c_int, ::libc::c_int, ::libc::c_int, ::libc::c_int, &::qt_core::string::String)) -> ::qt_core::rect::Rect```<br>
/// C++ method: <span style='color: green;'>```QRect QFontMetrics::boundingRect(int x, int y, int w, int h, int flags, const QString& text) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect-3">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>This is an overloaded function.</p>
/// <p>Returns the bounding rectangle for the given <i>text</i> within the rectangle specified by the <i>x</i> and <i>y</i> coordinates, <i>width</i>, and <i>height</i>.</p>
/// <p>If <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> is set in <i>flags</i> and <i>tabArray</i> is non-null, it specifies a 0-terminated sequence of pixel-positions for tabs; otherwise, if <i>tabStops</i> is non-zero, it is used as the tab spacing (in pixels).</p></div>
///
/// ## Variant 6
///
/// Rust arguments: ```fn bounding_rect(&self, (::libc::c_int, ::libc::c_int, ::libc::c_int, ::libc::c_int, ::libc::c_int, &::qt_core::string::String, ::libc::c_int)) -> ::qt_core::rect::Rect```<br>
/// C++ method: <span style='color: green;'>```QRect QFontMetrics::boundingRect(int x, int y, int w, int h, int flags, const QString& text, int tabstops = ?) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect-3">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>This is an overloaded function.</p>
/// <p>Returns the bounding rectangle for the given <i>text</i> within the rectangle specified by the <i>x</i> and <i>y</i> coordinates, <i>width</i>, and <i>height</i>.</p>
/// <p>If <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> is set in <i>flags</i> and <i>tabArray</i> is non-null, it specifies a 0-terminated sequence of pixel-positions for tabs; otherwise, if <i>tabStops</i> is non-zero, it is used as the tab spacing (in pixels).</p></div>
pub fn bounding_rect<'largs, Args>(&'largs self, args: Args) -> ::qt_core::rect::Rect
where Args: overloading::FontMetricsBoundingRectArgs<'largs>
{
args.exec(self)
}
/// C++ method: <span style='color: green;'>```QFontMetrics::boundingRect```</span>
///
/// This is an overloaded function. Available variants:
///
///
///
/// ## Variant 1
///
/// Rust arguments: ```fn bounding_rect_unsafe(&self, (&::qt_core::rect::Rect, ::libc::c_int, &::qt_core::string::String, ::libc::c_int, *mut ::libc::c_int)) -> ::qt_core::rect::Rect```<br>
/// C++ method: <span style='color: green;'>```QRect QFontMetrics::boundingRect(const QRect& r, int flags, const QString& text, int tabstops = ?, int* tabarray = ?) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect-2">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>This is an overloaded function.</p>
/// <p>Returns the bounding rectangle of the characters in the string specified by <i>text</i>, which is the set of pixels the text would cover if drawn at (0, 0). The drawing, and hence the bounding rectangle, is constrained to the rectangle <i>rect</i>.</p>
/// <p>The <i>flags</i> argument is the bitwise OR of the following flags:</p>
/// <ul>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignLeft</a> aligns to the left border, except for Arabic and Hebrew where it aligns to the right.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignRight</a> aligns to the right border, except for Arabic and Hebrew where it aligns to the left.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignJustify</a> produces justified text.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignHCenter</a> aligns horizontally centered.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignTop</a> aligns to the top border.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignBottom</a> aligns to the bottom border.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignVCenter</a> aligns vertically centered</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignCenter</a> (== <code>Qt::AlignHCenter | Qt::AlignVCenter</code>)</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextSingleLine</a> ignores newline characters in the text.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> expands tabs (see below)</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextShowMnemonic</a> interprets "&x" as <u>x</u>; i.e., underlined.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextWordWrap</a> breaks the text to fit the rectangle.</li>
/// </ul>
/// <p><a href="http://doc.qt.io/qt-5/qt.html#Orientation-enum">Qt::Horizontal</a> alignment defaults to <a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignLeft</a> and vertical alignment defaults to <a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::AlignTop</a>.</p>
/// <p>If several of the horizontal or several of the vertical alignment flags are set, the resulting alignment is undefined.</p>
/// <p>If <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> is set in <i>flags</i>, then: if <i>tabArray</i> is non-null, it specifies a 0-terminated sequence of pixel-positions for tabs; otherwise if <i>tabStops</i> is non-zero, it is used as the tab spacing (in pixels).</p>
/// <p>Note that the bounding rectangle may extend to the left of (0, 0), e.g. for italicized fonts, and that the text output may cover <i>all</i> pixels in the bounding rectangle.</p>
/// <p>Newline characters are processed as linebreaks.</p>
/// <p>Despite the different actual character heights, the heights of the bounding rectangles of "Yes" and "yes" are the same.</p>
/// <p>The bounding rectangle returned by this function is somewhat larger than that calculated by the simpler <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>() function. This function uses the <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minLeftBearing">maximum left</a> and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minRightBearing">right</a> font bearings as is necessary for multi-line text to align correctly. Also, fontHeight() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineSpacing">lineSpacing</a>() are used to calculate the height, rather than individual character heights.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>(), <a href="http://doc.qt.io/qt-5/qpainter.html#boundingRect">QPainter::boundingRect</a>(), and <a href="http://doc.qt.io/qt-5/qt.html#AlignmentFlag-enum">Qt::Alignment</a>.</p></div>
///
/// ## Variant 2
///
/// Rust arguments: ```fn bounding_rect_unsafe(&self, (::libc::c_int, ::libc::c_int, ::libc::c_int, ::libc::c_int, ::libc::c_int, &::qt_core::string::String, ::libc::c_int, *mut ::libc::c_int)) -> ::qt_core::rect::Rect```<br>
/// C++ method: <span style='color: green;'>```QRect QFontMetrics::boundingRect(int x, int y, int w, int h, int flags, const QString& text, int tabstops = ?, int* tabarray = ?) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect-3">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>This is an overloaded function.</p>
/// <p>Returns the bounding rectangle for the given <i>text</i> within the rectangle specified by the <i>x</i> and <i>y</i> coordinates, <i>width</i>, and <i>height</i>.</p>
/// <p>If <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> is set in <i>flags</i> and <i>tabArray</i> is non-null, it specifies a 0-terminated sequence of pixel-positions for tabs; otherwise, if <i>tabStops</i> is non-zero, it is used as the tab spacing (in pixels).</p></div>
pub unsafe fn bounding_rect_unsafe<'largs, Args>(&'largs self, args: Args) -> ::qt_core::rect::Rect
where Args: overloading::FontMetricsBoundingRectUnsafeArgs<'largs>
{
args.exec(self)
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::capHeight() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#capHeight">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the cap height of the font.</p>
/// <p>The cap height of a font is the height of a capital letter above the baseline. It specifically is the height of capital letters that are flat - such as H or I - as opposed to round letters such as O, or pointed letters like A, both of which may display overshoot.</p>
/// <p>This function was introduced in Qt 5.8.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#ascent">ascent</a>().</p></div>
pub fn cap_height(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_capHeight(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::charWidth(const QString& str, int pos) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics-obsolete.html#charWidth">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the width of the character at position <i>pos</i> in the string <i>text</i>.</p>
/// <p>The whole string is needed, as the glyph drawn may change depending on the context (the letter before and after the current one) for some languages (e.g. Arabic).</p>
/// <p>This function also takes non spacing marks and ligatures into account.</p></div>
pub fn char_width(&self, str: &::qt_core::string::String, pos: ::libc::c_int) -> ::libc::c_int {
unsafe {
::ffi::qt_gui_c_QFontMetrics_charWidth(self as *const ::font_metrics::FontMetrics,
str as *const ::qt_core::string::String,
pos)
}
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::descent() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#descent">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the descent of the font.</p>
/// <p>The descent is the distance from the base line to the lowest point characters extend to. In practice, some font designers break this rule, e.g. to accommodate an unusual character in an exotic language, so it is possible (though rare) that this value will be too small.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#ascent">ascent</a>().</p></div>
pub fn descent(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_descent(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```QFontMetrics::elidedText```</span>
///
/// This is an overloaded function. Available variants:
///
///
///
/// ## Variant 1
///
/// Rust arguments: ```fn elided_text(&self, (&::qt_core::string::String, ::qt_core::qt::TextElideMode, ::libc::c_int)) -> ::qt_core::string::String```<br>
/// C++ method: <span style='color: green;'>```QString QFontMetrics::elidedText(const QString& text, Qt::TextElideMode mode, int width) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#elidedText">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>If the string <i>text</i> is wider than <i>width</i>, returns an elided version of the string (i.e., a string with "..." in it). Otherwise, returns the original string.</p>
/// <p>The <i>mode</i> parameter specifies whether the text is elided on the left (e.g., "...tech"), in the middle (e.g., "Tr...ch"), or on the right (e.g., "Trol...").</p>
/// <p>The <i>width</i> is specified in pixels, not characters.</p>
/// <p>The <i>flags</i> argument is optional and currently only supports <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextShowMnemonic</a> as value.</p>
/// <p>The elide mark follows the <a href="http://doc.qt.io/qt-5/qt.html#LayoutDirection-enum">layoutdirection</a>. For example, it will be on the right side of the text for right-to-left layouts if the <i>mode</i> is <code>Qt::ElideLeft</code>, and on the left side of the text if the <i>mode</i> is <code>Qt::ElideRight</code>.</p>
/// <p>This function was introduced in Qt 4.2.</p></div>
///
/// ## Variant 2
///
/// Rust arguments: ```fn elided_text(&self, (&::qt_core::string::String, ::qt_core::qt::TextElideMode, ::libc::c_int, ::libc::c_int)) -> ::qt_core::string::String```<br>
/// C++ method: <span style='color: green;'>```QString QFontMetrics::elidedText(const QString& text, Qt::TextElideMode mode, int width, int flags = ?) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#elidedText">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>If the string <i>text</i> is wider than <i>width</i>, returns an elided version of the string (i.e., a string with "..." in it). Otherwise, returns the original string.</p>
/// <p>The <i>mode</i> parameter specifies whether the text is elided on the left (e.g., "...tech"), in the middle (e.g., "Tr...ch"), or on the right (e.g., "Trol...").</p>
/// <p>The <i>width</i> is specified in pixels, not characters.</p>
/// <p>The <i>flags</i> argument is optional and currently only supports <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextShowMnemonic</a> as value.</p>
/// <p>The elide mark follows the <a href="http://doc.qt.io/qt-5/qt.html#LayoutDirection-enum">layoutdirection</a>. For example, it will be on the right side of the text for right-to-left layouts if the <i>mode</i> is <code>Qt::ElideLeft</code>, and on the left side of the text if the <i>mode</i> is <code>Qt::ElideRight</code>.</p>
/// <p>This function was introduced in Qt 4.2.</p></div>
pub fn elided_text<'largs, Args>(&'largs self, args: Args) -> ::qt_core::string::String
where Args: overloading::FontMetricsElidedTextArgs<'largs>
{
args.exec(self)
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::height() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#height">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the height of the font.</p>
/// <p>This is always equal to <a href="http://doc.qt.io/qt-5/qfontmetrics.html#ascent">ascent</a>()+<a href="http://doc.qt.io/qt-5/qfontmetrics.html#descent">descent</a>().</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#leading">leading</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineSpacing">lineSpacing</a>().</p></div>
pub fn height(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_height(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```bool QFontMetrics::inFont(QChar arg1) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#inFont">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns <code>true</code> if character <i>ch</i> is a valid character in the font; otherwise returns <code>false</code>.</p></div>
pub fn in_font(&self, arg1: &::qt_core::char::Char) -> bool {
unsafe {
::ffi::qt_gui_c_QFontMetrics_inFont(self as *const ::font_metrics::FontMetrics,
arg1 as *const ::qt_core::char::Char)
}
}
/// C++ method: <span style='color: green;'>```bool QFontMetrics::inFontUcs4(unsigned int ucs4) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#inFontUcs4">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns <code>true</code> if the character <i>ucs4</i> encoded in UCS-4/UTF-32 is a valid character in the font; otherwise returns <code>false</code>.</p></div>
pub fn in_font_ucs4(&self, ucs4: ::libc::c_uint) -> bool {
unsafe { ::ffi::qt_gui_c_QFontMetrics_inFontUcs4(self as *const ::font_metrics::FontMetrics, ucs4) }
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::leading() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#leading">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the leading of the font.</p>
/// <p>This is the natural inter-line spacing.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#height">height</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineSpacing">lineSpacing</a>().</p></div>
pub fn leading(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_leading(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::leftBearing(QChar arg1) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#leftBearing">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the left bearing of character <i>ch</i> in the font.</p>
/// <p>The left bearing is the right-ward distance of the left-most pixel of the character from the logical origin of the character. This value is negative if the pixels of the character extend to the left of the logical origin.</p>
/// <p>See width(<a href="http://doc.qt.io/qt-5/qchar.html">QChar</a>) for a graphical description of this metric.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#rightBearing">rightBearing</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minLeftBearing">minLeftBearing</a>(), and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>().</p></div>
pub fn left_bearing(&self, arg1: &::qt_core::char::Char) -> ::libc::c_int {
unsafe {
::ffi::qt_gui_c_QFontMetrics_leftBearing(self as *const ::font_metrics::FontMetrics,
arg1 as *const ::qt_core::char::Char)
}
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::lineSpacing() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineSpacing">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the distance from one base line to the next.</p>
/// <p>This value is always equal to <a href="http://doc.qt.io/qt-5/qfontmetrics.html#leading">leading</a>()+<a href="http://doc.qt.io/qt-5/qfontmetrics.html#height">height</a>().</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#height">height</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#leading">leading</a>().</p></div>
pub fn line_spacing(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_lineSpacing(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::lineWidth() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineWidth">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the width of the underline and strikeout lines, adjusted for the point size of the font.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#underlinePos">underlinePos</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#overlinePos">overlinePos</a>(), and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#strikeOutPos">strikeOutPos</a>().</p></div>
pub fn line_width(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_lineWidth(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::maxWidth() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#maxWidth">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the width of the widest character in the font.</p></div>
pub fn max_width(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_maxWidth(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::minLeftBearing() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minLeftBearing">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the minimum left bearing of the font.</p>
/// <p>This is the smallest <a href="http://doc.qt.io/qt-5/qfontmetrics.html#leftBearing">leftBearing</a>(char) of all characters in the font.</p>
/// <p>Note that this function can be very slow if the font is large.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#minRightBearing">minRightBearing</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#leftBearing">leftBearing</a>().</p></div>
pub fn min_left_bearing(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_minLeftBearing(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::minRightBearing() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minRightBearing">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the minimum right bearing of the font.</p>
/// <p>This is the smallest <a href="http://doc.qt.io/qt-5/qfontmetrics.html#rightBearing">rightBearing</a>(char) of all characters in the font.</p>
/// <p>Note that this function can be very slow if the font is large.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#minLeftBearing">minLeftBearing</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#rightBearing">rightBearing</a>().</p></div>
pub fn min_right_bearing(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_minRightBearing(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```QFontMetrics::QFontMetrics```</span>
///
/// This is an overloaded function. Available variants:
///
///
///
/// ## Variant 1
///
/// Rust arguments: ```fn new(&::font::Font) -> ::font_metrics::FontMetrics```<br>
/// C++ method: <span style='color: green;'>```[constructor] void QFontMetrics::QFontMetrics(const QFont& arg1)```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#QFontMetrics">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Constructs a font metrics object for <i>font</i>.</p>
/// <p>The font metrics will be compatible with the paintdevice used to create <i>font</i>.</p>
/// <p>The font metrics object holds the information for the font that is passed in the constructor at the time it is created, and is not updated if the font's attributes are changed later.</p>
/// <p>Use <a href="http://doc.qt.io/qt-5/qfontmetrics.html">QFontMetrics</a>(const <a href="http://doc.qt.io/qt-5/qfont.html">QFont</a> &, <a href="http://doc.qt.io/qt-5/qpaintdevice.html">QPaintDevice</a> *) to get the font metrics that are compatible with a certain paint device.</p></div>
///
/// ## Variant 2
///
/// Rust arguments: ```fn new(&::font_metrics::FontMetrics) -> ::font_metrics::FontMetrics```<br>
/// C++ method: <span style='color: green;'>```[constructor] void QFontMetrics::QFontMetrics(const QFontMetrics& arg1)```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#QFontMetrics-2">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Constructs a copy of <i>fm</i>.</p></div>
pub fn new<Args>(args: Args) -> ::font_metrics::FontMetrics
where Args: overloading::FontMetricsNewArgs
{
args.exec()
}
/// C++ method: <span style='color: green;'>```[constructor] void QFontMetrics::QFontMetrics(const QFont& arg1, QPaintDevice* pd)```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#QFontMetrics-1">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Constructs a font metrics object for <i>font</i> and <i>paintdevice</i>.</p>
/// <p>The font metrics will be compatible with the paintdevice passed. If the <i>paintdevice</i> is 0, the metrics will be screen-compatible, ie. the metrics you get if you use the font for drawing text on a <a href="http://doc.qt.io/qt-5/qwidget.html">widgets</a> or <a href="http://doc.qt.io/qt-5/qpixmap.html">pixmaps</a>, not on a <a href="http://doc.qt.io/qt-5/qpicture.html">QPicture</a> or QPrinter.</p>
/// <p>The font metrics object holds the information for the font that is passed in the constructor at the time it is created, and is not updated if the font's attributes are changed later.</p></div>
pub unsafe fn new_unsafe(arg1: &::font::Font, pd: *mut ::paint_device::PaintDevice) -> ::font_metrics::FontMetrics {
{
let mut object: ::font_metrics::FontMetrics =
::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized();
::ffi::qt_gui_c_QFontMetrics_constructor_QFont_QPaintDevice(arg1 as *const ::font::Font, pd, &mut object);
object
}
}
/// C++ method: <span style='color: green;'>```QFontMetrics& QFontMetrics::operator=(const QFontMetrics& arg1)```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#operator-eq">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Assigns the font metrics <i>fm</i>.</p></div>
pub fn op_assign<'l0, 'l1>(&'l0 mut self,
arg1: &'l1 ::font_metrics::FontMetrics)
-> &'l0 mut ::font_metrics::FontMetrics {
let ffi_result = unsafe {
::ffi::qt_gui_c_QFontMetrics_operator_assign(self as *mut ::font_metrics::FontMetrics,
arg1 as *const ::font_metrics::FontMetrics)
};
unsafe { ffi_result.as_mut() }.expect("Attempted to convert null pointer to reference")
}
/// C++ method: <span style='color: green;'>```bool QFontMetrics::operator==(const QFontMetrics& other) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#operator-eq-eq">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns <code>true</code> if <i>other</i> is equal to this object; otherwise returns <code>false</code>.</p>
/// <p>Two font metrics are considered equal if they were constructed from the same <a href="http://doc.qt.io/qt-5/qfont.html">QFont</a> and the paint devices they were constructed for are considered compatible.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#operator-not-eq">operator!=</a>().</p></div>
pub fn op_eq(&self, other: &::font_metrics::FontMetrics) -> bool {
unsafe {
::ffi::qt_gui_c_QFontMetrics_operator_eq(self as *const ::font_metrics::FontMetrics,
other as *const ::font_metrics::FontMetrics)
}
}
/// C++ method: <span style='color: green;'>```bool QFontMetrics::operator!=(const QFontMetrics& other) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#operator-not-eq">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns <code>true</code> if <i>other</i> is not equal to this object; otherwise returns <code>false</code>.</p>
/// <p>Two font metrics are considered equal if they were constructed from the same <a href="http://doc.qt.io/qt-5/qfont.html">QFont</a> and the paint devices they were constructed for are considered compatible.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#operator-eq-eq">operator==</a>().</p></div>
pub fn op_neq(&self, other: &::font_metrics::FontMetrics) -> bool {
unsafe {
::ffi::qt_gui_c_QFontMetrics_operator_neq(self as *const ::font_metrics::FontMetrics,
other as *const ::font_metrics::FontMetrics)
}
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::overlinePos() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#overlinePos">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the distance from the base line to where an overline should be drawn.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#underlinePos">underlinePos</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#strikeOutPos">strikeOutPos</a>(), and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineWidth">lineWidth</a>().</p></div>
pub fn overline_pos(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_overlinePos(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::rightBearing(QChar arg1) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#rightBearing">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the right bearing of character <i>ch</i> in the font.</p>
/// <p>The right bearing is the left-ward distance of the right-most pixel of the character from the logical origin of a subsequent character. This value is negative if the pixels of the character extend to the right of the <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>() of the character.</p>
/// <p>See <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>() for a graphical description of this metric.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#leftBearing">leftBearing</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#minRightBearing">minRightBearing</a>(), and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>().</p></div>
pub fn right_bearing(&self, arg1: &::qt_core::char::Char) -> ::libc::c_int {
unsafe {
::ffi::qt_gui_c_QFontMetrics_rightBearing(self as *const ::font_metrics::FontMetrics,
arg1 as *const ::qt_core::char::Char)
}
}
/// C++ method: <span style='color: green;'>```QFontMetrics::size```</span>
///
/// This is an overloaded function. Available variants:
///
///
///
/// ## Variant 1
///
/// Rust arguments: ```fn size(&self, (::libc::c_int, &::qt_core::string::String)) -> ::qt_core::size::Size```<br>
/// C++ method: <span style='color: green;'>```QSize QFontMetrics::size(int flags, const QString& str) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#size">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the size in pixels of <i>text</i>.</p>
/// <p>The <i>flags</i> argument is the bitwise OR of the following flags:</p>
/// <ul>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextSingleLine</a> ignores newline characters.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> expands tabs (see below)</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextShowMnemonic</a> interprets "&x" as <u>x</u>; i.e., underlined.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextWordWrap</a> breaks the text to fit the rectangle.</li>
/// </ul>
/// <p>If <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> is set in <i>flags</i>, then: if <i>tabArray</i> is non-null, it specifies a 0-terminated sequence of pixel-positions for tabs; otherwise if <i>tabStops</i> is non-zero, it is used as the tab spacing (in pixels).</p>
/// <p>Newline characters are processed as linebreaks.</p>
/// <p>Despite the different actual character heights, the heights of the bounding rectangles of "Yes" and "yes" are the same.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>().</p></div>
///
/// ## Variant 2
///
/// Rust arguments: ```fn size(&self, (::libc::c_int, &::qt_core::string::String, ::libc::c_int)) -> ::qt_core::size::Size```<br>
/// C++ method: <span style='color: green;'>```QSize QFontMetrics::size(int flags, const QString& str, int tabstops = ?) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#size">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the size in pixels of <i>text</i>.</p>
/// <p>The <i>flags</i> argument is the bitwise OR of the following flags:</p>
/// <ul>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextSingleLine</a> ignores newline characters.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> expands tabs (see below)</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextShowMnemonic</a> interprets "&x" as <u>x</u>; i.e., underlined.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextWordWrap</a> breaks the text to fit the rectangle.</li>
/// </ul>
/// <p>If <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> is set in <i>flags</i>, then: if <i>tabArray</i> is non-null, it specifies a 0-terminated sequence of pixel-positions for tabs; otherwise if <i>tabStops</i> is non-zero, it is used as the tab spacing (in pixels).</p>
/// <p>Newline characters are processed as linebreaks.</p>
/// <p>Despite the different actual character heights, the heights of the bounding rectangles of "Yes" and "yes" are the same.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>().</p></div>
pub fn size<'largs, Args>(&'largs self, args: Args) -> ::qt_core::size::Size
where Args: overloading::FontMetricsSizeArgs<'largs>
{
args.exec(self)
}
/// C++ method: <span style='color: green;'>```QSize QFontMetrics::size(int flags, const QString& str, int tabstops = ?, int* tabarray = ?) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#size">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the size in pixels of <i>text</i>.</p>
/// <p>The <i>flags</i> argument is the bitwise OR of the following flags:</p>
/// <ul>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextSingleLine</a> ignores newline characters.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> expands tabs (see below)</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextShowMnemonic</a> interprets "&x" as <u>x</u>; i.e., underlined.</li>
/// <li><a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextWordWrap</a> breaks the text to fit the rectangle.</li>
/// </ul>
/// <p>If <a href="http://doc.qt.io/qt-5/qt.html#TextFlag-enum">Qt::TextExpandTabs</a> is set in <i>flags</i>, then: if <i>tabArray</i> is non-null, it specifies a 0-terminated sequence of pixel-positions for tabs; otherwise if <i>tabStops</i> is non-zero, it is used as the tab spacing (in pixels).</p>
/// <p>Newline characters are processed as linebreaks.</p>
/// <p>Despite the different actual character heights, the heights of the bounding rectangles of "Yes" and "yes" are the same.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>().</p></div>
pub unsafe fn size_unsafe(&self,
flags: ::libc::c_int,
str: &::qt_core::string::String,
tabstops: ::libc::c_int,
tabarray: *mut ::libc::c_int)
-> ::qt_core::size::Size {
{
let mut object: ::qt_core::size::Size = ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized();
::ffi::qt_gui_c_QFontMetrics_size_to_output_flags_str_tabstops_tabarray(self as *const ::font_metrics::FontMetrics, flags, str as *const ::qt_core::string::String, tabstops, tabarray, &mut object);
object
}
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::strikeOutPos() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#strikeOutPos">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the distance from the base line to where the strikeout line should be drawn.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#underlinePos">underlinePos</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#overlinePos">overlinePos</a>(), and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineWidth">lineWidth</a>().</p></div>
pub fn strike_out_pos(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_strikeOutPos(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```void QFontMetrics::swap(QFontMetrics& other)```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#swap">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Swaps this font metrics instance with <i>other</i>. This function is very fast and never fails.</p>
/// <p>This function was introduced in Qt 5.0.</p></div>
pub fn swap(&mut self, other: &mut ::font_metrics::FontMetrics) {
unsafe {
::ffi::qt_gui_c_QFontMetrics_swap(self as *mut ::font_metrics::FontMetrics,
other as *mut ::font_metrics::FontMetrics)
}
}
/// C++ method: <span style='color: green;'>```QRect QFontMetrics::tightBoundingRect(const QString& text) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#tightBoundingRect">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns a tight bounding rectangle around the characters in the string specified by <i>text</i>. The bounding rectangle always covers at least the set of pixels the text would cover if drawn at (0, 0).</p>
/// <p>Note that the bounding rectangle may extend to the left of (0, 0), e.g. for italicized fonts, and that the width of the returned rectangle might be different than what the <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>() method returns.</p>
/// <p>If you want to know the advance width of the string (to lay out a set of strings next to each other), use <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>() instead.</p>
/// <p>Newline characters are processed as normal characters, <i>not</i> as linebreaks.</p>
/// <p><b>Warning:</b> Calling this method is very slow on Windows.</p>
/// <p>This function was introduced in Qt 4.3.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#height">height</a>(), and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>().</p></div>
pub fn tight_bounding_rect(&self, text: &::qt_core::string::String) -> ::qt_core::rect::Rect {
{
let mut object: ::qt_core::rect::Rect =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_tightBoundingRect_to_output(self as *const ::font_metrics::FontMetrics,
text as *const ::qt_core::string::String,
&mut object);
}
object
}
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::underlinePos() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#underlinePos">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the distance from the base line to where an underscore should be drawn.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#overlinePos">overlinePos</a>(), <a href="http://doc.qt.io/qt-5/qfontmetrics.html#strikeOutPos">strikeOutPos</a>(), and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#lineWidth">lineWidth</a>().</p></div>
pub fn underline_pos(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_underlinePos(self as *const ::font_metrics::FontMetrics) }
}
/// C++ method: <span style='color: green;'>```QFontMetrics::width```</span>
///
/// This is an overloaded function. Available variants:
///
///
///
/// ## Variant 1
///
/// Rust arguments: ```fn width(&self, &::qt_core::char::Char) -> ::libc::c_int```<br>
/// C++ method: <span style='color: green;'>```int QFontMetrics::width(QChar arg1) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width-2">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>This is an overloaded function.</p>
/// <p class="centerAlign"><img src="http://doc.qt.io/qt-5/images/bearings.png" alt="Bearings"></img></p><p>Returns the logical width of character <i>ch</i> in pixels. This is a distance appropriate for drawing a subsequent character after <i>ch</i>.</p>
/// <p>Some of the metrics are described in the image to the right. The central dark rectangles cover the logical <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">width</a>() of each character. The outer pale rectangles cover the <a href="http://doc.qt.io/qt-5/qfontmetrics.html#leftBearing">leftBearing</a>() and <a href="http://doc.qt.io/qt-5/qfontmetrics.html#rightBearing">rightBearing</a>() of each character. Notice that the bearings of "f" in this particular font are both negative, while the bearings of "o" are both positive.</p>
/// <p><b>Warning:</b> This function will produce incorrect results for Arabic characters or non-spacing marks in the middle of a string, as the glyph shaping and positioning of marks that happens when processing strings cannot be taken into account. When implementing an interactive text control, use <a href="http://doc.qt.io/qt-5/qtextlayout.html">QTextLayout</a> instead.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>().</p></div>
///
/// ## Variant 2
///
/// Rust arguments: ```fn width(&self, &::qt_core::string::String) -> ::libc::c_int```<br>
/// C++ method: <span style='color: green;'>```int QFontMetrics::width(const QString& arg1) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the width in pixels of the first <i>len</i> characters of <i>text</i>. If <i>len</i> is negative (the default), the entire string is used.</p>
/// <p>Note that this value is <i>not</i> equal to <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>().width(); <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>() returns a rectangle describing the pixels this string will cover whereas width() returns the distance to where the next string should be drawn.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>().</p></div>
///
/// ## Variant 3
///
/// Rust arguments: ```fn width(&self, (&::qt_core::string::String, ::libc::c_int)) -> ::libc::c_int```<br>
/// C++ method: <span style='color: green;'>```int QFontMetrics::width(const QString& arg1, int len = ?) const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#width">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the width in pixels of the first <i>len</i> characters of <i>text</i>. If <i>len</i> is negative (the default), the entire string is used.</p>
/// <p>Note that this value is <i>not</i> equal to <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>().width(); <a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>() returns a rectangle describing the pixels this string will cover whereas width() returns the distance to where the next string should be drawn.</p>
/// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qfontmetrics.html#boundingRect">boundingRect</a>().</p></div>
///
/// ## Variant 4
///
/// Rust arguments: ```fn width(&self, (&::qt_core::string::String, ::libc::c_int, ::libc::c_int)) -> ::libc::c_int```<br>
/// C++ method: <span style='color: green;'>```int QFontMetrics::width(const QString& arg1, int len, int flags) const```</span>
///
///
pub fn width<'largs, Args>(&'largs self, args: Args) -> ::libc::c_int
where Args: overloading::FontMetricsWidthArgs<'largs>
{
args.exec(self)
}
/// C++ method: <span style='color: green;'>```int QFontMetrics::xHeight() const```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#xHeight">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the 'x' height of the font. This is often but not always the same as the height of the character 'x'.</p></div>
pub fn x_height(&self) -> ::libc::c_int {
unsafe { ::ffi::qt_gui_c_QFontMetrics_xHeight(self as *const ::font_metrics::FontMetrics) }
}
}
impl Drop for ::font_metrics::FontMetrics {
/// C++ method: <span style='color: green;'>```[destructor] void QFontMetrics::~QFontMetrics()```</span>
///
/// <a href="http://doc.qt.io/qt-5/qfontmetrics.html#dtor.QFontMetrics">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Destroys the font metrics object and frees all allocated resources.</p></div>
fn drop(&mut self) {
unsafe { ::ffi::qt_gui_c_QFontMetrics_destructor(self as *mut ::font_metrics::FontMetrics) }
}
}
/// C++ method: <span style='color: green;'>```swap```</span>
///
/// This is an overloaded function. Available variants:
///
///
///
/// ## Variant 1
///
/// Rust arguments: ```fn swap((&mut ::font_metrics::FontMetrics, &mut ::font_metrics::FontMetrics)) -> ()```<br>
/// C++ method: <span style='color: green;'>```void swap(QFontMetrics& value1, QFontMetrics& value2)```</span>
///
///
///
/// ## Variant 2
///
/// Rust arguments: ```fn swap((&mut ::font_metrics_f::FontMetricsF, &mut ::font_metrics_f::FontMetricsF)) -> ()```<br>
/// C++ method: <span style='color: green;'>```void swap(QFontMetricsF& value1, QFontMetricsF& value2)```</span>
///
///
pub fn swap<Args>(args: Args) -> ()
where Args: overloading::SwapArgs
{
args.exec()
}
/// Types for emulating overloading for overloaded functions in this module
pub mod overloading {
/// This trait represents a set of arguments accepted by [FontMetrics::bounding_rect](../struct.FontMetrics.html#method.bounding_rect) method.
pub trait FontMetricsBoundingRectArgs<'largs> {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect;
}
impl<'largs> FontMetricsBoundingRectArgs<'largs> for &'largs ::qt_core::char::Char {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect {
let arg1 = self;
{
let mut object: ::qt_core::rect::Rect =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_boundingRect_to_output_arg1(original_self as *const ::font_metrics::FontMetrics, arg1 as *const ::qt_core::char::Char, &mut object);
}
object
}
}
}
impl<'largs> FontMetricsBoundingRectArgs<'largs>
for (&'largs ::qt_core::rect::Rect, ::libc::c_int, &'largs ::qt_core::string::String) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect {
let r = self.0;
let flags = self.1;
let text = self.2;
{
let mut object: ::qt_core::rect::Rect =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_boundingRect_to_output_r_flags_text(original_self as *const ::font_metrics::FontMetrics, r as *const ::qt_core::rect::Rect, flags, text as *const ::qt_core::string::String, &mut object);
}
object
}
}
}
impl<'largs> FontMetricsBoundingRectArgs<'largs>
for (&'largs ::qt_core::rect::Rect, ::libc::c_int, &'largs ::qt_core::string::String, ::libc::c_int) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect {
let r = self.0;
let flags = self.1;
let text = self.2;
let tabstops = self.3;
{
let mut object: ::qt_core::rect::Rect =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_boundingRect_to_output_r_flags_text_tabstops(original_self as *const ::font_metrics::FontMetrics, r as *const ::qt_core::rect::Rect, flags, text as *const ::qt_core::string::String, tabstops, &mut object);
}
object
}
}
}
impl<'largs> FontMetricsBoundingRectArgs<'largs> for &'largs ::qt_core::string::String {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect {
let text = self;
{
let mut object: ::qt_core::rect::Rect =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_boundingRect_to_output_text(original_self as *const ::font_metrics::FontMetrics, text as *const ::qt_core::string::String, &mut object);
}
object
}
}
}
impl<'largs> FontMetricsBoundingRectArgs<'largs>
for (::libc::c_int, ::libc::c_int, ::libc::c_int, ::libc::c_int, ::libc::c_int, &'largs ::qt_core::string::String) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect {
let x = self.0;
let y = self.1;
let w = self.2;
let h = self.3;
let flags = self.4;
let text = self.5;
{
let mut object: ::qt_core::rect::Rect =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_boundingRect_to_output_x_y_w_h_flags_text(original_self as *const ::font_metrics::FontMetrics, x, y, w, h, flags, text as *const ::qt_core::string::String, &mut object);
}
object
}
}
}
impl<'largs> FontMetricsBoundingRectArgs<'largs>
for (::libc::c_int,
::libc::c_int,
::libc::c_int,
::libc::c_int,
::libc::c_int,
&'largs ::qt_core::string::String,
::libc::c_int) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect {
let x = self.0;
let y = self.1;
let w = self.2;
let h = self.3;
let flags = self.4;
let text = self.5;
let tabstops = self.6;
{
let mut object: ::qt_core::rect::Rect =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_boundingRect_to_output_x_y_w_h_flags_text_tabstops(original_self as *const ::font_metrics::FontMetrics, x, y, w, h, flags, text as *const ::qt_core::string::String, tabstops, &mut object);
}
object
}
}
}
/// This trait represents a set of arguments accepted by [FontMetrics::bounding_rect_unsafe](../struct.FontMetrics.html#method.bounding_rect_unsafe) method.
pub trait FontMetricsBoundingRectUnsafeArgs<'largs> {
unsafe fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect;
}
impl<'largs> FontMetricsBoundingRectUnsafeArgs<'largs>
for (&'largs ::qt_core::rect::Rect,
::libc::c_int,
&'largs ::qt_core::string::String,
::libc::c_int,
*mut ::libc::c_int) {
unsafe fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect {
let r = self.0;
let flags = self.1;
let text = self.2;
let tabstops = self.3;
let tabarray = self.4;
{
let mut object: ::qt_core::rect::Rect = ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized();
::ffi::qt_gui_c_QFontMetrics_boundingRect_to_output_r_flags_text_tabstops_tabarray(original_self as *const ::font_metrics::FontMetrics, r as *const ::qt_core::rect::Rect, flags, text as *const ::qt_core::string::String, tabstops, tabarray, &mut object);
object
}
}
}
impl<'largs> FontMetricsBoundingRectUnsafeArgs<'largs>
for (::libc::c_int,
::libc::c_int,
::libc::c_int,
::libc::c_int,
::libc::c_int,
&'largs ::qt_core::string::String,
::libc::c_int,
*mut ::libc::c_int) {
unsafe fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::rect::Rect {
let x = self.0;
let y = self.1;
let w = self.2;
let h = self.3;
let flags = self.4;
let text = self.5;
let tabstops = self.6;
let tabarray = self.7;
{
let mut object: ::qt_core::rect::Rect = ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized();
::ffi::qt_gui_c_QFontMetrics_boundingRect_to_output_x_y_w_h_flags_text_tabstops_tabarray(original_self as *const ::font_metrics::FontMetrics, x, y, w, h, flags, text as *const ::qt_core::string::String, tabstops, tabarray, &mut object);
object
}
}
}
/// This trait represents a set of arguments accepted by [FontMetrics::elided_text](../struct.FontMetrics.html#method.elided_text) method.
pub trait FontMetricsElidedTextArgs<'largs> {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::string::String;
}
impl<'largs> FontMetricsElidedTextArgs<'largs>
for (&'largs ::qt_core::string::String, ::qt_core::qt::TextElideMode, ::libc::c_int) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::string::String {
let text = self.0;
let mode = self.1;
let width = self.2;
{
let mut object: ::qt_core::string::String =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_elidedText_to_output_text_mode_width(original_self as *const ::font_metrics::FontMetrics, text as *const ::qt_core::string::String, mode, width, &mut object);
}
object
}
}
}
impl<'largs> FontMetricsElidedTextArgs<'largs>
for (&'largs ::qt_core::string::String, ::qt_core::qt::TextElideMode, ::libc::c_int, ::libc::c_int) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::string::String {
let text = self.0;
let mode = self.1;
let width = self.2;
let flags = self.3;
{
let mut object: ::qt_core::string::String =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_elidedText_to_output_text_mode_width_flags(original_self as *const ::font_metrics::FontMetrics, text as *const ::qt_core::string::String, mode, width, flags, &mut object);
}
object
}
}
}
/// This trait represents a set of arguments accepted by [FontMetrics::new](../struct.FontMetrics.html#method.new) method.
pub trait FontMetricsNewArgs {
fn exec(self) -> ::font_metrics::FontMetrics;
}
impl<'a> FontMetricsNewArgs for &'a ::font::Font {
fn exec(self) -> ::font_metrics::FontMetrics {
let arg1 = self;
{
let mut object: ::font_metrics::FontMetrics =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_constructor_QFont(arg1 as *const ::font::Font, &mut object);
}
object
}
}
}
impl<'a> FontMetricsNewArgs for &'a ::font_metrics::FontMetrics {
fn exec(self) -> ::font_metrics::FontMetrics {
let arg1 = self;
{
let mut object: ::font_metrics::FontMetrics =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_constructor_QFontMetrics(arg1 as *const ::font_metrics::FontMetrics,
&mut object);
}
object
}
}
}
/// This trait represents a set of arguments accepted by [FontMetrics::size](../struct.FontMetrics.html#method.size) method.
pub trait FontMetricsSizeArgs<'largs> {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::size::Size;
}
impl<'largs> FontMetricsSizeArgs<'largs> for (::libc::c_int, &'largs ::qt_core::string::String) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::size::Size {
let flags = self.0;
let str = self.1;
{
let mut object: ::qt_core::size::Size =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_size_to_output_flags_str(original_self as *const ::font_metrics::FontMetrics,
flags,
str as *const ::qt_core::string::String,
&mut object);
}
object
}
}
}
impl<'largs> FontMetricsSizeArgs<'largs> for (::libc::c_int, &'largs ::qt_core::string::String, ::libc::c_int) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::qt_core::size::Size {
let flags = self.0;
let str = self.1;
let tabstops = self.2;
{
let mut object: ::qt_core::size::Size =
unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
unsafe {
::ffi::qt_gui_c_QFontMetrics_size_to_output_flags_str_tabstops(original_self as *const ::font_metrics::FontMetrics, flags, str as *const ::qt_core::string::String, tabstops, &mut object);
}
object
}
}
}
/// This trait represents a set of arguments accepted by [FontMetrics::width](../struct.FontMetrics.html#method.width) method.
pub trait FontMetricsWidthArgs<'largs> {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::libc::c_int;
}
impl<'largs> FontMetricsWidthArgs<'largs> for &'largs ::qt_core::char::Char {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::libc::c_int {
let arg1 = self;
unsafe {
::ffi::qt_gui_c_QFontMetrics_width_QChar(original_self as *const ::font_metrics::FontMetrics,
arg1 as *const ::qt_core::char::Char)
}
}
}
impl<'largs> FontMetricsWidthArgs<'largs> for &'largs ::qt_core::string::String {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::libc::c_int {
let arg1 = self;
unsafe {
::ffi::qt_gui_c_QFontMetrics_width_QString(original_self as *const ::font_metrics::FontMetrics,
arg1 as *const ::qt_core::string::String)
}
}
}
impl<'largs> FontMetricsWidthArgs<'largs> for (&'largs ::qt_core::string::String, ::libc::c_int) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::libc::c_int {
let arg1 = self.0;
let len = self.1;
unsafe {
::ffi::qt_gui_c_QFontMetrics_width_QString_int(original_self as *const ::font_metrics::FontMetrics,
arg1 as *const ::qt_core::string::String,
len)
}
}
}
impl<'largs> FontMetricsWidthArgs<'largs> for (&'largs ::qt_core::string::String, ::libc::c_int, ::libc::c_int) {
fn exec(self, original_self: &'largs ::font_metrics::FontMetrics) -> ::libc::c_int {
let arg1 = self.0;
let len = self.1;
let flags = self.2;
unsafe {
::ffi::qt_gui_c_QFontMetrics_width_QString_int_int(original_self as *const ::font_metrics::FontMetrics,
arg1 as *const ::qt_core::string::String,
len,
flags)
}
}
}
/// This trait represents a set of arguments accepted by [swap](../fn.swap.html) method.
pub trait SwapArgs {
fn exec(self) -> ();
}
impl<'a> SwapArgs for (&'a mut ::font_metrics_f::FontMetricsF, &'a mut ::font_metrics_f::FontMetricsF) {
fn exec(self) -> () {
let value1 = self.0;
let value2 = self.1;
unsafe {
::ffi::qt_gui_c_QFontMetrics_G_swap_QFontMetricsF_QFontMetricsF(value1 as *mut ::font_metrics_f::FontMetricsF,
value2 as *mut ::font_metrics_f::FontMetricsF)
}
}
}
impl<'a> SwapArgs for (&'a mut ::font_metrics::FontMetrics, &'a mut ::font_metrics::FontMetrics) {
fn exec(self) -> () {
let value1 = self.0;
let value2 = self.1;
unsafe {
::ffi::qt_gui_c_QFontMetrics_G_swap_QFontMetrics_QFontMetrics(value1 as *mut ::font_metrics::FontMetrics,
value2 as *mut ::font_metrics::FontMetrics)
}
}
}
}