Introduced the MasterController as part of working on loading catalogue information.
Need a central piece to manage the catalogue data per database to prevent loading this multiple times. MasterController is now also used to enable reopening the connection manager from a query window after the connection manager has been closed.
This commit is contained in:
parent
b6d986051b
commit
6370050204
36 changed files with 769 additions and 71 deletions
52
typeselectionitemmodel.cpp
Normal file
52
typeselectionitemmodel.cpp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#include "typeselectionitemmodel.h"
|
||||
|
||||
TypeSelectionItemModel::TypeSelectionItemModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
int TypeSelectionItemModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
int result = 10;
|
||||
// if (!parent.isValid()) {
|
||||
|
||||
// }
|
||||
return result;
|
||||
}
|
||||
|
||||
int TypeSelectionItemModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
int result = 1;
|
||||
// if (parent.isValid())
|
||||
// result = 1;
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QVariant TypeSelectionItemModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
QVariant result;
|
||||
if (index.isValid()) {
|
||||
int row = index.row();
|
||||
int column = index.column();
|
||||
if (role == Qt::DisplayRole) {
|
||||
if (column == 0) {
|
||||
switch (row) {
|
||||
case 0: result = "integer"; break;
|
||||
case 1: result = "numeric"; break;
|
||||
case 2: result = "timestamp"; break;
|
||||
case 3: result = "timestamptz"; break;
|
||||
case 4: result = "float"; break;
|
||||
case 5: result = "double"; break;
|
||||
case 6: result = "date"; break;
|
||||
case 7: result = "varchar"; break;
|
||||
case 8: result = "varchar"; break;
|
||||
case 9: result = "varchar"; break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue