mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Merged trunk into 0.3 branch: rev1067 to rev1077
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1179 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -45,6 +45,7 @@ ConductorPropertiesWidget::ConductorPropertiesWidget(const ConductorProperties &
|
||||
/// construit l'interface du widget
|
||||
void ConductorPropertiesWidget::buildInterface() {
|
||||
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setMinimumSize(380, 350);
|
||||
|
||||
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
||||
@@ -291,3 +292,17 @@ void ConductorPropertiesWidget::setReadOnly(bool ro) {
|
||||
color_button -> setDisabled(ro);
|
||||
dashed_checkbox -> setDisabled(ro);
|
||||
}
|
||||
|
||||
/**
|
||||
Gere le focus de ce widget
|
||||
*/
|
||||
void ConductorPropertiesWidget::focusInEvent(QFocusEvent *event) {
|
||||
if (properties_.type == ConductorProperties::Multi) {
|
||||
text_field -> setFocus(Qt::ActiveWindowFocusReason);
|
||||
text_field -> selectAll();
|
||||
} else if (properties_.type == ConductorProperties::Single) {
|
||||
phase_spinbox -> setFocus(Qt::ActiveWindowFocusReason);
|
||||
phase_spinbox -> selectAll();
|
||||
}
|
||||
QWidget::focusInEvent(event);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,9 @@ class ConductorPropertiesWidget : public QWidget {
|
||||
void updateDisplay();
|
||||
void chooseColor();
|
||||
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent *);
|
||||
|
||||
// attributs prives
|
||||
private:
|
||||
QButtonGroup *radio_buttons;
|
||||
|
||||
@@ -840,6 +840,7 @@ void DiagramView::editConductor(Conductor *edited_conductor) {
|
||||
dialog_layout -> addWidget(dbb);
|
||||
connect(dbb, SIGNAL(accepted()), &conductor_dialog, SLOT(accept()));
|
||||
connect(dbb, SIGNAL(rejected()), &conductor_dialog, SLOT(reject()));
|
||||
cpw -> setFocus(Qt::ActiveWindowFocusReason);
|
||||
|
||||
// execute le dialogue et met a jour le conducteur
|
||||
if (conductor_dialog.exec() == QDialog::Accepted) {
|
||||
|
||||
Reference in New Issue
Block a user