Your approach is strange, but ok Getting the values of those scrollbars will not be easy, because they are declared as private members of QWorkspace, so you have to "hack" the access restrictions using Qt's mechanisms.
If you look at QWorkspace source code, you'll notice, that the scrollbars are created and assigned names:
//...
d->vbar = new QScrollBar(Qt::Vertical, this);
d->vbar->setObjectName(QLatin1String("vertical scrollbar"));
//...
d->hbar = new QScrollBar(Qt::Horizontal, this);
d->hbar->setObjectName(QLatin1String("horizontal scrollbar"));
To copy to clipboard, switch view to plain text mode
Now you have to get a pointer to those items using QObject::findChild (or qFindChild() if you're using MSVC):
QScrollBar *vertical = workspace->findChild<QScrollBar*>(QLatin1String("vertical scrollbar"));
QScrollBar *horizontal = workspace->findChild<QScrollBar*>(QLatin1String("horizontal scrollbar"));
To copy to clipboard, switch view to plain text mode
Then you can fetch their values using QAbstractSlider::value().
Bookmarks