i am happy to have found a project like CopperSpice. Really grateful. My application will heavily make use of graphing and displaying waveforms, so i need a useful plotting widget. I chose Qwt, because.. no alternative under LGPL (afaik).
If this translation works, i am willing to share the resulting Qwt here, but i am new to OpenSource in this regard and I surely cant test every aspect.. but i guess its better to start somewhere in between for anyone else rather than starting from scratch.
I am totally new to this, and i am struggling extremely. See this as a log, help if you feel you can help

- many CS_PROPERTY_READ / CS_PROPERTY_WRITE macros ended up on the same line; this somehow confused the compiler.
- qSport, qUpperBound, qLowerBound... do not exist. Ok. Using STL-Replacement as documented. But CS is C++17, so std::ranges are not available which would be the true replacement[
- WHAT IS GOING ON with overloaded slots???
Code: Select all
CS_SLOT_1(Public, void setText(const QString & un_named_arg1,QwtText::TextFormat textFormat = QwtText::AutoText)) CS_SLOT_2(setText) CS_SLOT_1(Public, virtual void setText(const QwtText & un_named_arg1)) CS_SLOT_2(setText)
Ok..? The alternative CS_SLOT_OVERLOAD does not work for more than one argument i guess?The mighty gcc @ CS_SLOT_2(setText) wrote:no matching function for call to ‘QMetaObject_T<QwtTextLabel>::register_method(const char [8], <unresolved overloaded function type>, QMetaMethod::MethodType, const char [95], QMetaMethod::Access&)’
So I invented[should probably be renamed to CS_SLOT2overloaded() or something]Code: Select all
#define CS_SLOT_2x(slotName, ...) \ const_cast<QMetaObject_T<cs_class>&>(cs_class::staticMetaObject()).register_method( \ #slotName #__VA_ARGS__ , static_cast<void (cs_class::*)(__VA_ARGS__)>(&cs_class::slotName), QMetaMethod::Slot, va_args, accessType); \ \ cs_regTrigger(cs_number<cntValue + 1>{} ); \ }
and now I usewhich seems to compile (?)Code: Select all
CS_SLOT_1(Public, void setText(const QString & un_named_arg1,QwtText::TextFormat textFormat = QwtText::AutoText)) CS_SLOT_2x(setText, const QString &, QwtText::TextFormat) CS_SLOT_1(Public, virtual void setText(const QwtText & un_named_arg1)) CS_SLOT_2x(setText, const QwtText &)
- Arrrrgh nooh.. same issue at CS_SIGNAL_2 ??
Ok. Using CS_SIGNAL_OVERLOAD(..) with the argument types in round brackets - QString.setNum().. simply not there. I am using QString{QByteArray{}.setNum( ...)}
- QString.sprintf(...) simply not there. No idea about a replacement
- The 1.7.0 Overhaul of QVariant creates a lot of work for Variants. Helper functions such as qVariantSetValue or qvariant_cast should not have been removed (imho)
My thought is: yes, i understand there is a better way. But I also think as fork of something much bigger with much more infrastructure one should try to minimize migration hurdles. Declare them deprecated, (resulting in a warning) but a static_assert is harsh! - "connect" cannot be called within a const-member function as it self is not const.
Unfortunately it crashes. And unfortunately i come from an embedded development background. No Idea what is going on

I mean, its clear that new crashes, but i dont know why. Debugger only shows assembly beyond what i marked with "----------". Nothing noteworthy abouttcache_get 0x00007f7028b93277
__GI___libc_malloc 0x00007f7028b93277
operator new(unsigned long) 0x00007f7029548d55
QFontEngineFT::loadGlyph(QFontEngineFT::QGlyphSet*, unsigned int, QFixed, QFontEngine::GlyphFormat, bool) const 0x00007f702bb270bf
QFontEngineFT::loadGlyphFor(unsigned int, QFixed, QFontEngine::GlyphFormat, QTransform const&, bool) 0x00007f702bb2a2be
QFontEngineFT::lockedAlphaMapForGlyph(unsigned int, QFixed, QFontEngine::GlyphFormat, QTransform const&, QPoint*) 0x00007f702bb2b57b
QRasterPaintEngine::drawCachedGlyphs(int, unsigned int const*, QFixedPoint const*, QFontEngine*) 0x00007f702b9eb026
QRasterPaintEngine::drawTextItem(QPointF const&, QTextItem const&) 0x00007f702b9ede46
QPainterPrivate::drawTextItem(QPointF const&, QTextItem const&, QTextEngine*) 0x00007f702b9901f5
QTextLine::draw(QPainter*, QPointF const&, QTextLayout::FormatRange const*) const 0x00007f702bd17e71
qt_format_text(QFont const&, QRectF const&, int, QTextOption const*, QString8 const&, QRectF*, int, int*, int, QPainter*) 0x00007f702b985256
QPainter::drawText(QRectF const&, int, QString8 const&, QRectF*) 0x00007f702b98b4cd
-----------------------
QwtPainter::drawText qwt_painter.cpp:371
QwtPlainTextEngine::draw qwt_text_engine.cpp:229
QwtText::draw qwt_text.cpp:615
QwtPlotMarker::drawLabel qwt_plot_marker.cpp:335
....
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x00007f7029c7c017
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) 0x00007f7029c7c456
QCoreApplication::exec() 0x00007f7029c77176
main main.cpp:210
__libc_start_main 0x00007f7028b1db97
_start 0x0000564e59bd031a
painter->drawText( rect, flags, text );
Code: Select all
void QwtPainter::drawText( QPainter *painter, const QRectF &rect,
int flags, const QString &text )
{
painter->save();
qwtUnscaleFont( painter );
painter->drawText( rect, flags, text );
painter->restore();
}
Yeah, somehow the whole QPainter interface is broken. When commenting out crashing code.. i ended up crahsing within "QPainter painter( this );"
I dont see how this could fail. But again, impossible to debug based on assembly beyond a certain point.
I will try to remove any unnecessary code and upload a zip. Maybe someone could have a look?
