如何获取坐标QScrollArea子窗口小部件?

时间:2015-03-12 10:30:27

标签: qt

如何获取坐标QScrollArea子窗口小部件?

The parent scroll widget with a child widget.

mainWindow::mainWindow( QWidget *parent)
{
    // class PaintWidget:public QScrollArea
    PaintWidget *painter = new PaintWidget( this, &manager);
    setCentralWidget( painter );

    //some code
}

PaintWidget::PaintWidget( QWidget *parent, plugin::PluginsManager *manager):
   painter(manager, this)
{
   // RPW painter;
   // class Painter:public QGLWidget
   setWidget( &painter );
   setAlignment( Qt::AlignCenter );

   //some code
}

1 个答案:

答案 0 :(得分:0)

QWidget::pos()正是您正在寻找的。它适用于所有情况,QScrollWidget根本不需要特殊处理。