VirtualBox

Ignore:
Timestamp:
Mar 27, 2008 1:21:57 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt4: Ported console window to qt4.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h

    r7512 r7590  
    2626
    2727/* Qt includes */
    28 #include <q3scrollview.h>
     28#include <QAbstractScrollArea>
     29#include <QScrollBar>
    2930
    3031#if defined (Q_WS_PM)
     
    4647class QMenuData;
    4748
    48 class VBoxConsoleView : public Q3ScrollView
     49class VBoxConsoleView : public QAbstractScrollArea
    4950{
    5051    Q_OBJECT
     
    6465                     const CConsole &console,
    6566                     VBoxDefs::RenderMode rm,
    66                      QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0);
     67                     QWidget *parent = 0);
    6768    ~VBoxConsoleView();
    6869
     
    9596
    9697    QRect getDesktopGeometry();
     98
     99    /* todo: This are some support functions for the qt4 port. Maybe we get rid
     100     * of them some day. */
     101    int contentsX() const { return horizontalScrollBar()->value(); }
     102    int contentsY() const { return verticalScrollBar()->value(); }
     103    int contentsWidth() const;
     104    int contentsHeight() const;
     105    int visibleWidth() const { return horizontalScrollBar()->pageStep(); }
     106    int visibleHeight() const { return verticalScrollBar()->pageStep(); }
     107    void scrollBy (int dx, int dy)
     108    {
     109        horizontalScrollBar()->setValue (horizontalScrollBar()->value() + dx);
     110        verticalScrollBar()->setValue (verticalScrollBar()->value() + dy);
     111    }
     112    QPoint viewportToContents ( const QPoint & vp ) const
     113    {
     114        return QPoint (vp.x() + contentsX(),
     115                       vp.y() + contentsY());
     116    }
     117    void updateSliders();
    97118
    98119signals:
     
    141162    bool mouseEvent (int aType, const QPoint &aPos, const QPoint &aGlobalPos,
    142163                     Qt::ButtonState aButton,
    143                      Qt::ButtonState aState, Qt::ButtonState aStateAfter,
     164                     Qt::MouseButtons aButtons, Qt::KeyboardModifiers aModifiers,
    144165                     int aWheelDelta, Qt::Orientation aWheelDir);
    145166
     
    162183    void doRefresh();
    163184
    164     void viewportPaintEvent( QPaintEvent * );
     185    void resizeEvent (QResizeEvent *);
     186    void paintEvent (QPaintEvent *);
    165187#ifdef VBOX_GUI_USE_REFRESH_TIMER
    166188    void timerEvent( QTimerEvent * );
     
    170192    void captureMouse (bool aCapture, bool aEmitSignal = true);
    171193
    172     bool processHotKey (const QKeySequence &key, QMenuData *data);
     194    bool processHotKey (const QKeySequence &key, const QList<QAction*>& data);
    173195    void updateModifiers (bool fNumLock, bool fCapsLock, bool fScrollLock);
    174196
     
    235257    long muCapsLockAdaptionCnt;
    236258
    237     QTimer *resize_hint_timer;
    238259    QTimer *mToggleFSModeTimer;
    239260
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette