}
}
+void SUPERVGUI_ArrayView::resizeEvent( QResizeEvent* e) {
+ QCanvasView::resizeEvent( e );
+ canvas()->resize( e->size().width() > canvas()->width() ? e->size().width() : canvas()->width(),
+ e->size().height() > canvas()->height() ? e->size().height() : canvas()->height() );
+}
+
void SUPERVGUI_ArrayView::contentsMousePressEvent(QMouseEvent* theEvent) {
myGlobalPoint = theEvent->globalPos();
#include <qtooltip.h>
#define TEXT_MARGIN 5
+#include <iostream.h> //for debug only
+
#define ADDNODES(NodesName,LevelHasDiffNT) \
ncols = nodes->NodesName.length(); \
for (int co=0; co<ncols; co++) { \
SUPERVGUI_CanvasCellNode* cell;
QString aLabel;
int x, y;
+
int nligs = myMain->getDataflow()->LevelMax();
+ cout<<"-> myMain->getDataflow()->LevelMax() = "<<myMain->getDataflow()->LevelMax()<<endl;
int ncols = myMain->getDataflow()->ThreadsMax();
+ cout<<"-> myMain->getDataflow()->ThreadsMax() = "<<myMain->getDataflow()->ThreadsMax()<<endl;
// there is no any calculations
if (ncols == 0) return false;
pen.setWidth(1);
QBrush br(MAIN_TITLE);
+ // variables to resize canvas in table view
+ int aMaxWidth = 0;
+ int aMaxHeight = 0;
+
for (int co = 0; co < ncols; co++) {
aLabel = QString("Thread %1").arg(co);
QRect aRect = QRect(50 + co * (CELL_WIDTH + CELL_SPACE), 20, CELL_WIDTH, CELL_HEIGHT);
aText->setY(aRect.y() + aRect.height()/2 - aBRect.height()/2);
aText->setZ(1);
aText->show();
+
+ aMaxWidth = aRect.x() + aRect.width() + 50;
}
y = 60;
nodeX = 50;
nodeY = y + CELL_HEIGHT*2;
+ aMaxHeight = nodeY;
+
+ // if aMaxWidth and aMaxHeight is greater than the current size
+ // of the canvas, we resize canvas to these new width and height
+ if ( aMaxWidth > this->width() || aMaxHeight > this->height() )
+ this->resize( aMaxWidth > this->width() ? aMaxWidth : this->width(),
+ aMaxHeight > this->height() ? aMaxHeight : this->height() );
return true;
}