void process1::box()
{
MyWidget *w=new MyWidget(22,image,par);
w->showMaximized();
w->raise(); //even tried this but My Widget is displayed behind GUI designed
// central widget
w->setFocus () ; // no effect even after focussing
w->show();
}
{
............
..................
parent->setGeometry(100,100,300,300);
// parent->activateWindow ();
QImage myImage
("Sample Image.jpg");
m_pixmapLabel
= new QLabel(parent
);
m_pixmapLabel->setPixmap(pm);
for(................)
{.......
...........
show();
}
}
{
rubberBand
->setGeometry
(QRect(origin, event
->pos
()).
normalized());
}
{
origin = event->pos();
cout<<"x event "<< event->x()<<"y event "<< event->y()<<endl;
rubberBand
->setGeometry
(QRect(origin,
QSize(0,
0)));
rubberBand->show();
}
{ ........
.........show();.....}
void process1::box()
{
QWidget *par;
MyWidget *w=new MyWidget(22,image,par);
w->showMaximized();
w->raise(); //even tried this but My Widget is displayed behind GUI designed
// central widget
w->setFocus () ; // no effect even after focussing
w->show();
}
MyWidget::MyWidget(int r, QImage image, QWidget* parent)
{
............
..................
parent->setGeometry(100,100,300,300);
// parent->activateWindow ();
QImage myImage("Sample Image.jpg");
QPixmap pm = QPixmap :: fromImage(myImage);
m_pixmapLabel = new QLabel(parent);
m_pixmapLabel->setPixmap(pm);
for(................)
{.......
...........
show();
}
}
void MyWidget::mouseMoveEvent(QMouseEvent *event)
{
rubberBand->setGeometry(QRect(origin, event->pos()).normalized());
}
void MyWidget::mousePressEvent(QMouseEvent *event)
{
origin = event->pos();
cout<<"x event "<< event->x()<<"y event "<< event->y()<<endl;
rubberBand = new QRubberBand(QRubberBand::Rectangle, m_pixmapLabel);
rubberBand->setGeometry(QRect(origin, QSize(0,0)));
rubberBand->show();
}
void MyWidget::mouseReleaseEvent(QMouseEvent *event)
{ ........
.........show();.....}
To copy to clipboard, switch view to plain text mode
So how is it possible to bring front this My Widget in front of the GUI based central widget?
Bookmarks