Skip to content
Snippets Groups Projects
Commit ddb205b3 authored by konstantin.kukharenko's avatar konstantin.kukharenko
Browse files

[*]fixed bug

parent 6c875be6
No related branches found
No related tags found
1 merge request!225Pubtest bugs 4562
...@@ -3,15 +3,23 @@ ...@@ -3,15 +3,23 @@
WidgetInputSizeController::WidgetInputSizeController(QObject *a_parent) WidgetInputSizeController::WidgetInputSizeController(QObject *a_parent)
:QObject (a_parent) :QObject (a_parent)
{ {
connect(QApplication::inputMethod(),&QInputMethod::keyboardRectangleChanged,[=]{ connect(QApplication::inputMethod(),&QInputMethod::keyboardRectangleChanged,this,&WidgetInputSizeController::setVisibilityWidgetDependingOnStateKeyboard);
if(QApplication::inputMethod()->isVisible() && QApplication::inputMethod()->keyboardRectangle().height() == 0.0) }
{
setVisibleWidgets(true);
if(parent()!=nullptr) WidgetInputSizeController::~WidgetInputSizeController()
qobject_cast<QWidget*>(parent())->setFocus(); {
} disconnect(QApplication::inputMethod(),&QInputMethod::keyboardRectangleChanged,this,&WidgetInputSizeController::setVisibilityWidgetDependingOnStateKeyboard);
}); }
void WidgetInputSizeController::setVisibilityWidgetDependingOnStateKeyboard()
{
if(QApplication::inputMethod()->isVisible() && QApplication::inputMethod()->keyboardRectangle().height() == 0.0)
{
setVisibleWidgets(true);
if(parent()!=nullptr)
qobject_cast<QWidget*>(parent())->setFocus();
}
} }
void WidgetInputSizeController::addWidgetEmitsSignal(CustomLineEditBase *a_widget) void WidgetInputSizeController::addWidgetEmitsSignal(CustomLineEditBase *a_widget)
......
...@@ -15,7 +15,7 @@ class WidgetInputSizeController : public QObject ...@@ -15,7 +15,7 @@ class WidgetInputSizeController : public QObject
Q_OBJECT Q_OBJECT
public: public:
WidgetInputSizeController(QObject *a_parent); WidgetInputSizeController(QObject *a_parent);
~WidgetInputSizeController();
/// Adds widgets that should disappear/appear. /// Adds widgets that should disappear/appear.
void addDisappearingWidget(QWidget *a_widget); void addDisappearingWidget(QWidget *a_widget);
...@@ -28,6 +28,7 @@ private: ...@@ -28,6 +28,7 @@ private:
QList<QWidget*> m_disappearingWidget; QList<QWidget*> m_disappearingWidget;
private slots: private slots:
void setVisibleWidgets(bool a_visible); void setVisibleWidgets(bool a_visible);
void setVisibilityWidgetDependingOnStateKeyboard();
}; };
#endif // WIDGETINPUTSIZECONTROLLER_H #endif // WIDGETINPUTSIZECONTROLLER_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment