git-svn-id: svn://db.shs.com.ru/libs@183 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2017-04-18 13:53:08 +00:00
parent 2eaee22b6d
commit 44a7c35aaa
2 changed files with 19 additions and 11 deletions

View File

@@ -221,11 +221,12 @@ bool EMainWindow::checkSave() {
void EMainWindow::changedDock() {
if (isHidden()) return;
QList<QTabBar * > tabs(findChildren<QTabBar * >());
QList<QDockWidget * > docks = findChildren<QDockWidget * >();
QSet<QDockWidget * > docks_tabs;
QDockWidget * dock;
//qDebug() << "change";
// qDebug() << "### change";
foreach (QTabBar * t, tabs) {
if (!t->objectName().isEmpty() || t->isHidden()) continue;
if (!tbars.contains(t)) {
@@ -235,10 +236,10 @@ void EMainWindow::changedDock() {
t->setIconSize(dockTabsIconSIze());
t->setTabsClosable(true);
}
//qDebug() << "tab";
// qDebug() << "tab" << t << t->count();
for (int i = 0; i < t->count(); ++i) {
dock = (QDockWidget * )t->tabData(i).toULongLong();
//qDebug() << i << dock;
//qDebug() << i << t->tabData(i);
if (dock == 0) continue;
t->setTabIcon(i, dock->windowIcon());
docks_tabs << dock;
@@ -258,7 +259,8 @@ void EMainWindow::changedDock() {
}
if (!tdocks.contains(d)) {
tdocks << d;
//connect(t, SIGNAL((QObject*)), this, SLOT(changedDockClose(QObject*)));
// qDebug() << "connect" << d;
// connect(d, SIGNAL(destroyed(QObject*)), this, SLOT(changedDockClose(QObject*)), Qt::UniqueConnection);
d->installEventFilter(this);
}
//d->titleBarWidget()->setHidden(docks_tabs.contains(d));
@@ -275,11 +277,17 @@ void EMainWindow::changedDock() {
}
void EMainWindow::changedDockClose(QObject * bar) {
//qDebug() << "close" << bar;
tbars.removeAll((QTabBar * )bar);
changedDock();
}
//void EMainWindow::changedDockClose(QObject * dock) {
// qDebug() << "changedDockClose" << dock;
// if (!dock) return;
// foreach (QTabBar * t, tbars) {
// for (int i = 0; i < t->count(); ++i)
// if (t->tabData(i).toULongLong() == (qulonglong)dock) {
// t->removeTab(i);
// break;
// }
// }
//}
void EMainWindow::closeDock(int index) {