25
26
27 connect(
this, &PreviewActionGroup::triggered,
this, &PreviewActionGroup::slotTriggered);
32 QAction *a =
new QAction(
this);
33 a->setObjectName(QString::asprintf(
"__qt_designer_device_%d_action", i));
39 QAction *sep =
new QAction(
this);
40 sep->setObjectName(u"__qt_designer_deviceseparator"_s);
41 sep->setSeparator(
true);
42 sep->setVisible(
false);
45 updateDeviceProfiles();
48 const QStringList styles = QStyleFactory::keys();
51 for (
const auto &s : styles) {
52 QAction *a =
new QAction(tr(
"%1 Style").arg(s),
this);
53 a->setObjectName(
"__qt_designer_style_"_L1 + s +
"_action"_L1);
61 const QDesignerSharedSettings settings(m_core);
62 const auto profiles = settings.deviceProfiles();
63 const auto al = actions();
65 const bool hasProfiles = !profiles.isEmpty();
70 const int maxIndex = qMin(
static_cast<
int>(
MaxDeviceActions), profiles.size());
71 for (; index < maxIndex; index++) {
72 const QString name = profiles.at(index).name();
73 al.at(index)->setText(name);
74 al.at(index)->setVisible(
true);
79 al.at(index)->setVisible(
false);