diff options
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/formview.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/formview.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/formview.h b/SQLiteStudio3/guiSQLiteStudio/formview.h index 7f84e4f..c8f757a 100644 --- a/SQLiteStudio3/guiSQLiteStudio/formview.h +++ b/SQLiteStudio3/guiSQLiteStudio/formview.h @@ -2,32 +2,30 @@ #define FORMVIEW_H #include "guiSQLiteStudio_global.h" -#include "datagrid/sqlquerymodelcolumn.h" #include "multieditor/multieditor.h" +#include "common/extactioncontainer.h" #include <QWidget> #include <QPointer> #include <QScrollArea> -#include <common/extactioncontainer.h> class SqlQueryModel; class SqlQueryView; class DataWidgetMapper; CFG_KEY_LIST(FormView, QObject::tr("Data form view"), - CFG_KEY_ENTRY(COMMIT, Qt::CTRL + Qt::Key_Return, QObject::tr("Commit changes for current row")) - CFG_KEY_ENTRY(ROLLBACK, Qt::CTRL + Qt::Key_Backspace, QObject::tr("Rollback changes for current row")) - CFG_KEY_ENTRY(FIRST_ROW, Qt::CTRL + Qt::ALT + Qt::Key_PageUp, QObject::tr("Go to first row on current page")) - CFG_KEY_ENTRY(NEXT_ROW, Qt::CTRL + Qt::ALT + Qt::Key_Right, QObject::tr("Go to next row")) - CFG_KEY_ENTRY(PREV_ROW, Qt::CTRL + Qt::ALT + Qt::Key_Left, QObject::tr("Go to previous row")) - CFG_KEY_ENTRY(LAST_ROW, Qt::CTRL + Qt::ALT + Qt::Key_PageDown, QObject::tr("Go to last row on current page")) - CFG_KEY_ENTRY(INSERT_ROW, Qt::Key_Insert, QObject::tr("Insert new row")) - CFG_KEY_ENTRY(DELETE_ROW, Qt::CTRL + Qt::Key_Delete, QObject::tr("Delete current row")) + CFG_KEY_ENTRY(COMMIT, Qt::CTRL + Qt::Key_Return, QObject::tr("Commit changes for current row")) + CFG_KEY_ENTRY(ROLLBACK, Qt::ALT + Qt::SHIFT + Qt::Key_Backspace, QObject::tr("Rollback changes for current row")) + CFG_KEY_ENTRY(FIRST_ROW, Qt::CTRL + Qt::ALT + Qt::Key_PageUp, QObject::tr("Go to first row on current page")) + CFG_KEY_ENTRY(NEXT_ROW, Qt::CTRL + Qt::ALT + Qt::Key_Right, QObject::tr("Go to next row")) + CFG_KEY_ENTRY(PREV_ROW, Qt::CTRL + Qt::ALT + Qt::Key_Left, QObject::tr("Go to previous row")) + CFG_KEY_ENTRY(LAST_ROW, Qt::CTRL + Qt::ALT + Qt::Key_PageDown, QObject::tr("Go to last row on current page")) + CFG_KEY_ENTRY(INSERT_ROW, Qt::Key_Insert, QObject::tr("Insert new row")) + CFG_KEY_ENTRY(DELETE_ROW, Qt::CTRL + Qt::Key_Delete, QObject::tr("Delete current row")) ) class GUI_API_EXPORT FormView : public QScrollArea, public ExtActionContainer { Q_OBJECT - Q_ENUMS(Action) public: enum Action @@ -41,6 +39,7 @@ class GUI_API_EXPORT FormView : public QScrollArea, public ExtActionContainer INSERT_ROW, DELETE_ROW }; + Q_ENUM(Action) enum ToolBar { @@ -64,10 +63,11 @@ class GUI_API_EXPORT FormView : public QScrollArea, public ExtActionContainer void createActions(); void setupDefShortcuts(); QToolBar* getToolBar(int toolbar) const; + void showEvent(QShowEvent* event); private: void reloadInternal(); - void addColumn(int colIdx, const QString& name, const DataType& dataType, bool readOnly); + MultiEditor* addColumn(int colIdx, SqlQueryModelColumn* column); bool isCurrentRowModifiedInGrid(); void updateDeletedState(); @@ -84,6 +84,8 @@ class GUI_API_EXPORT FormView : public QScrollArea, public ExtActionContainer QList<bool> readOnly; bool valueModified = false; bool currentIndexUpdating = false; + bool shouldReload = false; + int indexForReload = 0; private slots: void dataLoaded(bool successful); |
