mirror of
https://github.com/fralx/LimeReport.git
synced 2025-01-11 17:18:10 +03:00
Insert item lock added
This commit is contained in:
parent
e8e3562be6
commit
c72014069f
@ -85,14 +85,6 @@ namespace Const{
|
|||||||
const QString VARIABLE_RX = "\\$V\\s*\\{\\s*([^{}]*)\\s*\\}";
|
const QString VARIABLE_RX = "\\$V\\s*\\{\\s*([^{}]*)\\s*\\}";
|
||||||
const QString NAMED_VARIABLE_RX = "\\$V\\s*\\{\\s*(%1)\\s*\\}";
|
const QString NAMED_VARIABLE_RX = "\\$V\\s*\\{\\s*(%1)\\s*\\}";
|
||||||
const QString SCRIPT_RX = "\\$S\\s*\\{(.*)\\}";
|
const QString SCRIPT_RX = "\\$S\\s*\\{(.*)\\}";
|
||||||
|
|
||||||
//const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*(((?:\\\"?\\$D\\s*\\{\\s*)|(?:\\\"?\\$V\\s*\\{\\s*)|(?:\\\"))(\\w+\\.?\\w+)((?:\\\")|(?:\\s*\\}\\\"?\\s*)))\\s*,\\s*\\\"(\\w+)\\\"\\s*\\)";
|
|
||||||
//const int DATASOURCE_INDEX = 6;
|
|
||||||
//const int VALUE_INDEX = 2;
|
|
||||||
|
|
||||||
//const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*(?:(?:((?:(?:\\\"?\\$D\\s*\\{\\s*)|(?:\\\"?\\$V\\s*\\{\\s*)|(?:\\\"?\\$S\\s*\\{\\s*)|(?:\\\"))((?:\\w+\\.?\\w+)|(?:\\w+))(?:(?:\\\")|(?:\\s*\\}\\\"?\\s*)))\\s*,)|(?:))\\s*\\\"(\\w+)\\\"\\s*\\)";
|
|
||||||
//const QString GROUP_FUNCTION_PARAM_RX = "\\((?:(.+),(.+))|(?:\\\"(\\w+)\\\")\\)";
|
|
||||||
//const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*(?:(?:(?:(?:\\\")|(?:))(\\w+)(?:(?:\\\")|(?:)))|(?:(?:(?:\\\")|(?:))(\\s*\\$\\w\\s*\\{.+\\}\\s*)(?:(?:\\\")|(?:))\\s*,\\s*(?:(?:\\\")|(?:))(\\w+)(?:(?:\\\")|(?:))))\\)";
|
|
||||||
const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*((?:(?:\\\")|(?:))(?:(?:\\$(?:(?:D\\{\\s*\\w*.\\w*\\s*\\})|(?:V\\{\\s*\\w*\\s*\\})|(?:S\\{.+\\})))|(?:\\w*))(?:(?:\\\")|(?:)))(?:(?:\\s*,\\s*(?:\\\"(\\w*)\\\"))|(?:))\\)";
|
const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*((?:(?:\\\")|(?:))(?:(?:\\$(?:(?:D\\{\\s*\\w*.\\w*\\s*\\})|(?:V\\{\\s*\\w*\\s*\\})|(?:S\\{.+\\})))|(?:\\w*))(?:(?:\\\")|(?:)))(?:(?:\\s*,\\s*(?:\\\"(\\w*)\\\"))|(?:))\\)";
|
||||||
const int DATASOURCE_INDEX = 3;//4;
|
const int DATASOURCE_INDEX = 3;//4;
|
||||||
const int VALUE_INDEX = 2; //2;
|
const int VALUE_INDEX = 2; //2;
|
||||||
|
@ -85,14 +85,6 @@ namespace Const{
|
|||||||
const QString VARIABLE_RX = "\\$V\\s*\\{\\s*([^{}]*)\\s*\\}";
|
const QString VARIABLE_RX = "\\$V\\s*\\{\\s*([^{}]*)\\s*\\}";
|
||||||
const QString NAMED_VARIABLE_RX = "\\$V\\s*\\{\\s*(%1)\\s*\\}";
|
const QString NAMED_VARIABLE_RX = "\\$V\\s*\\{\\s*(%1)\\s*\\}";
|
||||||
const QString SCRIPT_RX = "\\$S\\s*\\{(.*)\\}";
|
const QString SCRIPT_RX = "\\$S\\s*\\{(.*)\\}";
|
||||||
|
|
||||||
//const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*(((?:\\\"?\\$D\\s*\\{\\s*)|(?:\\\"?\\$V\\s*\\{\\s*)|(?:\\\"))(\\w+\\.?\\w+)((?:\\\")|(?:\\s*\\}\\\"?\\s*)))\\s*,\\s*\\\"(\\w+)\\\"\\s*\\)";
|
|
||||||
//const int DATASOURCE_INDEX = 6;
|
|
||||||
//const int VALUE_INDEX = 2;
|
|
||||||
|
|
||||||
//const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*(?:(?:((?:(?:\\\"?\\$D\\s*\\{\\s*)|(?:\\\"?\\$V\\s*\\{\\s*)|(?:\\\"?\\$S\\s*\\{\\s*)|(?:\\\"))((?:\\w+\\.?\\w+)|(?:\\w+))(?:(?:\\\")|(?:\\s*\\}\\\"?\\s*)))\\s*,)|(?:))\\s*\\\"(\\w+)\\\"\\s*\\)";
|
|
||||||
//const QString GROUP_FUNCTION_PARAM_RX = "\\((?:(.+),(.+))|(?:\\\"(\\w+)\\\")\\)";
|
|
||||||
//const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*(?:(?:(?:(?:\\\")|(?:))(\\w+)(?:(?:\\\")|(?:)))|(?:(?:(?:\\\")|(?:))(\\s*\\$\\w\\s*\\{.+\\}\\s*)(?:(?:\\\")|(?:))\\s*,\\s*(?:(?:\\\")|(?:))(\\w+)(?:(?:\\\")|(?:))))\\)";
|
|
||||||
const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*((?:(?:\\\")|(?:))(?:(?:\\$(?:(?:D\\{\\s*\\w*.\\w*\\s*\\})|(?:V\\{\\s*\\w*\\s*\\})|(?:S\\{.+\\})))|(?:\\w*))(?:(?:\\\")|(?:)))(?:(?:\\s*,\\s*(?:\\\"(\\w*)\\\"))|(?:))\\)";
|
const QString GROUP_FUNCTION_PARAM_RX = "\\(\\s*((?:(?:\\\")|(?:))(?:(?:\\$(?:(?:D\\{\\s*\\w*.\\w*\\s*\\})|(?:V\\{\\s*\\w*\\s*\\})|(?:S\\{.+\\})))|(?:\\w*))(?:(?:\\\")|(?:)))(?:(?:\\s*,\\s*(?:\\\"(\\w*)\\\"))|(?:))\\)";
|
||||||
const int DATASOURCE_INDEX = 3;//4;
|
const int DATASOURCE_INDEX = 3;//4;
|
||||||
const int VALUE_INDEX = 2; //2;
|
const int VALUE_INDEX = 2; //2;
|
||||||
|
@ -64,7 +64,7 @@ ReportDesignWindow* ReportDesignWindow::m_instance=0;
|
|||||||
|
|
||||||
ReportDesignWindow::ReportDesignWindow(ReportEngine *report, QWidget *parent, QSettings* settings) :
|
ReportDesignWindow::ReportDesignWindow(ReportEngine *report, QWidget *parent, QSettings* settings) :
|
||||||
QMainWindow(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
|
QMainWindow(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
|
||||||
m_progressDialog(0), m_showProgressDialog(true), m_editorTabType(ReportDesignWidget::Page)
|
m_progressDialog(0), m_showProgressDialog(true), m_editorTabType(ReportDesignWidget::Page), m_reportItemIsLocked(false)
|
||||||
{
|
{
|
||||||
initReportEditor(report);
|
initReportEditor(report);
|
||||||
createActions();
|
createActions();
|
||||||
@ -123,6 +123,7 @@ void ReportDesignWindow::createActions()
|
|||||||
m_editModeAction->setIcon(QIcon(":/report/images/editMode"));
|
m_editModeAction->setIcon(QIcon(":/report/images/editMode"));
|
||||||
m_editModeAction->setCheckable(true);
|
m_editModeAction->setCheckable(true);
|
||||||
m_editModeAction->setChecked(true);
|
m_editModeAction->setChecked(true);
|
||||||
|
m_editModeAction->setShortcut(QKeySequence(Qt::Key_Escape));
|
||||||
connect(m_editModeAction,SIGNAL(triggered()),this,SLOT(slotEditMode()));
|
connect(m_editModeAction,SIGNAL(triggered()),this,SLOT(slotEditMode()));
|
||||||
|
|
||||||
m_undoAction = new QAction(tr("Undo"),this);
|
m_undoAction = new QAction(tr("Undo"),this);
|
||||||
@ -888,6 +889,7 @@ void ReportDesignWindow::slotNewTextItem()
|
|||||||
{
|
{
|
||||||
if (m_newTextItemAction->isChecked()) {m_newTextItemAction->setCheckable(false);return;}
|
if (m_newTextItemAction->isChecked()) {m_newTextItemAction->setCheckable(false);return;}
|
||||||
if (m_reportDesignWidget) {
|
if (m_reportDesignWidget) {
|
||||||
|
m_reportItemIsLocked = QApplication::keyboardModifiers() == Qt::SHIFT;
|
||||||
m_reportDesignWidget->startInsertMode("TextItem");
|
m_reportDesignWidget->startInsertMode("TextItem");
|
||||||
m_newTextItemAction->setCheckable(true);
|
m_newTextItemAction->setCheckable(true);
|
||||||
m_newTextItemAction->setChecked(true);
|
m_newTextItemAction->setChecked(true);
|
||||||
@ -987,14 +989,19 @@ void ReportDesignWindow::slotInsertModeStarted()
|
|||||||
|
|
||||||
void ReportDesignWindow::slotItemInserted(PageDesignIntf *, QPointF, const QString &ItemType)
|
void ReportDesignWindow::slotItemInserted(PageDesignIntf *, QPointF, const QString &ItemType)
|
||||||
{
|
{
|
||||||
|
if (!m_reportItemIsLocked){
|
||||||
m_editModeAction->setChecked(true);
|
m_editModeAction->setChecked(true);
|
||||||
if (m_actionMap.value(ItemType))
|
if (m_actionMap.value(ItemType))
|
||||||
m_actionMap.value(ItemType)->setCheckable(false);
|
m_actionMap.value(ItemType)->setCheckable(false);
|
||||||
|
} else {
|
||||||
|
m_reportDesignWidget->startInsertMode(ItemType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::slotItemInsertCanceled(const QString &ItemType)
|
void ReportDesignWindow::slotItemInsertCanceled(const QString &ItemType)
|
||||||
{
|
{
|
||||||
m_editModeAction->setChecked(true);
|
m_editModeAction->setChecked(true);
|
||||||
|
m_reportItemIsLocked = false;
|
||||||
if (m_actionMap.value(ItemType))
|
if (m_actionMap.value(ItemType))
|
||||||
m_actionMap.value(ItemType)->setCheckable(false);
|
m_actionMap.value(ItemType)->setCheckable(false);
|
||||||
}
|
}
|
||||||
@ -1169,6 +1176,7 @@ void ReportDesignWindow::slotItemActionCliked()
|
|||||||
QAction* action=dynamic_cast<QAction*>(sender());
|
QAction* action=dynamic_cast<QAction*>(sender());
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
action->setChecked(true);
|
action->setChecked(true);
|
||||||
|
m_reportItemIsLocked = QApplication::keyboardModifiers() == Qt::SHIFT;
|
||||||
m_reportDesignWidget->startInsertMode(action->whatsThis());
|
m_reportDesignWidget->startInsertMode(action->whatsThis());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,6 +266,7 @@ private:
|
|||||||
QByteArray m_editorsStates[ReportDesignWidget::TabTypeCount];
|
QByteArray m_editorsStates[ReportDesignWidget::TabTypeCount];
|
||||||
QVector<QToolBar*> m_pageTools;
|
QVector<QToolBar*> m_pageTools;
|
||||||
QVector<QToolBar*> m_dialogTools;
|
QVector<QToolBar*> m_dialogTools;
|
||||||
|
bool m_reportItemIsLocked;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user