mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 06:20:53 +01:00
ConductorPropertiesWidget: improve set focus to QLineEdit
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4059 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -28,8 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
ConductorPropertiesWidget::ConductorPropertiesWidget(QWidget *parent) :
|
ConductorPropertiesWidget::ConductorPropertiesWidget(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::ConductorPropertiesWidget),
|
ui(new Ui::ConductorPropertiesWidget)
|
||||||
m_activation (true)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
initWidget();
|
initWidget();
|
||||||
@@ -125,12 +124,8 @@ ConductorProperties ConductorPropertiesWidget::properties() const {
|
|||||||
*/
|
*/
|
||||||
bool ConductorPropertiesWidget::event(QEvent *event)
|
bool ConductorPropertiesWidget::event(QEvent *event)
|
||||||
{
|
{
|
||||||
if (m_activation)
|
if (event->type() == QEvent::WindowActivate) {
|
||||||
{
|
ui -> m_text_le -> setFocus();
|
||||||
if (event -> type() == QEvent::WindowActivate || event -> type() == QEvent::Show)
|
|
||||||
{
|
|
||||||
ui -> m_text_le -> setFocus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(QWidget::event(event));
|
return(QWidget::event(event));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ class ConductorPropertiesWidget : public QWidget
|
|||||||
Ui::ConductorPropertiesWidget *ui;
|
Ui::ConductorPropertiesWidget *ui;
|
||||||
ConductorProperties m_properties;
|
ConductorProperties m_properties;
|
||||||
QTextOrientationSpinBoxWidget *m_verti_select, *m_horiz_select;
|
QTextOrientationSpinBoxWidget *m_verti_select, *m_horiz_select;
|
||||||
bool m_activation;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONDUCTORPROPERTIESWIDGET_H
|
#endif // CONDUCTORPROPERTIESWIDGET_H
|
||||||
|
|||||||
Reference in New Issue
Block a user