myPopup->insertSeparator();
myPopup->insertItem(tr("MSG_CHANGE_BACKGROUND"), this, SLOT(changeBackground()));
-
+
hide();
}
}
}
+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();
{
Trace("SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray");
//resize(GRAPH_WIDTH, GRAPH_HEIGHT);
+ QWidget* aMainParent = (QWidget*)(myMain->parent());
resize(800, 600);
setDoubleBuffering(true);
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;
}