qfontmetrics.h

来自「pixil 最新的嵌入linux 應用程序集,別的地方很難下載」· C头文件 代码 · 共 35 行

H
35
字号
#ifndef __QFONTMETRICS_H#define __QFONTMETRICS_H#include "qfont.h"#include "fl_draw.H"class QFontMetrics{ protected:  QFont m_Font; public:  QFontMetrics() {}  QFontMetrics(const QFont & font) { m_Font = font; }  // int ascent() const { m_Font.SelectFont(); return height(); }  int ascent() const { m_Font.SelectFont(); return (fl_height() - fl_descent() - 1); } //davet  int descent() const     { m_Font.SelectFont(); return fl_descent(); }  int width(const QString & str, int len=-1)     {       m_Font.SelectFont();       if(len == -1)	return (int)fl_width((const char*)str);      else	return (int)fl_width((const char*)str,len);    }  int width(char c) const     { m_Font.SelectFont(); return (int)fl_width(c); }  int height() const     { m_Font.SelectFont(); return fl_height(); }};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?