void MainView::createDock() {
DEBUGME;
lb_dockIcon->setMaximumHeight(60);
lb_dockIcon->setMinimumHeight(60);
lb_dockIcon->setAlignment(Qt::AlignCenter);
lb_dockLabel->setAlignment(Qt::AlignCenter);
_dockMainWidget->setLayout(_dockMainWidgetLayout);
_dockWidget->setContentsMargins(5,0,5,0);
_dockWidget->setWidget(_dockMainWidget);
connect(_dockWidget, SIGNAL(visibilityChanged(bool)), this, SLOT(showDock(bool)));
_dockMainWidgetLayout->addWidget(lb_dockIcon, Qt::AlignCenter);
_dockMainWidgetLayout->addWidget(lb_dockLabel);
_dockMainWidgetLayout->addWidget(_dockTabs);
_dockMainWidgetLayout->setStretchFactor(lb_dockIcon,0);
_dockMainWidgetLayout->setStretchFactor(lb_dockLabel,0);
_dockMainWidgetLayout->setStretchFactor(_dockTabs,1);
}
void MainView::createDock() {
DEBUGME;
lb_dockIcon = new QLabel;
lb_dockIcon->setMaximumHeight(60);
lb_dockIcon->setMinimumHeight(60);
lb_dockIcon->setAlignment(Qt::AlignCenter);
lb_dockLabel = new QLabel;
lb_dockLabel->setAlignment(Qt::AlignCenter);
_dockTabs = new QTabWidget;
_dockMainWidgetLayout = new QVBoxLayout;
_dockMainWidget = new QWidget;
_dockMainWidget->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
_dockMainWidget->setLayout(_dockMainWidgetLayout);
_dockWidget = new QDockWidget;
_dockWidget->setContentsMargins(5,0,5,0);
_dockWidget->setWidget(_dockMainWidget);
connect(_dockWidget, SIGNAL(visibilityChanged(bool)), this, SLOT(showDock(bool)));
_dockMainWidgetLayout->addWidget(lb_dockIcon, Qt::AlignCenter);
_dockMainWidgetLayout->addWidget(lb_dockLabel);
_dockMainWidgetLayout->addWidget(_dockTabs);
_dockMainWidgetLayout->setStretchFactor(lb_dockIcon,0);
_dockMainWidgetLayout->setStretchFactor(lb_dockLabel,0);
_dockMainWidgetLayout->setStretchFactor(_dockTabs,1);
}
To copy to clipboard, switch view to plain text mode
and this is how I call it to print different data again
void MainView::setDockData(IFile *file, bool) {
DEBUGME;
lb_dockIcon->setPixmap(icon);
lb_dockIcon->updateGeometry();
FileWidget::wordWrap(name, 100, 25);
lb_dockLabel->setText(name);
lb_dockLabel->updateGeometry();
_dockTabs->clear();
_dockTabs->show();
DockVersions *versions = new DockVersions(this, file);
DockAddIn *addIn = new DockAddIn(this, file);
connect(addIn,
SIGNAL(setDockTabTitle
(int,
QString)),
this,
SLOT(setDockTabTitle
(int,
QString)));
for(int i = 0;i < _dockTabs->count();i++) {
_dockTabs->removeTab(i);
}
_dockTabs->addTab(addIn, addIn->windowTitle());
_dockTabs->addTab(versions, versions->windowTitle());
versions->display();
addIn->display();
}
void MainView::setDockData(IFile *file, bool) {
DEBUGME;
QPixmap icon(file->FilePixmap());
lb_dockIcon->setPixmap(icon);
lb_dockIcon->updateGeometry();
QString name = file->FileName();
FileWidget::wordWrap(name, 100, 25);
lb_dockLabel->setText(name);
lb_dockLabel->updateGeometry();
_dockTabs->clear();
_dockTabs->show();
DockVersions *versions = new DockVersions(this, file);
DockAddIn *addIn = new DockAddIn(this, file);
connect(addIn, SIGNAL(setDockTabTitle(int, QString)), this, SLOT(setDockTabTitle(int, QString)));
for(int i = 0;i < _dockTabs->count();i++) {
_dockTabs->removeTab(i);
}
_dockTabs->addTab(addIn, addIn->windowTitle());
_dockTabs->addTab(versions, versions->windowTitle());
versions->display();
addIn->display();
}
To copy to clipboard, switch view to plain text mode
thanks for looking
Bookmarks