4#include <QLoggingCategory> 
    8static Q_LOGGING_CATEGORY(log, 
"Client.FrmScroll")
 
   11    qDebug(log) << Q_FUNC_INFO;
 
   17        bool check = connect(pView,
 
   18                             SIGNAL(sigMouseMoveEvent(QMouseEvent*)),
 
   20                             SLOT(slotMouseMoveEvent(QMouseEvent*)));
 
   23    setAlignment(Qt::AlignCenter);
 
   25    setWidgetResizable(
false);
 
   26    slotSetAdaptWindows(GetViewer()->GetAdaptWindows());
 
   29CFrmScroll::~CFrmScroll()
 
   31    qDebug(log) << Q_FUNC_INFO;
 
   36    CFrmViewer* pView = qobject_cast<CFrmViewer*>(widget());
 
   41            setWidgetResizable(
false);
 
   43        if(!widgetResizable())
 
   44            setWidgetResizable(
true);
 
   46    pView->slotSetAdaptWindows(aw);
 
   52    CFrmViewer* pView = qobject_cast<CFrmViewer*>(widget());
 
   54        return pView->GetAdaptWindows();
 
   55    return CFrmViewer::ADAPT_WINDOWS::Auto;
 
   60    return qobject_cast<CFrmViewer*>(widget());
 
   63void CFrmScroll::slotMouseMoveEvent(QMouseEvent *event)
 
   66    CFrmViewer* pFrmView = qobject_cast<CFrmViewer*>(sender());
 
   67    QScrollBar* pHBar = horizontalScrollBar();
 
   68    QScrollBar* pVBar = verticalScrollBar();
 
   69    if(pHBar->isHidden() && pVBar->isHidden())
 
   73    if(!pVBar->isHidden()) nVWidth = pVBar->geometry().width();
 
   74    QPoint pos = pFrmView->mapToParent(event->pos());
 
   75    if(pos.x() < area && pHBar->value() > pHBar->minimum())
 
   76        pHBar->setValue(pHBar->value() - pHBar->singleStep());
 
   77    else if(pos.x() > width() - area - nVWidth
 
   78            && pHBar->value() < pHBar->maximum())
 
   79        pHBar->setValue(pHBar->value() + pHBar->singleStep());
 
   82    if(!pHBar->isHidden()) nHHeight = pHBar->geometry().height();
 
   83    if(pos.y() < area && pVBar->value() > pVBar->minimum())
 
   84        pVBar->setValue(pVBar->value() - pVBar->singleStep());
 
   85    else if(pos.y() > height() - area - nHHeight
 
   86            && pVBar->value() < pVBar->maximum())
 
   87        pVBar->setValue(pVBar->value() + pVBar->singleStep());
 
A widget which displays output image from a CConnectDesktop and sends input keypresses and mouse acti...
 
ADAPT_WINDOWS
The ADAPT_WINDOWS enum.
 
@ Original
Original desktop size, the left-top of the desktop is aligned with the left-top of the window.
 
@ Zoom
zoom windows = desktop size * factor