int CPicFlowWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: LeftArrowReleased(); break;
        case 1: RightArrowReleased(); break;
        case 2: scrollBarVal((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: DecrementVal((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 4: IncrementVal((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 5: StartVal((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 6: SetItemClickedHF((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 7: GetImages((*reinterpret_cast< QList<QImage>(*)>(_a[1]))); break;
        case 8: ShowSlide((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 9: moveScrollBarLeft(); break;
        case 10: moveScrollBarRight(); break;
        case 11: scrollBarReleased(); break;
        case 12: GetItemClickedHF((*reinterpret_cast< int(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 13;
    }
    return _id;
}
Esempio n. 2
0
ClientTextEdit::ClientTextEdit(QWidget* parent) : QTextEdit(parent) {
    setReadOnly(true);
    setOverwriteMode(true);
    setUndoRedoEnabled(false);
    setDocumentTitle("mClient");
    setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
    setTabChangesFocus(false);

    //_doc->setMaximumBlockCount(Config().scrollbackSize); // max number of lines?
    document()->setUndoRedoEnabled(false);
    QTextFrame* frame = document()->rootFrame();
    _cursor = frame->firstCursorPosition();

    // Default Colors
    _foregroundColor = Qt::lightGray;
    _backgroundColor = Qt::black;
    _blackColor = Qt::darkGray;
    _redColor = Qt::darkRed;
    _greenColor = Qt::darkGreen;
    _yellowColor = Qt::darkYellow;
    _blueColor = Qt::darkBlue;
    _magentaColor = Qt::darkMagenta;
    _cyanColor = Qt::darkCyan;
    _grayColor = Qt::lightGray;
    _darkGrayColor = Qt::gray;
    _brightRedColor = Qt::red;
    _brightGreenColor = Qt::green;
    _brightYellowColor = Qt::yellow;
    _brightBlueColor = Qt::blue;
    _brightMagentaColor = Qt::magenta;
    _brightCyanColor = Qt::cyan;
    _whiteColor = Qt::white;
    // Default Fonts
    _serverOutputFont = QFont("Monospace", 10);
    _inputLineFont = QFont("Monospace", 10); //QApplication::font();
    _serverOutputFont.setStyleHint(QFont::TypeWriter, QFont::PreferAntialias);

    QTextFrameFormat frameFormat = frame->frameFormat();
    frameFormat.setBackground(_backgroundColor);
    frameFormat.setForeground(_foregroundColor);
    frame->setFrameFormat(frameFormat);

    _format = _cursor.charFormat();
    setDefaultFormat(_format);
    _defaultFormat = _format;
    _cursor.setCharFormat(_format);

    QFontMetrics fm(_serverOutputFont);
    setTabStopWidth(fm.width(" ") * 8); // A tab is 8 spaces wide
    QScrollBar* scrollbar = verticalScrollBar();
    scrollbar->setSingleStep(fm.leading()+fm.height());

    connect(scrollbar, SIGNAL(sliderReleased()), 
                this, SLOT(scrollBarReleased()));

    previous = 0;
}