⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statisticsdialog.js

📁 QT4 gui programming的随书光盘
💻 JS
字号:
var obj = new Object;obj.text = "&Statistics...";obj.run = function() {    var text = this.textEdit.plainText;    this.dialog.frame.charCountLineEdit.text = text.length;    this.dialog.frame.wordCountLineEdit.text = this.wordCount(text);    this.dialog.frame.lineCountLineEdit.text = this.lineCount(text);    this.dialog.exec();};obj.wordCount = function(text) {    var regExp = new RegExp("\\w+", "g");    var count = 0;    while (regExp.exec(text))        ++count;    return count;};obj.lineCount = function(text) {    var count = 0;    var pos = 0;    while ((pos = text.indexOf("\n", pos)) != -1) {        ++count;        ++pos;    }    return count + 1;};return obj;

⌨️ 快捷键说明

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