PDA

View Full Version : Display Problem



Ashwath
6th March 2011, 08:47
Hi All,

I have developed a QT GUI which uses IGSTK ,ITK AND VTK classes functionality.


//ScribbleArea.h is as shown below

class ScribbleArea : public igstk::QTWidget
{
Q_OBJECT

public:
ScribbleArea(QWidget *parent = 0,Qt::WFlags flags = 0);


protected:
void paintEvent(QPaintEvent *event);


};
//part of ScribbleArea.cpp is as shown below
ScribbleArea::ScribbleArea(QWidget *parent,Qt::WFlags flags):igstk::QTWidget(parent,flags)
{
setAttribute(Qt::WA_StaticContents);

}
void ScribbleArea::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(QPen(Qt::red, 12, Qt::DashDotLine, Qt::RoundCap));
painter.setBrush(QBrush(Qt::green, Qt::SolidPattern));
painter.drawEllipse(80, 80, 200, 200);
}
//In the constructor of the QMainWindow derived class (i.e in QFIRST.CPP)i have the below code:

ScribbleArea* AxialWidget;
m_AxialWidget = new ScribbleArea(ui.groupBox_4);

typedef igstk::View2D View2DType;
View2DType::Pointer m_view2DAxial;

m_AxialWidget->RequestSetView(m_view2DAxial);


The problem is that i am not able to see the ellipse inside the m_AxialWidget when i run the application.
Please help me in this.

thanks,
ashwath

wysota
6th March 2011, 08:50
What does RequestSetView() do?

Ashwath
7th March 2011, 05:14
The RequestSetView attaches the igstk:2DView to the igstk::QTWidget and helps is displaying 2D images on the igstk::QTWidget.

wysota
7th March 2011, 10:47
The RequestSetView attaches the igstk:2DView to the igstk::QTWidget and helps is displaying 2D images on the igstk::QTWidget.
Yeah, that was really helpful :) So what does it really do?