[QScintilla] block selection

Petr Vanek petr at scribus.info
Wed Dec 17 08:55:43 GMT 2008


hi all,

I'd like to implement a "block selection" feature in my editor.
Unfortunately it does not switch the mode as required - the stream mode is
always used.

Envirionment: Qt4, C++, Suse Linux, QScintilla 2.3 rpm from Packman
repository.

Testcase: I modified example-Qt4 from QScintilla bundle (add action to menu,
its connect and slot). The slot is listed:

void MainWindow::handleSelection()
{
    // switch selection mode 
    int sel =
textEdit->SendScintilla(QsciScintillaBase::SCI_GETSELECTIONMODE);
    textEdit->SendScintilla(QsciScintillaBase::SCI_SETSELECTIONMODE,
                            sel==QsciScintillaBase::SC_SEL_STREAM
                                                  ?
QsciScintillaBase::SC_SEL_RECTANGLE
                                                  :
QsciScintillaBase::SC_SEL_STREAM);
}

it looks like there is always Stream mode in this minimal example.

Well, maybe I'm calling SendScintilla with wrong parameters but (based on
Scintilla docs
http://www.scintilla.org/ScintillaDoc.html#SCI_SETSELECTIONMODE
) it looks like the right way.

What should be wrong?

all the best,
Petr Vanek





More information about the QScintilla mailing list