You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added the below code
----------------------------MyWidget.cpp----------------------------
MyWidget::MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget parent)
: QWidget(parent)
{
m_is_floating_checkbox = new QCheckBox(this);
m_label = new QLabel(this);
m_label->setStyleSheet("QLabel { background-color : orange; color : black; }");
m_label->setText("Floating");
QFont f( "Arial", 12, QFont::Bold);
m_label->setFont( f);
m_label->move(20,0);
....
....
....
}
void MyWidget::connectTo(KDDockWidgets::DockWidget dock) {
connect(dock->floatAction(), &QAction::toggled, m_is_floating_checkbox, &QCheckBox::setChecked);
bool val = dock->floatAction()->isChecked();
m_is_floating_checkbox->setChecked(val);
}
----------------------------MyWidget.h----------------------------
class MyWidget : public QWidget
{
...
...
public:
void connectTo(KDDockWidgets::DockWidget* parent);
protected:
QCheckBox* m_is_floating_checkbox = nullptr;
QLabel* m_label = nullptr;
};
---------------------------MyMainWindow.cpp------------------------
MyMainWindow::MyMainWindow(.. ) {
...
...
connect(newAction, &QAction::triggered, this, [] {
static int count = 0;
count++;
auto w = newMyWidget();
w->setGeometry(100, 100, 400, 400);
auto dock = new KDDockWidgets::DockWidget(QStringLiteral("new dock %1").arg(count));
dock->setWidget(w);
w->connectTo(dock);
dock->resize(600, 600);
dock->show();
});
}
KDDockWidgets::DockWidgetBase *MyMainWindow::newDockWidget()
{
....
....
myWidget->connectTo(dock);
count++;
return dock;
}
To simplify, i have added a checkbox which will be checked if the window is floating. But in the below gif, you can see that checkbox remains checked when dock widget is docked to another floating widget.
We do not see this issue when widgets are tabbed.
If you need more information, please feel free to write back.
Kind Regards
Nandish
The text was updated successfully, but these errors were encountered:
unfortunately the fix does not seem to work. Please have a look at the below gif,
The focus problem appears to be solved, last dropped widget has the focus, but the floating signal is not sent the dockwidget which accepts another dock widget. If dock widget A is docked to dock widget B, B does not receive a signal that it is not floating any more, only A receives such a signal and floating status is changed.
Hello Sergio,
I added the below code
----------------------------MyWidget.cpp----------------------------
MyWidget::MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget parent)
: QWidget(parent)
{
m_is_floating_checkbox = new QCheckBox(this);
m_label = new QLabel(this);
m_label->setStyleSheet("QLabel { background-color : orange; color : black; }");
m_label->setText("Floating");
QFont f( "Arial", 12, QFont::Bold);
m_label->setFont( f);
m_label->move(20,0);
....
....
....
}
void MyWidget::connectTo(KDDockWidgets::DockWidget dock) {
connect(dock->floatAction(), &QAction::toggled, m_is_floating_checkbox, &QCheckBox::setChecked);
bool val = dock->floatAction()->isChecked();
m_is_floating_checkbox->setChecked(val);
}
----------------------------MyWidget.h----------------------------
class MyWidget : public QWidget
{
...
...
public:
void connectTo(KDDockWidgets::DockWidget* parent);
protected:
QCheckBox* m_is_floating_checkbox = nullptr;
QLabel* m_label = nullptr;
};
---------------------------MyMainWindow.cpp------------------------
MyMainWindow::MyMainWindow(.. ) {
...
...
connect(newAction, &QAction::triggered, this, [] {
static int count = 0;
count++;
auto w = newMyWidget();
w->setGeometry(100, 100, 400, 400);
auto dock = new KDDockWidgets::DockWidget(QStringLiteral("new dock %1").arg(count));
dock->setWidget(w);
w->connectTo(dock);
dock->resize(600, 600);
dock->show();
});
}
KDDockWidgets::DockWidgetBase *MyMainWindow::newDockWidget()
{
....
....
myWidget->connectTo(dock);
count++;
return dock;
}
To simplify, i have added a checkbox which will be checked if the window is floating. But in the below gif, you can see that checkbox remains checked when dock widget is docked to another floating widget.
We do not see this issue when widgets are tabbed.
If you need more information, please feel free to write back.
Kind Regards
Nandish
The text was updated successfully, but these errors were encountered: