mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-23 20:22:58 +03:00
Some additional datasource management functions have been added
This commit is contained in:
parent
75878b97a9
commit
22dd686470
@ -1797,12 +1797,28 @@ QObject* ComboBoxWrapperCreator::createWrapper(QObject *item)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool DatasourceFunctions::first(const QString& datasourceName)
|
||||
{
|
||||
if (m_dataManager && m_dataManager->dataSource(datasourceName)){
|
||||
m_dataManager->dataSource(datasourceName)->first();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DatasourceFunctions::next(const QString &datasourceName){
|
||||
if (m_dataManager && m_dataManager->dataSource(datasourceName))
|
||||
return m_dataManager->dataSource(datasourceName)->next();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DatasourceFunctions::prior(const QString& datasourceName)
|
||||
{
|
||||
if (m_dataManager && m_dataManager->dataSource(datasourceName))
|
||||
return m_dataManager->dataSource(datasourceName)->prior();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DatasourceFunctions::isEOF(const QString &datasourceName)
|
||||
{
|
||||
if (m_dataManager && m_dataManager->dataSource(datasourceName))
|
||||
@ -1810,6 +1826,14 @@ bool DatasourceFunctions::isEOF(const QString &datasourceName)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DatasourceFunctions::invalidate(const QString& datasourceName)
|
||||
{
|
||||
if (m_dataManager && m_dataManager->dataSource(datasourceName)){
|
||||
m_dataManager->dataSourceHolder(datasourceName)->invalidate(IDataSource::DatasourceMode::RENDER_MODE);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef USE_QJSENGINE
|
||||
void ComboBoxPrototype::addItem(const QString &text)
|
||||
|
@ -302,8 +302,12 @@ class DatasourceFunctions : public QObject{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DatasourceFunctions(IDataSourceManager* dataManager): m_dataManager(dataManager){}
|
||||
Q_INVOKABLE bool first(const QString& datasourceName);
|
||||
Q_INVOKABLE bool next(const QString& datasourceName);
|
||||
Q_INVOKABLE bool prior(const QString& datasourceName);
|
||||
Q_INVOKABLE bool isEOF(const QString& datasourceName);
|
||||
Q_INVOKABLE bool invalidate(const QString& datasourceName);
|
||||
|
||||
private:
|
||||
IDataSourceManager* m_dataManager;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user