资源简介
用Qt实现的写字板,其中几乎实现了写字板的所有功能

代码片段和文件信息
#include “CFindDialog.h“
#include
#include
#include
CFindDialog::CFindDialog(QWidget *parent)
{
setupUi((QDialog*)this);
direction = true;
senstive = false;
textEdit = NULL;
found = false;
this->parent = parent;
belowRadioButton->setChecked(true);
replacePushBtn->setEnabled(false);
findNextPushBtn->setEnabled(false);
connect(findLineEdit1 SIGNAL(textChanged(const QString&))
this SLOT(doFindLineEditChanged(const QString&)));
connect(replacePushBtnSIGNAL(clicked()) this SLOT(replace()));
connect(cancelPushButton SIGNAL(clicked()) this SLOT(close()));
connect(findNextPushBtn SIGNAL(clicked()) this SLOT(doFind()));
connect(aboveRadioButton SIGNAL(clicked()) this SLOT(doClicked()));
connect(belowRadioButton SIGNAL(clicked()) this SLOT(doClicked()));
connect(senstiveCheckBox SIGNAL(clicked()) this SLOT(doClicked()));
}
bool CFindDialog::bolding(QTextEdit *textEdit)
{
if (textEdit == NULL)
{
QMessageBox::warning(this
“查找“
“请先新建文件“
QMessageBox::Yes);
this->close();
return false;
}
this->textEdit = textEdit;
return true;
}
void CFindDialog::doFindLineEditChanged(const QString &txt)
{
if (!txt.isEmpty())
{
findNextPushBtn->setEnabled(true);
}
else
{
findNextPushBtn->setEnabled(false);
}
}
void CFindDialog::doClicked()
{
QRadioButton* btn = qobject_cast(sender());
if (btn == aboveRadioButton)
{
direction = false;
}
else
{
direction = true;
}
}
void CFindDialog::doFind()
{
QTextDocument::FindFlags flag = 0;
if (!direction)
{
flag |= QTextDocument::FindBackward;
}
if (senstive)
{
flag |= QTextDocument::FindCaseSensitively;
}
QString findStr = findLineEdit1->text();
found = textEdit->find(findStr flag);
if (!found)
{
QMessageBox::information(this
“查找“
“查找完毕\n未找到相关信息“
QMessageBox::Ok);
replacePushBtn->setEnabled(false);
}
else
{
QMessageBox::information(this
“查找“
“已找到\n请用鼠标单击主窗口“
QMessageBox::Ok);
replacePushBtn->setEnabled(true);
}
}
void CFindDialog::replace()
{
QString findStr = findLineEdit1->text();
QString changeStr = changeLineEdit->text();
textEdit->insertPlainText(changeStr);
//qSwap(findStrchangeStr);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2455 2010-09-15 16:11 edit1\CFindDialog.cpp
文件 596 2010-09-15 11:13 edit1\CFindDialog.h
文件 13 2010-09-13 19:16 edit1\debug\111.txt
文件 234958 2010-09-15 16:11 edit1\debug\CFindDialog.o
文件 1186927 2010-09-16 08:40 edit1\debug\edit.exe
文件 183378 2010-09-16 08:38 edit1\debug\main.o
文件 484229 2010-09-16 08:40 edit1\debug\mainwindow.o
文件 2870 2010-09-15 11:13 edit1\debug\moc_CFindDialog.cpp
文件 197366 2010-09-15 11:13 edit1\debug\moc_CFindDialog.o
文件 4408 2010-09-16 08:38 edit1\debug\moc_mainwindow.cpp
文件 198792 2010-09-16 08:38 edit1\debug\moc_mainwindow.o
文件 115966 2010-09-15 09:47 edit1\debug\qrc_menu.cpp
文件 29380 2010-09-15 09:47 edit1\debug\qrc_menu.o
文件 304 2010-09-15 16:12 edit1\edit.pro
文件 10040 2010-09-16 08:41 edit1\edit.pro.user
文件 13812 2010-09-15 10:28 edit1\edit.pro.user.1.3
文件 5798 2010-09-15 10:03 edit1\FindDialog.ui
文件 1198 2007-11-15 19:56 edit1\images\asave.png
文件 1666 2007-11-15 19:56 edit1\images\copy.png
文件 1832 2007-11-15 19:56 edit1\images\cut.png
文件 1322 2007-11-15 19:56 edit1\images\editor.png
文件 1456 2010-02-11 23:55 edit1\images\fileprint.png
文件 2221 2007-11-15 19:56 edit1\images\find.png
文件 1413 2007-11-15 19:56 edit1\images\new.png
文件 2501 2007-11-15 19:56 edit1\images\open.png
文件 1981 2007-11-15 19:56 edit1\images\paste.png
文件 1633 2008-12-24 18:55 edit1\images\redo.png
文件 2194 2007-11-15 19:56 edit1\images\save.png
文件 23552 2010-09-13 15:31 edit1\images\Thumbs.db
文件 2017 2007-11-15 19:56 edit1\images\undo.png
............此处省略17个文件信息
相关资源
- Scratch源码
- 酒店管理系统基于Qt Creator5)
- E4A无障碍跨程序操作类库(带源码、
- 设备管理系统源码
- 安卓wifi直连app源码
- 我的世界源码(易语言版)
- labview编程软件滤波器以及编写程序设
- 我的界面(visual foxpro)源码
- 易语言:一键cf基址源码
- The Secret Path 3D 3D魔方迷宫[源码][scra
- scratch垃圾分类源码(最终版本).sb
- 安卓QQ6.71协议源码易语言,qq协议源码
- 编译原理实验工具及参考源码(lex&
- E盾偷后台工具源码
- UNIX/LINUX编程实践教程的源码
- dotnet 写字板 实验 源代码 不好请要不
- 十以内加减法练习 powerbuilder源码
- 农场开发项目
- OCR源码
- PLC上位机编程软件
- 用foobar2000听google音乐[更新一下]
- 学生信息管理系统源码
- vtk QT做的三维地质可视化系统2of2
- 用VC 编写的仿QQ聊天室程序源代码
- 毕业论文之温度传感器DS18B20(源码
- 可自定义导航网站源码
- 栅栏填充算法源码(VC)
- msp430F149操作红外接收模块源码
- Qt局域网聊天软件
- [免费]图像识别c 源码
评论
共有 条评论