Search code examples
c++qtqmakeqtguiwwwidgets

Qt 5.2.1 add wwWidgets to a project


I am trying to use wwWidgets under windows with Qt, but I am having some trouble compiling projects with widgets from wwWiget...

The installer run successfully I am using the: standard Qt SDK installations installer. But whenever I try to add QT += wwwidgets to the project file QT gives me the error:

Project ERROR: Unknown module(s) in QT: wwwidgets

Does anyone knows a solution for this?


Solution

  • Qt 5

    Apparently, they do not have proper Qt 5 examples, nor is their buildsystem quite ready for this QT += wwwidgets thing. I think the best would be if you could contribute back to the project by establishing it. It should not be that hard and someone may eventually do that if you do not do it. One example to look at would be QtSerialPort how to implement it properly.

    For the time being, if you do not want to help with this, you could always use LIBS and INCLUDEPATH to work it around, but you may need to drop that when it gets properly implemented in the module.

    Qt 4

    As their examples show, you will need to use the following in your qmake project file:

    CONFIG += wwwidgets
    

    For further details, check their usage on the main page, as well:

    Usage

    Usage of wwWidgets in your projects is trivial. Once you install the package on your system all you have to do is to add the following line to your project (.pro) file: CONFIG+=wwwidgets Just remember to run qmake afterwards. From now on you can use wwWidgets includes and classes in your project.

    #include <QApplication>
    #include <QwwRichTextButton>
    
    int main(int argc, char **argv){
      QApplication app(argc, argv);
      QwwRichTextButton b;
      b.setText("<B>Hello</B> <font color='red'>world</font>");
      b.show();
      return app.exec();
    }
    

    When distributing the project, remember to deploy the widget library with it along regular Qt libs.