[Qt-creator] [Development] Problem withQtCreator Plugin, ICore::showNewItemDialog

Jakob Lettenbichler jakob.lettenbichler at artech.at
Thu Oct 10 11:19:00 CEST 2019


Hiho,

many thanks for forwarding it!
Sorry for not mentioning it before: This happens on Windows7 (not tested on Win10 yet).

Cheers,
Jakob Lettenbichler

-----Ursprüngliche Nachricht-----
Von: Christian Stenger [mailto:Christian.Stenger at qt.io] 
Gesendet: Mittwoch, 09. Oktober 2019 06:50
An: Jakob Lettenbichler; qt-creator at qt-project.org
Betreff: Re: [Development] Problem withQtCreator Plugin, ICore::showNewItemDialog

Hi,

Moved to the right mailing list and if this is a macOS only issue this should have been fixed ( QTCREATORBUG-22906 )

Best regards,
Christian


________________________________________
From: Development <development-bounces at qt-project.org> on behalf of Jakob Lettenbichler <jakob.lettenbichler at artech.at>
Sent: Tuesday, October 8, 2019 5:55 PM
To: development at qt-project.org
Subject: [Development] Problem withQtCreator Plugin, ICore::showNewItemDialog

Hiho,

This is a QtCreator Plugin question, I hope that's the correct mailing list fort hat...


I have a QtCreatorPlugin that shall open some wizard if the QtCreator is started via command line passing an argument.
That works for me as expected, everything is fine, except that sometimes the Wizard then lies behind the QtCreator window and sometimes it is in front of it (racing condition?).
The relevant code parts are:

bool HMIProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorString)
{
    if (arguments.count(QLatin1String("-newhmiproject")) != 0)
        m_autoStartNewProject = true;
   [...]
}

void HMIProjectManagerPlugin::extensionsInitialized()
{
    if (!m_autoStartNewProject) return;
    using namespace Core;
    QList<IWizardFactory*> allfactories = IWizardFactory::allWizardFactories();
    QList<IWizardFactory*> ourFactory;
    auto ourMimeType = Id(Constants::HMI_PROJECT_ID);
    bool found = false;
    for(auto* fac : allfactories) {
        auto supported = fac->supportedProjectTypes();
        if (!(supported.contains(ourMimeType)))
            continue;
        found = true;
        ourFactory << fac;
    }
    if (!found) return;

    ICore::showNewItemDialog(tr("New HMI Project", "New HMI Project"), ourFactory);
}


I am currently using Qt5.9 and the QtCreator version 4.4.1 (unfortunately I am stuck to these versions unless there are some very good reasons for an upgrade, since the last upgrade from QtCreator 4.0 -> 4.4 we did, required a lot of porting work to be done for our QtCreator Plugins).

Any ideas how I could guarantee that the QtCreator window stays behind the Wizard dialog?

Many thanks in advance for replies,

Cheers,
Jakob Lettenbichler
_______________________________________________
Development mailing list
Development at qt-project.org
https://lists.qt-project.org/listinfo/development


More information about the Qt-creator mailing list