删除乱码注释
This commit is contained in:
parent
46f5398d30
commit
5b6c7d2355
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.15.0, 2024-02-14T16:20:06. -->
|
||||
<!-- Written by QtCreator 4.15.0, 2024-02-18T21:01:27. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
@ -234,152 +234,15 @@
|
|||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
|
||||
<value type="QString">-e</value>
|
||||
<value type="QString">cpu-cycles</value>
|
||||
<value type="QString">--call-graph</value>
|
||||
<value type="QString">dwarf,4096</value>
|
||||
<value type="QString">-F</value>
|
||||
<value type="QString">250</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="QString" key="Analyzer.Valgrind.Callgrind.Arguments"></value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.Memcheck.Arguments"></value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindArguments"></value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/Projects/Cpp/QtNovelDesc/u_test/u_test.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">D:/Projects/Cpp/QtNovelDesc/u_test/u_test.pro</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug/u_test</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
|
||||
<value type="QString">-e</value>
|
||||
<value type="QString">cpu-cycles</value>
|
||||
<value type="QString">--call-graph</value>
|
||||
<value type="QString">dwarf,4096</value>
|
||||
<value type="QString">-F</value>
|
||||
<value type="QString">250</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="QString" key="Analyzer.Valgrind.Callgrind.Arguments"></value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.Memcheck.Arguments"></value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindArguments"></value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/Projects/Cpp/QtNovelDesc/WordsIDE/WordsIDE.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">D:/Projects/Cpp/QtNovelDesc/WordsIDE/WordsIDE.pro</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/Projects/Cpp/build-QtNovelDesc-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug/WordsIDE</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
|
|
|
@ -1 +1 @@
|
|||
#include "text_model.h"
|
||||
#include "text_modelx.h"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
namespace text_model
|
||||
{
|
||||
// 涓枃鍐呭
|
||||
|
||||
}
|
||||
|
||||
#endif // TEXT_MODELX_H
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
namespace model_text {
|
||||
typedef QList<uint32_t> CharStream;
|
||||
|
||||
/**
|
||||
* @brief UTF-16瀛楃闆嗛殣鍠 */
|
||||
class LIBTEXTEDIT_EXPORT CharSetU16 {
|
||||
public:
|
||||
static CharStream combineToU(const QString &buffer);
|
||||
|
@ -20,9 +18,6 @@ namespace model_text {
|
|||
static uint size();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 璁剧疆鍗曚釜瀛楃鐨勬牸寮忥紝榛樿浠庡乏鍒板彸鎺掑竷
|
||||
*/
|
||||
class LIBTEXTEDIT_EXPORT CharFormat {
|
||||
private:
|
||||
qulonglong unique_id;
|
||||
|
@ -66,9 +61,7 @@ namespace model_text {
|
|||
bool operator==(const CharFormat &other);
|
||||
CharFormat &operator=(const CharFormat &other);
|
||||
};
|
||||
/**
|
||||
* @brief 瀹氫箟鏂囨。鏍煎紡锛岄粯璁ゆ帓甯冧粠宸﹀埌鍙筹紝浠庝笂鍒颁笅
|
||||
*/
|
||||
|
||||
class LIBTEXTEDIT_EXPORT DocFormat {
|
||||
private:
|
||||
std::shared_ptr<CharFormat> char_format;
|
||||
|
@ -111,48 +104,22 @@ namespace model_text {
|
|||
virtual void refer(std::weak_ptr<WsBlock> ptr) = 0;
|
||||
virtual std::weak_ptr<WsBlock> blockRefer() const = 0;
|
||||
|
||||
/**
|
||||
* @brief 鑾峰彇鍏冪礌鎵€鍦ㄧ殑娈佃惤绱㈠紩
|
||||
* @return
|
||||
*/
|
||||
virtual uint32_t blockIndex() const = 0;
|
||||
|
||||
/**
|
||||
* @brief 鍏冪礌缁戝畾瀛楃鏍煎紡
|
||||
* @return
|
||||
*/
|
||||
virtual std::shared_ptr<CharFormat> getFormat() const = 0;
|
||||
/**
|
||||
* @brief 缁戝畾瀛楃鏍煎紡
|
||||
* @param format
|
||||
*/
|
||||
|
||||
virtual void bindFormat(std::shared_ptr<CharFormat> format) = 0;
|
||||
|
||||
/**
|
||||
* @brief 鍏冪礌绫诲瀷
|
||||
* @return
|
||||
*/
|
||||
virtual Type type() const = 0;
|
||||
/**
|
||||
* @brief 鏂囨。灞傛鍐咃紝鍏ㄥ眬璧峰绱㈠紩
|
||||
* @return
|
||||
*/
|
||||
|
||||
virtual uint32_t index() const = 0;
|
||||
/**
|
||||
* @brief 鑾峰彇鏂囨湰鍐呭琛ㄧず
|
||||
* @return
|
||||
*/
|
||||
|
||||
virtual QString toText() const = 0;
|
||||
/**
|
||||
* @brief 瀛愬厓绱犳暟閲 * @return
|
||||
*/
|
||||
|
||||
virtual uint32_t childCount() const = 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief 鍗曚釜瀛楃鍐呭瓨妯″瀷
|
||||
*/
|
||||
class LIBTEXTEDIT_EXPORT WsChar : public Element {
|
||||
private:
|
||||
uint32_t code_store;
|
||||
|
@ -180,68 +147,28 @@ namespace model_text {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief 鏂囧瓧鐗囨鍐呭瓨妯″瀷
|
||||
*/
|
||||
class LIBTEXTEDIT_EXPORT WsPart : public Element {
|
||||
public:
|
||||
/**
|
||||
* @brief 鎻掑叆鏂囨湰鐗囨
|
||||
* @param text 鏂囨湰鍐呭
|
||||
* @param index
|
||||
*/
|
||||
|
||||
void insertChars(const QList<WsChar*> &text, uint32_t offset = -1);
|
||||
/**
|
||||
* @brief 鑾峰彇鏂囨湰鐗囨鍐呭
|
||||
* @param offset 璧峰绱㈠紩
|
||||
* @param count 鏁伴噺
|
||||
* @return
|
||||
*/
|
||||
|
||||
QList<WsChar*> getChars(uint32_t offset, uint32_t count) const;
|
||||
/**
|
||||
* @brief 鍒犻櫎鏂囨湰鐗囨鍐呭
|
||||
* @param offset
|
||||
* @param count
|
||||
*/
|
||||
|
||||
void delChars(uint32_t offset, uint32_t count);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 鏂囨。鍧楋紙娈佃惤锛夊厓绱犲唴瀛樺疄渚 */
|
||||
class LIBTEXTEDIT_EXPORT WsBlock {
|
||||
private:
|
||||
QList<Element*> element_store;
|
||||
|
||||
public:
|
||||
uint32_t blockIndex() const;
|
||||
/**
|
||||
* @brief 鎻掑叆鍏冪礌闆嗗悎
|
||||
* @param text 鏂囨湰鍐呭
|
||||
* @param index
|
||||
*/
|
||||
void addElements(const QList<Element*> &text, uint32_t offset = UINT32_MAX);
|
||||
/**
|
||||
* @brief 鑾峰彇鏂囨湰鐗囨鍐呭
|
||||
* @param offset
|
||||
* @param count
|
||||
* @return
|
||||
*/
|
||||
QList<Element*> getElements(uint32_t offset, uint32_t count) const;
|
||||
/**
|
||||
* @brief 鍒犻櫎鏂囨湰鐗囨鍐呭
|
||||
* @param offset
|
||||
* @param count
|
||||
*/
|
||||
void delElements(uint32_t offset, uint32_t count);
|
||||
/**
|
||||
* @brief 鑾峰彇娈佃惤鐨勬枃鏈〃绀 * @return
|
||||
*/
|
||||
QString toText() const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 鏂囨。鍐呭瓨瀹炰緥
|
||||
*/
|
||||
class LIBTEXTEDIT_EXPORT WsDocument : public QObject {
|
||||
Q_OBJECT
|
||||
private:
|
||||
|
@ -249,86 +176,27 @@ namespace model_text {
|
|||
QList<std::shared_ptr<WsBlock>> block_store;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief 缁戝畾鏂囨。鏍煎紡
|
||||
* @param f
|
||||
*/
|
||||
void bindFormat(std::shared_ptr<DocFormat> f);
|
||||
/**
|
||||
* @brief 鑾峰彇鏂囨。鏍煎紡
|
||||
* @return
|
||||
*/
|
||||
std::shared_ptr<DocFormat> getFormat() const;
|
||||
|
||||
// 鍐呭瓨鏂囨。缁撴瀯鎺ュ彛 ===================================================
|
||||
/**
|
||||
* @brief 鎻掑叆娈佃惤
|
||||
* @param blks
|
||||
* @param offset
|
||||
*/
|
||||
void addBlocks(const QList<std::shared_ptr<WsBlock>> &blks, uint32_t offset = UINT32_MAX);
|
||||
/**
|
||||
* @brief 娈佃惤鏁伴噺
|
||||
* @return
|
||||
*/
|
||||
uint32_t blockCount() const;
|
||||
/**
|
||||
* @brief 鑾峰彇娈佃惤寮曠敤
|
||||
* @param offset
|
||||
* @param count
|
||||
* @return
|
||||
*/
|
||||
QList<std::shared_ptr<WsBlock>> getBlocks(uint32_t offset, uint32_t count = 1) const;
|
||||
/**
|
||||
* @brief 鍒犻櫎鎸囧畾鑼冨洿鍐呯殑娈佃惤
|
||||
* @param offset 璧峰绱㈠紩
|
||||
* @param count 娈佃惤鏁伴噺
|
||||
*/
|
||||
void delBlocks(uint32_t offset, uint32_t count = 1);
|
||||
|
||||
// // 鍐呭瓨鏂囨湰鎿嶄綔鎺ュ彛 ===================================================
|
||||
// /**
|
||||
// * @brief 鎸囧畾浣嶇疆鎻掑叆鏂囨湰
|
||||
// * @param part 鏂囨湰鐗囨
|
||||
// * @param index 璧峰绱㈠紩锛宨ndex<0琛ㄧず杩藉姞
|
||||
// */
|
||||
// void insertText(QList<WsChar> part, uint32_t index = -1);
|
||||
// /**
|
||||
// * @brief 鑾峰彇鎸囧畾浣嶇疆鐨勬枃鏈 // * @param index 璧峰绱㈠紩
|
||||
// * @param count 鏂囨湰鏁伴噺
|
||||
// * @return
|
||||
// */
|
||||
// QList<WsChar> getText(uint32_t index, uint32_t count);
|
||||
// /**
|
||||
// * @brief 鍒犻櫎鎸囧畾浣嶇疆鐨勬枃鏈 // * @param index 璧峰绱㈠紩锛岃秴鍑烘湁鏁堣寖鍥存墽琛屾棤鏁堟灉
|
||||
// * @param count 鍒犻櫎鏁伴噺
|
||||
// */
|
||||
// void delText(uint32_t index, uint32_t count);
|
||||
|
||||
// // 閫夋嫨鎿嶄綔鎺ュ彛 ======================================================
|
||||
// void select(uint32_t index, uint32_t count);
|
||||
|
||||
// 鍐呭瓨鏂囨湰瀛樺彇鎺ュ彛 ===================================================
|
||||
QString toPlainText() const;
|
||||
void setPlainText(const QString &text);
|
||||
|
||||
// signals:
|
||||
// void blockHasbeenInserted(uint32_t index);
|
||||
// /**
|
||||
// * @brief 鐗囨灏嗚琚垹闄 // * @param index
|
||||
// */
|
||||
// void blockAboutTobeDelete(uint32_t index);
|
||||
// /**
|
||||
// * @brief 鐗囨宸茬粡琚慨鏀 // * @param index
|
||||
// */
|
||||
// void blockHasbeenChanged(uint32_t index);
|
||||
|
||||
// void redoAvaliable();
|
||||
// void undoAvaliable();
|
||||
// /**
|
||||
// * @brief 鍏夋爣浣嶇疆宸茬粡鍙樺寲
|
||||
// * @param index 鍏夋爣浣嶇疆
|
||||
// */
|
||||
// void cursorPosChanged(uint32_t index);
|
||||
// void selectionChanged(uint32_t index, uint32_t count);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue