finddialog.ui.h

来自「commi-0.3.2版本,linux下串口程序的源代码,类似minicom」· C头文件 代码 · 共 63 行

H
63
字号
/****************************************************************************** ui.h extension file, included from the uic-generated form implementation.**** If you want to add, delete, or rename functions or slots, use** Qt Designer to update this file, preserving your code.**** You should not define a constructor or destructor in this file.** Instead, write your code in functions called init() and destroy().** These will automatically be called by the form's constructor and** destructor.*****************************************************************************/#include <iostream>using std::cerr; using std::endl;void findDialog::init() {   findfor->setChecked(true);}void findDialog::find(){    if(LEfind->text().length()<1) return;    QString text;    text = textB->text();    int strpos = 0;    if(findfor->isChecked()) {	strpos = text.find(LEfind->text(), lastpos, CB_casesense->isChecked());	lastpos=strpos+1;    }    else {	strpos = text.findRev(LEfind->text(), lastpos, CB_casesense->isChecked());	lastpos=strpos-1;    }    if(strpos==-1) {	QMessageBox::critical(this,tr("Search"), tr("Could not find \"%1\"").arg(LEfind->text()));	return;    }    int parag = 0;    for(int para=0; para<textB->paragraphs(); para++) {	if(textB->paragraphLength(para)<strpos) {	    strpos-=textB->paragraphLength(para);	    strpos--; // Paragraph char \n go away	    parag = para;	}	else break;    }    parag++;    textB->setSelection(parag, strpos, parag, strpos+LEfind->text().length(), 0);}void findDialog::find1(){    if(findfor->isChecked()) lastpos=0;    else lastpos=-1;find();}void findDialog::findnext(){find();}

⌨️ 快捷键说明

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