[Qt-creator] Custom plugin for drivers building. Unnecessary custom Tool Chains showing.

Denis Shienkov scapig2 at yandex.ru
Fri Jan 27 15:00:51 CET 2012


Hi.

I decided to create a plugin for the assembly of the drivers in Qt Creator.
The project has only just begun: https://gitorious.org/qt-creator-drivers-builder-project-manager-plugin

Are currently stored in the repository plug-in two parts: to build Linux and Windows drivers separately.
At the moment I'm more interested in the plug-in for Windows.

At the moment I have a problem with displaying the list of available ToolChains (WDK).

The problem is that in the source QtCreator (2.4) in the file \plugins\projectexplorer\toolchainoptionspage.cpp

ToolChainModel::ToolChainModel(QWidget *configWidgetParent, QObject *parent)
{
    ...
    ...
    foreach (ToolChain *tc, ToolChainManager::instance()->toolChains()) {
        addToolChain(tc);
    }
}

ie This model shows all the registered QtCreator tool chains, including custom (that derived from base class ToolChain).

And he showed it all on one page: Tools->Options->Build&Run->ToolChains tab.

But I do not need. I created a custom OptionsPage, which appears as an additional tab "WinDrv Toolchains" (for example, by analogy with the General, Qt Versions, CMake tabs).
I planned that I will show all available Windows Drivers tool chains only in their own tab  "WinDrv Toolchains".

In principle, a model in my plugin:

WinDrvToolChainModel::WinDrvToolChainModel(QWidget *configWidgetParent, QObject *parent)
{
    ...
    ...
    foreach (ToolChain *tc, ToolChainManager::instance()->toolChains()) {

        // Here i can filter needed tool chains to show
        // Example by ID

        if (tc->id == WINDRV_TOOLCHAIN_ID)
           addToolChain(tc);
    }
}

I can weed out the (filtered out) tool chains by the identifier (eg I do not need a standard tool chains, which are found QtCreator) .
I need only "my" WDK tool chains!


How can I solve this problem?

Maybe you need to fix in the source model in its QtCreator \plugins\projectexplorer\toolchainoptionspage.cpp ?

i.e.

ToolChainModel::ToolChainModel(QWidget *configWidgetParent, QObject *parent)
{
    ...
    ...
    foreach (ToolChain *tc, ToolChainManager::instance()->toolChains()) {
+      if (tc->id == XXX)        
            addToolChain(tc);
    }
}

??

Best regards,
Denis.









More information about the Qt-creator mailing list