mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
更新QQtDataPersistence,隐藏marker()函数
This commit is contained in:
parent
e55e68036d
commit
193c8eca75
@ -51,28 +51,9 @@ void QQtDataPersistence::start()
|
||||
|
||||
QQtDictionary& QQtDataPersistence::dictionary() { return mDict; }
|
||||
|
||||
void QQtDataPersistence::marker ()
|
||||
{
|
||||
bMarker = true;
|
||||
}
|
||||
|
||||
void QQtDataPersistence::reset_marker()
|
||||
{
|
||||
bMarker = false;
|
||||
}
|
||||
|
||||
bool QQtDataPersistence::setMarker ( bool mark )
|
||||
{
|
||||
bMarker = mark;
|
||||
}
|
||||
|
||||
bool QQtDataPersistence::getMarker() const
|
||||
{
|
||||
return bMarker;
|
||||
}
|
||||
|
||||
void QQtDataPersistence::stop()
|
||||
{
|
||||
marker();
|
||||
mLock.unlock();
|
||||
}
|
||||
|
||||
@ -190,3 +171,23 @@ void QQtDataPersistence::writeFile ( const QByteArray& bytes )
|
||||
file.write ( bytes );
|
||||
file.close();
|
||||
}
|
||||
|
||||
void QQtDataPersistence::marker ()
|
||||
{
|
||||
bMarker = true;
|
||||
}
|
||||
|
||||
void QQtDataPersistence::reset_marker()
|
||||
{
|
||||
bMarker = false;
|
||||
}
|
||||
|
||||
bool QQtDataPersistence::setMarker ( bool mark )
|
||||
{
|
||||
bMarker = mark;
|
||||
}
|
||||
|
||||
bool QQtDataPersistence::getMarker() const
|
||||
{
|
||||
return bMarker;
|
||||
}
|
||||
|
@ -81,21 +81,13 @@ public:
|
||||
//2! 操作
|
||||
QQtDictionary& dictionary();
|
||||
|
||||
/*设置标记*/
|
||||
void marker ();
|
||||
/*重置标记*/
|
||||
void reset_marker ();
|
||||
/*设置标记 default: true*/
|
||||
bool setMarker ( bool mark = true );
|
||||
/*获取标记 default: false*/
|
||||
bool getMarker() const;
|
||||
|
||||
//3! 关闭
|
||||
void stop();
|
||||
|
||||
//持久化数据保存周期 [default:1000ms]
|
||||
int timerInterval() const;
|
||||
void setTimerInterval ( int millSecond = 1000 );
|
||||
|
||||
private slots:
|
||||
void slotTimeOut();
|
||||
|
||||
@ -108,9 +100,20 @@ protected:
|
||||
virtual void writeFile ( const QByteArray& bytes );
|
||||
|
||||
private:
|
||||
|
||||
/*设置标记*/
|
||||
void marker ();
|
||||
/*重置标记*/
|
||||
void reset_marker ();
|
||||
/*设置标记 default: true*/
|
||||
bool setMarker ( bool mark = true );
|
||||
/*获取标记 default: false*/
|
||||
bool getMarker() const;
|
||||
|
||||
/*一个标记*/
|
||||
bool bMarker;
|
||||
|
||||
private:
|
||||
QReadWriteLock mLock;
|
||||
QQtDictionary mDict;
|
||||
|
||||
|
@ -67,7 +67,9 @@ void MainWindow::on_pushButton_clicked ( bool checked )
|
||||
handler.fromJson ( bytes );
|
||||
|
||||
//旁边的按钮更改了内部数据,又给改回去了,只好force write,marker()。
|
||||
dp0.marker();
|
||||
//dp0.marker();
|
||||
//QQtDataPersistence已经内部自动调用,用户正常操作数据即可。
|
||||
|
||||
dp0.stop();
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user