Changeset 10466 for trunk/FACT++/gui


Ignore:
Timestamp:
04/26/11 18:54:01 (14 years ago)
Author:
tbretz
Message:
Added proper resizing by adding layout hints when the tab is recreated.
Location:
trunk/FACT++/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/DockWindow.cc

    r10394 r10466  
    11#include "DockWindow.h"
    22
    3 #include <QtGui/QDockWidget>
     3#include <QDockWidget>
     4#include <QGridLayout>
    45
    56#include <stdexcept>
     
    78using namespace std;
    89
     10#include <iostream>
     11
    912DockWindow::DockWindow(QDockWidget *d, const QString &name)
    10     : fDockWidget(d), fGeometry(d->geometry())
     13    : fDockWidget(d)
    1114{
    1215    QObject *w0 = d->parent();   // QWidget
     
    2629        throw runtime_error("3rd parent of QDockWidget is not a QTabWidget");
    2730
    28     setGeometry(fGeometry);
     31    setGeometry(d->geometry());
    2932    addDockWidget(Qt::LeftDockWidgetArea, fDockWidget);
    3033    setWindowTitle(name);
     34
     35    // FIXME: ToolTip, WhatsThis
     36
     37    show();
    3138}
    3239
     
    3542    QWidget *w = new QWidget;
    3643
     44    QGridLayout *l =  new QGridLayout(w);
     45    //layout->setObjectName(QString::fromUtf8("gridLayout_")+windowTitle());
     46    l->addWidget(fDockWidget, 0, 0, 1, 1);
     47
    3748    fTabWidget->addTab(w, windowTitle());
     49    fTabWidget->setTabsClosable(true);
    3850
    3951    fDockWidget->setParent(w);
    40     fDockWidget->setGeometry(fGeometry);
    4152
    42     fTabWidget->setTabsClosable(true);
    4353}
  • trunk/FACT++/gui/DockWindow.h

    r10394 r10466  
    1414    QDockWidget  *fDockWidget;
    1515    QTabWidget   *fTabWidget;
    16     const QRect   fGeometry;
    1716
    1817public:
Note: See TracChangeset for help on using the changeset viewer.