src/qt3support/widgets/q3mainwindow.cpp File Reference

#include "q3mainwindow.h"
#include "qapplication.h"
#include "qbitmap.h"
#include "qcursor.h"
#include "qdatetime.h"
#include "q3dockarea.h"
#include "qevent.h"
#include "qlayout.h"
#include "qmap.h"
#include "qmenubar.h"
#include "qpainter.h"
#include "q3popupmenu.h"
#include "q3scrollview.h"
#include "qstatusbar.h"
#include "qstringlist.h"
#include "qstyle.h"
#include "qstyleoption.h"
#include "qtimer.h"
#include "q3toolbar.h"
#include "qtooltip.h"
#include "qwhatsthis.h"
#include <private/q3mainwindow_p.h>
#include "q3mainwindow.moc"

Include dependency graph for q3mainwindow.cpp:

Go to the source code of this file.

Classes

class  Q3MainWindowLayout
class  QHideDock

Functions

static void saveDockArea (QTextStream &ts, Q3DockArea *a)
static void loadDockArea (const QStringList &names, Q3DockArea *a, Qt::Dock dl, QList< Q3DockWindow * > &l, Q3MainWindow *mw, QTextStream &ts)


Function Documentation

static void loadDockArea ( const QStringList names,
Q3DockArea a,
Qt::Dock  dl,
QList< Q3DockWindow * > &  l,
Q3MainWindow mw,
QTextStream ts 
) [static]

Definition at line 2327 of file q3mainwindow.cpp.

References a, Q3MainWindow::addDockWindow(), QList< T >::begin(), c, QList< T >::end(), h, QCss::Height, i, int, l, name, Post, Pre, QTextStream::readLine(), s, QString::toInt(), w, Width, Q3DockWindow::windowTitle(), X, x, Y, and y.

Referenced by Q3MainWindow::operator>>().

02328 {
02329     for (QStringList::ConstIterator it = names.begin(); it != names.end(); ++it) {
02330         for (int i = 0; i < l.size(); ++i) {
02331             Q3DockWindow *dw = l.at(i);
02332             if (dw->windowTitle() == *it) {
02333                 mw->addDockWindow(dw, dl);
02334                 break;
02335             }
02336         }
02337     }
02338     if (a) {
02339         ts >> *a;
02340     } else if (dl == Qt::DockTornOff) {
02341         QString s = ts.readLine();
02342         enum State { Pre, Name, X, Y, Width, Height, Visible, Post };
02343         int state = Pre;
02344         QString name, x, y, w, h, visible;
02345         QChar c;
02346         for (int i = 0; i < (int)s.length(); ++i) {
02347             c = s[i];
02348             if (state == Pre && c == '[') {
02349                 state++;
02350                 continue;
02351             }
02352             if (c == ',' &&
02353                  (state == Name || state == X || state == Y || state == Width || state == Height)) {
02354                 state++;
02355                 continue;
02356             }
02357             if (state == Visible && c == ']') {
02358                 for (int i = 0; i < l.size(); ++i) {
02359                     Q3DockWindow *dw = l.at(i);
02360                     if (QString(dw->windowTitle()) == name) {
02361                         if (!qobject_cast<Q3ToolBar*>(dw))
02362                             dw->setGeometry(x.toInt(), y.toInt(), w.toInt(), h.toInt());
02363                         else
02364                             dw->setGeometry(x.toInt(), y.toInt(), dw->width(), dw->height());
02365                         if (!(bool)visible.toInt())
02366                             dw->hide();
02367                         else
02368                             dw->show();
02369                         break;
02370                     }
02371                 }
02372 
02373                 name = x = y = w = h = visible = "";
02374 
02375                 state = Pre;
02376                 continue;
02377             }
02378             if (state == Name)
02379                 name += c;
02380             else if (state == X)
02381                 x += c;
02382             else if (state == Y)
02383                 y += c;
02384             else if (state == Width)
02385                 w += c;
02386             else if (state == Height)
02387                 h += c;
02388             else if (state == Visible)
02389                 visible += c;
02390         }
02391     }
02392 }

Here is the call graph for this function:

static void saveDockArea ( QTextStream ts,
Q3DockArea a 
) [static]

Definition at line 2266 of file q3mainwindow.cpp.

References a, QTextStream::endl(), i, l, and Q3DockWindow::windowTitle().

Referenced by Q3MainWindow::operator<<().

02267 {
02268     QList<Q3DockWindow *> l = a->dockWindowList();
02269     for (int i = 0; i < l.size(); ++i) {
02270         Q3DockWindow *dw = l.at(i);
02271         ts << QString(dw->windowTitle());
02272         ts << ",";
02273     }
02274     ts << endl;
02275     ts << *a;
02276 }

Here is the call graph for this function:


Generated on Thu Mar 15 14:09:56 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1