2022-03-26

Qt Designer Custom Widget Plugin Changing the Displayed Name and accessing custom Enums in Designer

I have created a Custom Widget Plugin and have a series of questions that I am hoping to get some insight on.

In the plugin onset's the class name in the name method which also must match what is in the widget class. That makes sense.

QString AnalogClockPlugin::name() const
{
    return QStringLiteral("AnalogClock");
}

QString AnalogClockPlugin::domXml() const
{
    return " <widget class=\"AnalogClock\" name=\"analogClock\">\n"
            "</ui>\n";
}

However, in Designer one sees "AnalogClock." Is there a way to have it be "Analog Clock" with a space or is one stuck just having the class name displayed? In looking through the examples and docs I am not able to find anything.

Second question, say one wants the user to be able to select the type of hands for the clock. For instance, Micky Mouse hands vs Mini Mouse hands. I have set up the enums and everything works in the widget. How does one communicate that to Designer ?? So it shows up in the Designer properties?? Again. in looking through the examples and docs I am not able to find anything.



No comments:

Post a Comment