英文输入限制加入‘_’的支持
This commit is contained in:
parent
753a4a9e0c
commit
bbae749216
|
|
@ -12,6 +12,9 @@ QT_END_NAMESPACE
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class AttributeView;
|
class AttributeView;
|
||||||
|
class AttributeTableModel;
|
||||||
|
class AttributeTableDelegate;
|
||||||
|
|
||||||
class AttributeSelector : public QWidget
|
class AttributeSelector : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -30,6 +33,8 @@ private:
|
||||||
Ui::AttributeSelector *ui;
|
Ui::AttributeSelector *ui;
|
||||||
MainWindow* m_pMainWindow;
|
MainWindow* m_pMainWindow;
|
||||||
AttributeView* m_attributeView;
|
AttributeView* m_attributeView;
|
||||||
|
AttributeTableModel* m_attributeTableModel;
|
||||||
|
AttributeTableDelegate* m_attributeTableDelegate;
|
||||||
QString m_connection;
|
QString m_connection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="img">
|
<qresource prefix="img">
|
||||||
|
<file>images/icon_multiple-choice.png</file>
|
||||||
|
<file>images/icon_multiple-choice_disable.png</file>
|
||||||
<file>images/icon_hierarchy_unchecked.png</file>
|
<file>images/icon_hierarchy_unchecked.png</file>
|
||||||
<file>images/icon_hierarchy_disable.png</file>
|
<file>images/icon_hierarchy_disable.png</file>
|
||||||
<file>images/icon_search_white.png</file>
|
<file>images/icon_search_white.png</file>
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 142 B |
Binary file not shown.
|
After Width: | Height: | Size: 332 B |
Binary file not shown.
|
After Width: | Height: | Size: 149 B |
Binary file not shown.
|
After Width: | Height: | Size: 391 B |
|
|
@ -2,6 +2,8 @@
|
||||||
#include "ui_attributeSelector.h"
|
#include "ui_attributeSelector.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "attributeView.h"
|
#include "attributeView.h"
|
||||||
|
#include "attributeTableModel.h"
|
||||||
|
#include "attributeTableDelegate.h"
|
||||||
|
|
||||||
AttributeSelector::AttributeSelector(const QString& connection, QWidget *parent)
|
AttributeSelector::AttributeSelector(const QString& connection, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
|
@ -19,6 +21,12 @@ AttributeSelector::AttributeSelector(const QString& connection, QWidget *parent)
|
||||||
m_attributeView = new AttributeView(attributeGroup, ui->attributeViewContainer, connection);
|
m_attributeView = new AttributeView(attributeGroup, ui->attributeViewContainer, connection);
|
||||||
ui->layoutTableView->addWidget(m_attributeView);
|
ui->layoutTableView->addWidget(m_attributeView);
|
||||||
|
|
||||||
|
// m_attributeTableModel = new AttributeTableModel(attributeGroup, this, m_connection);
|
||||||
|
// m_tableView->setModel(m_attributeTableModel);
|
||||||
|
|
||||||
|
// m_attributeTableDelegate = new AttributeTableDelegate(m_tableView, m_connection, m_tableView);
|
||||||
|
// m_tableView->setItemDelegate(m_attributeTableDelegate);
|
||||||
|
|
||||||
connect(ui->btnRefresh, &QPushButton::clicked, this, &AttributeSelector::onBtnClicked_refreshData);
|
connect(ui->btnRefresh, &QPushButton::clicked, this, &AttributeSelector::onBtnClicked_refreshData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ QWidget* AttributeTableDelegate::createEditor(QWidget *parent, const QStyleOptio
|
||||||
{
|
{
|
||||||
TextEditWidget* textEditor = new TextEditWidget(parent);
|
TextEditWidget* textEditor = new TextEditWidget(parent);
|
||||||
textEditor->setPrompt(QString::fromWCharArray(L"类型必须为英文"));
|
textEditor->setPrompt(QString::fromWCharArray(L"类型必须为英文"));
|
||||||
textEditor->setRegularExpression("[A-Za-z0-9]");
|
textEditor->setRegularExpression("[A-Za-z0-9_]");
|
||||||
connect(textEditor, &TextEditWidget::confirm, this, [=]{
|
connect(textEditor, &TextEditWidget::confirm, this, [=]{
|
||||||
/*QString strText = textEditor->editText();
|
/*QString strText = textEditor->editText();
|
||||||
int id = SqlQueryExecutor::instance().attributeTypeExistsInDB(m_connection, strText);
|
int id = SqlQueryExecutor::instance().attributeTypeExistsInDB(m_connection, strText);
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,7 @@ void DBStructureView::showContextMenu(const QPoint& pos)
|
||||||
removeNode(node);
|
removeNode(node);
|
||||||
})->setEnabled(!isPublic);
|
})->setEnabled(!isPublic);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(QString::fromWCharArray(L"清空数据"), []{});
|
menu.addAction(QString::fromWCharArray(L"清空数据"), [this, node]{});
|
||||||
QPoint originPoint = this->mapToGlobal(QPoint(0,0));
|
QPoint originPoint = this->mapToGlobal(QPoint(0,0));
|
||||||
menu.exec(originPoint + pos);
|
menu.exec(originPoint + pos);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ void ModelInfoEditDialog::initialize()
|
||||||
ui->btnAddGroup->setVisible(false);
|
ui->btnAddGroup->setVisible(false);
|
||||||
m_pMaskLayer = new MaskLayer(this);
|
m_pMaskLayer = new MaskLayer(this);
|
||||||
//正则表达式,只能输入字母
|
//正则表达式,只能输入字母
|
||||||
QRegularExpression regExp("[A-Za-z0-9]+");
|
QRegularExpression regExp("[A-Za-z0-9_]+");
|
||||||
QRegularExpressionValidator* validator = new QRegularExpressionValidator(regExp, this);
|
QRegularExpressionValidator* validator = new QRegularExpressionValidator(regExp, this);
|
||||||
ui->lineEdit_modelType->setValidator(validator);
|
ui->lineEdit_modelType->setValidator(validator);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1111</width>
|
<width>1127</width>
|
||||||
<height>481</height>
|
<height>585</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -56,7 +56,7 @@ border-radius:3px;
|
||||||
}
|
}
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QLineEdit" name="lineEdit_name">
|
<widget class="QLineEdit" name="lineEdit_attributeType">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>80</x>
|
<x>80</x>
|
||||||
|
|
@ -66,7 +66,7 @@ border-radius:3px;
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="label_name">
|
<widget class="QLabel" name="label_atrributeType">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
|
|
@ -76,13 +76,13 @@ border-radius:3px;
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>属性名称:</string>
|
<string>属性类别:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="btnSearch">
|
<widget class="QPushButton" name="btnSearch">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>420</x>
|
<x>600</x>
|
||||||
<y>5</y>
|
<y>5</y>
|
||||||
<width>61</width>
|
<width>61</width>
|
||||||
<height>26</height>
|
<height>26</height>
|
||||||
|
|
@ -114,6 +114,62 @@ background-color:rgb(67,160,249);
|
||||||
<normaloff>:/img/images/icon_search_white.png</normaloff>:/img/images/icon_search_white.png</iconset>
|
<normaloff>:/img/images/icon_search_white.png</normaloff>:/img/images/icon_search_white.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_model">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>220</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>31</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>模型:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QComboBox" name="comboBox_model">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>255</x>
|
||||||
|
<y>5</y>
|
||||||
|
<width>113</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>所有模型</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
<widget class="QComboBox" name="comboBox_group">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>450</x>
|
||||||
|
<y>5</y>
|
||||||
|
<width>113</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>所有属性组</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_group">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>400</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>41</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>属性组:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
||||||
|
|
@ -116,13 +116,13 @@ QPushButton:pressed
|
||||||
<widget class="QWidget" name="recordControlPanel" native="true">
|
<widget class="QWidget" name="recordControlPanel" native="true">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>150</width>
|
<width>200</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>150</width>
|
<width>200</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -132,7 +132,7 @@ QPushButton:pressed
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>36</x>
|
||||||
<y>5</y>
|
<y>5</y>
|
||||||
<width>21</width>
|
<width>21</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
|
|
@ -177,7 +177,7 @@ QPushButton:pressed
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>36</x>
|
<x>62</x>
|
||||||
<y>5</y>
|
<y>5</y>
|
||||||
<width>21</width>
|
<width>21</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
|
|
@ -222,7 +222,7 @@ QPushButton:pressed
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>62</x>
|
<x>88</x>
|
||||||
<y>5</y>
|
<y>5</y>
|
||||||
<width>21</width>
|
<width>21</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
|
|
@ -264,7 +264,7 @@ QPushButton:pressed
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>88</x>
|
<x>114</x>
|
||||||
<y>5</y>
|
<y>5</y>
|
||||||
<width>21</width>
|
<width>21</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
|
|
@ -306,7 +306,7 @@ QPushButton:pressed
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>114</x>
|
<x>140</x>
|
||||||
<y>5</y>
|
<y>5</y>
|
||||||
<width>21</width>
|
<width>21</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
|
|
@ -345,6 +345,51 @@ QPushButton:pressed
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="btnSelect">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>5</y>
|
||||||
|
<width>21</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>21</width>
|
||||||
|
<height>21</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>21</width>
|
||||||
|
<height>21</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>添加</string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../resource/PowerModeler.qrc">
|
||||||
|
<normaloff>:/img/images/icon_multiple-choice.png</normaloff>
|
||||||
|
<disabledoff>:/img/images/icon_multiple-choice_disable.png</disabledoff>:/img/images/icon_multiple-choice.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>16</width>
|
||||||
|
<height>16</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue