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

📄 mainwindow.h

📁 porting scintilla to qt
💻 H
字号:
/******************************************************************************** Copyright (C) 2004-2006 Trolltech ASA. All rights reserved.**** This file is part of the example classes of the Qt Toolkit.**** Licensees holding a valid Qt License Agreement may use this file in** accordance with the rights, responsibilities and obligations** contained therein.  Please consult your licensing agreement or** contact sales@trolltech.com if any conditions of this licensing** agreement are not clear to you.**** Further information about Qt licensing is available at:** http://www.trolltech.com/products/qt/licensing.html or by** contacting info@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QtGui>#include <QTextCodec>#include <QMainWindow>#include <QTabWidget>#include <QList>#include "qsteeditor.h"#include "qsteproper.h"class QAction;class QMenu;class QsciScintilla;class MainWindow : public QMainWindow{    Q_OBJECTpublic:    MainWindow();public slots:    void newFile();protected:    void closeEvent(QCloseEvent *event);private slots:    void open();    bool save();    bool saveAs();	void closeFile();    void about();    void documentWasModified();	void setMarginsBackgroundColor();	void textListChange(QSteEditor *editor);	void textListChange(int index);	void textListRemove(QSteEditor *editro);	void textListRemove(const QString &text);	//water add	void copy();	void cut();	void paste();	void undo();	void redo();	void deletetext();	void selectall();	void inserttab();	void removetab();	//abbv	void insertabbv();	void expandabbv();	//comment	void boxcomment();	void streamcomment();	void blockcomment();	//match	void gotomatch();	void selectmatch();	//find & replace	void findorreplace();	int find(string str);	int replace(string str);	//print	void print();	void printview();	//margin linenum	void showline();	//fold & envole	void showfoldmargin();	void foldall();	//	void reload();private:    void createActions();    void createMenus();    void createToolBars();    void createStatusBar();    void readSettings();    void writeSettings();    bool maybeSave();    void loadFile(const QString &fileName);    bool saveFile(const QString &fileName);    void setCurrentFile(const QString &fileName);    QString strippedName(const QString &fullFileName);	QTextCodec *codec;	void findCodec();	QList<QTextCodec*> m_codeclist;	QTabWidget *tabwidget;    QSteEditor *textEdit;    QString curFile;	QSteGlobalProper *global;	QSteLexProper *lexer;    QMenu *fileMenu;    QMenu *editMenu;	QMenu *codingMenu;    QMenu *helpMenu;    QToolBar *fileToolBar;    QToolBar *editToolBar;    QAction *newAct;	QAction *closeAct;    QAction *openAct;    QAction *saveAct;    QAction *saveAsAct;    QAction *exitAct;    QAction *cutAct;    QAction *copyAct;    QAction *pasteAct;    QAction *undoAct;    QAction *redoAct;	QAction *deleteAct;	QAction *selectAllAct;    QAction *aboutAct;    QAction *aboutQtAct;	QAction *showlinnumAct;	QAction *showmarginAct;	QAction *blockcommentAct;	QAction *boxcommentAct;	QAction *setcolor;	QAction *tabAct;	QAction *untabAct;	//abbrev	QAction *insertAbbvAct;	QAction *expandAbbvAct;	//comment	QAction *blockAct;	QAction *streamAct;	QAction *boxAct;	//brace match	QAction *gotoMatchAct;	QAction *selectMatchAct;	//find & replace	QAction *findAct;	//print	QAction *printAct;	QAction *printViewAct;	//margin showlinenum	QAction *showLineAct;	//fold envole	QAction *showFoldMarginAct;	QAction *foldAllAct;};#include <QDialog>class QCheckBox;class QDialogButtonBox;class QGroupBox;class QLabel;class QLineEdit;class QPushButton;class FindDialog : public QDialog{Q_OBJECTpublic:	FindDialog(QWidget *parent = 0);signals:	void findStr(string);	void replaceStr(string);private slots:	void find();	void replace();private:	QLabel *label;	QLineEdit *lineEdit;	QLabel *replaceLabel;	QLineEdit *replaceEdit;	QCheckBox *caseCheckBox;	QCheckBox *fromStartCheckBox;	QCheckBox *wholeWordsCheckBox;	QCheckBox *searchSelectionCheckBox;	QCheckBox *backwardCheckBox;	QDialogButtonBox *buttonBox;	QPushButton *findButton;	QPushButton *replaceButton;	QPushButton *moreButton;	QWidget *extension;};#endif

⌨️ 快捷键说明

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