From: <mrj...@us...> - 2007-12-26 23:57:22
|
Revision: 2390 http://tora.svn.sourceforge.net/tora/?rev=2390&view=rev Author: mrjohnson0 Date: 2007-12-26 15:57:25 -0800 (Wed, 26 Dec 2007) Log Message: ----------- fix layout issues in fileio tab Modified Paths: -------------- branches/tora-1.4/tora/src/totuning.cpp branches/tora-1.4/tora/src/totuning.h Modified: branches/tora-1.4/tora/src/totuning.cpp =================================================================== --- branches/tora-1.4/tora/src/totuning.cpp 2007-12-26 22:25:14 UTC (rev 2389) +++ branches/tora-1.4/tora/src/totuning.cpp 2007-12-26 23:57:25 UTC (rev 2390) @@ -67,7 +67,6 @@ #include <qmessagebox.h> #include <qobject.h> #include <qpainter.h> -#include <q3scrollview.h> #include <qsplitter.h> #include <qtabwidget.h> #include <qtoolbar.h> @@ -80,6 +79,7 @@ #include <QString> #include <Q3PopupMenu> #include <QAction> +#include <QVBoxLayout> #include "icons/refresh.xpm" #include "icons/totuning.xpm" @@ -1485,15 +1485,16 @@ } } - for (std::map<QString, Q3Grid *>::iterator k = Charts.begin();k != Charts.end();k++) + for (std::map<QString, Q3Grid *>::iterator k = Charts.begin(); + k != Charts.end(); + k++) Tabs->addTab((*k).second, tr((*k).first.mid(strlen(CONF_CHART)))); - FileIO = new toTuningFileIO(this, "fileio"); - connect(this, SIGNAL(connectionChange()), FileIO, SLOT(changeConnection())); - Waits = new toWaitEvents(this, "waits"); Tabs->addTab(Waits, tr("Wait events")); + FileIO = new toTuningFileIO(Tabs); + connect(this, SIGNAL(connectionChange()), FileIO, SLOT(changeConnection())); Tabs->addTab(FileIO, tr("&File I/O")); Indicators = new toListView(Tabs, "indicators"); @@ -1806,26 +1807,35 @@ "", "0800"); -toTuningFileIO::toTuningFileIO(QWidget *parent, const char *name, Qt::WFlags fl) - : Q3ScrollView(parent, name, fl) +toTuningFileIO::toTuningFileIO(QWidget *parent) + : QWidget(parent) { - try - { + try { connect(toCurrentTool(this)->timer(), SIGNAL(timeout()), this, SLOT(refresh())); - viewport()->setBackgroundColor(qApp->palette().active().background()); + // fscking qscrollarea won't resize unless this is added + QHBoxLayout *h = new QHBoxLayout; + h->setSpacing(0); + h->setContentsMargins(0, 0, 0, 0); - Q3VBox *Box = new Q3VBox(this->viewport()); - addChild(Box); +// setAutoFillBackground(true); +// setPalette(QPalette(Qt::red)); + QScrollArea *sa = new QScrollArea(this); + h->addWidget(sa); + setLayout(h); + + QWidget *Box = new QWidget; + QVBoxLayout *vbox = new QVBoxLayout; + QComboBox *combo = new QComboBox(Box); combo->insertItem(tr("File I/O")); combo->insertItem(tr("File timing")); - if (toCurrentConnection(this).version() >= "0800") - { + if(toCurrentConnection(this).version() >= "0800") { combo->insertItem(tr("Tablespace I/O")); combo->insertItem(tr("Tablespace timing")); } + vbox->addWidget(combo); connect(combo, SIGNAL(activated(int)), this, SLOT(changeCharts(int))); FileReads = new Q3Grid(2, Box); @@ -1833,10 +1843,15 @@ TablespaceReads = new Q3Grid(2, Box); TablespaceTime = new Q3Grid(2, Box); - FileReads->setFixedWidth(viewport()->width() - 30); - FileTime->setFixedWidth(viewport()->width() - 30); - TablespaceReads->setFixedWidth(viewport()->width() - 30); - TablespaceTime->setFixedWidth(viewport()->width() - 30); + vbox->addWidget(FileReads); + vbox->addWidget(FileTime); + vbox->addWidget(TablespaceReads); + vbox->addWidget(TablespaceTime); + + Box->setLayout(vbox); + sa->setWidget(Box); + sa->setWidgetResizable(true); + changeCharts(0); CurrentStamp = 0; connect(&Poll, SIGNAL(timeout()), this, SLOT(poll())); @@ -2058,16 +2073,6 @@ TOCATCH } -void toTuningFileIO::resizeEvent(QResizeEvent *e) -{ - Q3ScrollView::resizeEvent(e); - - FileReads->setFixedWidth(viewport()->width() - 30); - FileTime->setFixedWidth(viewport()->width() - 30); - TablespaceReads->setFixedWidth(viewport()->width() - 30); - TablespaceTime->setFixedWidth(viewport()->width() - 30); -} - void toTuningFileIO::changeConnection(void) { { Modified: branches/tora-1.4/tora/src/totuning.h =================================================================== --- branches/tora-1.4/tora/src/totuning.h 2007-12-26 22:25:14 UTC (rev 2389) +++ branches/tora-1.4/tora/src/totuning.h 2007-12-26 23:57:25 UTC (rev 2390) @@ -48,18 +48,16 @@ #include <list> #include <map> -#include <q3scrollview.h> #include <QString> #include <QResizeEvent> #include <QLabel> -#include <Q3PopupMenu> +#include <QScrollArea> class QAction; class QMenu; class QComboBox; class Q3Grid; class QLabel; -class Q3PopupMenu; class QTabWidget; class toBarChart; class toConnection; @@ -79,7 +77,7 @@ virtual std::list<double> transform(std::list<double> &trans); }; -class toTuningFileIO : public Q3ScrollView +class toTuningFileIO : public QWidget { Q_OBJECT @@ -104,7 +102,6 @@ std::map<QString, toBarChart *> ReadsCharts; std::map<QString, toLineChart *> TimeCharts; std::map<QString, std::list<double> > LastValues; - virtual void resizeEvent(QResizeEvent *e); void saveSample(const QString &, const QString &, double reads, double writes, @@ -116,7 +113,7 @@ toBackground Poll; public: - toTuningFileIO(QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0); + toTuningFileIO(QWidget *parent = 0); ~toTuningFileIO(); void stop(void); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |