QTreeWidgetItem::setForeground no longer works with latest KF5

Robin Atwood binro at mailbox.org
Tue Jan 3 17:12:47 GMT 2023


I have made a bare-bones version of my code and guess what: it won't link! I get messages:
 
/usr/src/dev/kde4/qtwitest/src/main.cpp:17: undefined reference to `vtable for QtwiTest' 
 
This is usually caused by not supplying a constructor body, but I have done that. Can anyone see what is wrong?
 
     #include <QApplication>
     #include <QMainWindow>
     #include <QTreeWidget>
     #include <KXmlGuiWindow>
     #include <KLocalizedString>
     class QtwiTest : public KXmlGuiWindow
     {
     Q_OBJECT
     public:
     QtwiTest();
     virtual ~QtwiTest();
     };
     QtwiTest::QtwiTest()
     {
     }
     QtwiTest::~QtwiTest()
     {
     }

     int main(int argc, char **argv)
     {
     QApplication app(argc, argv);
     KLocalizedString::setApplicationDomain("qtwi");
     QtwiTest mv;
     QTreeWidget tw( &mv );
     QTreeWidgetItem twi( &tw );
     QBrush fb( Qt::red );

     mv.setCentralWidget( &tw );
     mv.setCaption( "QTreeWidget Test", false );
     twi.setText( 0, "Line 1");
     twi.setForeground( 0, fb );
     tw.show();

     return app.exec();
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-devel/attachments/20230104/4241e26c/attachment.htm>


More information about the kde-devel mailing list