mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +08:00
Some changes for debugging visibility changed stuff
This commit is contained in:
parent
03bd4a4505
commit
29ebc83b35
@ -546,17 +546,19 @@ void CDockAreaWidget::internalSetCurrentDockWidget(CDockWidget* DockWidget)
|
||||
void CDockAreaWidget::setCurrentIndex(int index)
|
||||
{
|
||||
auto TabBar = d->tabBar();
|
||||
/*if (TabBar->currentIndex() == index)
|
||||
{
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (index < 0 || index > (TabBar->count() - 1))
|
||||
{
|
||||
qWarning() << Q_FUNC_INFO << "Invalid index" << index;
|
||||
return;
|
||||
}
|
||||
|
||||
auto cw = d->ContentsLayout->currentWidget();
|
||||
auto nw = d->ContentsLayout->widget(index);
|
||||
if (cw == nw && !nw->isHidden())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
emit currentChanging(index);
|
||||
TabBar->setCurrentIndex(index);
|
||||
d->ContentsLayout->setCurrentIndex(index);
|
||||
|
@ -134,8 +134,8 @@ void DockWidgetPrivate::showDockWidget()
|
||||
}
|
||||
else
|
||||
{
|
||||
DockArea->toggleView(true);
|
||||
DockArea->setCurrentDockWidget(_this);
|
||||
DockArea->toggleView(true);
|
||||
TabWidget->show();
|
||||
QSplitter* Splitter = internal::findParent<QSplitter*>(DockArea);
|
||||
while (Splitter && !Splitter->isVisible())
|
||||
@ -525,20 +525,14 @@ bool CDockWidget::event(QEvent *e)
|
||||
switch (e->type())
|
||||
{
|
||||
case QEvent::Hide:
|
||||
std::cout << this->objectName().toStdString() << " visible: " << isVisible()
|
||||
<< " hidden: " << isHidden() << " visibleTo: " << isVisibleTo(d->DockManager) << std::endl;
|
||||
emit visibilityChanged(false);
|
||||
break;
|
||||
|
||||
case QEvent::Show:
|
||||
{
|
||||
QPoint parentTopLeft(0, 0);
|
||||
if (isWindow())
|
||||
{
|
||||
if (const QWindow *window = windowHandle())
|
||||
parentTopLeft = window->screen()->availableVirtualGeometry().topLeft();
|
||||
else
|
||||
parentTopLeft = QGuiApplication::primaryScreen()->availableVirtualGeometry().topLeft();
|
||||
std::cout << "QEvent::Show isWindow()" << std::endl;
|
||||
}
|
||||
emit visibilityChanged(geometry().right() >= parentTopLeft.x() && geometry().bottom() >= parentTopLeft.y());
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user