Calltip can not work on Qt.
CustomSciEdit derived from ScintillaEdit.
// .h file
class CustomSciEdit : public ScintillaEdit
{
Q_OBJECT
public:
CustomSciEdit(QWidget *parent = 0);
private slots:
void charAdded(int ch);
};
//.cpp file
CustomSciEdit::CustomSciEdit(QWidget *parent) : ScintillaEdit(parent)
{
connect(this, SIGNAL(charAdded(int)), SLOT(charAdded(int)));
}
void CustomSciEdit::charAdded(int ch)
{
if (ch == '(') {
callTipSetBack(0xffffff);
callTipSetFore(0);
if (!callTipActive()) {
callTipShow(currentPos(), "abc");
}
}
}
when type '(' in edit window, can only get a blank popup window.
Calltips are not implemented on Qt.
I tried to implement myself. It's look like working well.
Check it out:
Last edit: Alexander Tuzhik 2015-09-13
It draws once and then dies. A new surface should be created for each repaint similar to PartialPaint.
I have modified the Alexander Tuzhik implementation to adapt and work in Qt environment.
I have tested this patch in different project and os, and works properly.
Last edit: Andrea Ricchi 2019-01-20
That works a lot better!
However, the border appears wrong on Windows.

I've reworked the implementation since there was a bug with the mouse click management; here's the code:
About the border issue I've seen a strange behavior:
Currently I don't know if the problem is about Qt or the compiler.
As soon as I can I'll run test with same Qt version and different compilers.
I only ask you if you know about graphic problem like this related to compilers or Qt version.
Last edit: Andrea Ricchi 2019-01-21
Its safer to create a new Surface for each paint in case the underlying graphics environment changes such as a video mode change or scaling change. This is the technique used for the main area of Scintilla. The surface should also be initialized further to ensure correct behaviour with different encodings.
The coding style should match other parts of the Qt platform layer which do not use "m_" member prefixes.
A version with these changes:
The visual problem is more likely to be a change from Qt 5.11 to 5.12 than a compiler issue.
It looks good on macOS.

So I have some new info.
First of all, I updated your code, since the QWidget is transparent for input, the mousePressEvent is useless; and since we are now allocating a new surface, the constructor override is useless too; so I've cleaned a bit the implementation for some tests.
About the border issue. I've tested on Linux and Windows with Qt 5.12.0 and Qt 5.11.3:
So I've done some research hoping to find some big difference, but I've found nothing. Until the end of the
ScintillaBase::CallTipShowthe size and position values are the same. After that, I jumped to theCallTipImpl::paintEventwherein theCallTip::PaintCTI found that the positions acquired fromwCallTip.GetClientPosition()are now different. Take a look at the attachments.At the moment I don't really have any ideas about the problem if you can doublecheck maybe you will be able to find out something.
As soon as I can I'll try to do some more tests.
Last edit: Andrea Ricchi 2019-01-23
Since this change improves behaviour on all operating systems it has been committed with minor whitespace reformatting as [a82b87].
A separate bug [#2076] was added for the problem with Qt 5.12 on Win32.
Related
Bugs: #2076
Commit: [a82b87]
setWindowFlag is only available from Qt 5.9 so added an #if with [ba336a] to avoid this call when building against earlier versions of Qt.
Related
Commit: [ba336a]