Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEMenuButton labelText and font properties #1

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configure/RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ BUNDLE=
QE_FRAMEWORK=$(BUNDLE)/gui/qeframework

# EPICS_BASE usually appears last so other apps can override stuff:
#
EPICS_BASE=$(BUNDLE)/epics/base
#EPICS_BASE=$(BUNDLE)/epics/base
EPICS_BASE=/usr/local/epics/R3.14.12/base

# end
32 changes: 31 additions & 1 deletion qeframeworkSup/project/widgets/QEMenuButton/QEMenuButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ QEMenuButton::QEMenuButton (QWidget* parent) : QEAbstractWidget (parent)
this->setVariableAsToolTip (false);
this->setDisplayAlarmStateOption (DISPLAY_ALARM_STATE_NEVER);

this->button->setText ("MenuButton");
setLabelTextProperty(getLabelTextProperty());
this->button->setFont(font());
//this->button->setText ("MenuButton");

// Null menu specification.
//
Expand Down Expand Up @@ -270,6 +272,34 @@ QString QEMenuButton::getSubstitutionsProperty () const
return this->getVariableNameSubstitutions ();
}

//------------------------------------------------------------------------------
//
void QEMenuButton::setLabelTextProperty( QString labelTextIn )
{
this->button->setText (labelTextIn);
}

//------------------------------------------------------------------------------
//
QString QEMenuButton::getLabelTextProperty()
{
return this->button->text();
}

//------------------------------------------------------------------------------
//
void QEMenuButton::setFont(const QFont &f)
{
button->setFont(f);
}

//------------------------------------------------------------------------------
//
const QFont& QEMenuButton::font() const
{
return button->font();
}

//------------------------------------------------------------------------------
//
void QEMenuButton::setMenuString (const QString& menuStringIn)
Expand Down
14 changes: 14 additions & 0 deletions qeframeworkSup/project/widgets/QEMenuButton/QEMenuButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class QE_FRAMEWORK_LIBRARY_SHARED_EXPORT QEMenuButton : public QEAbstractWidget
//
Q_PROPERTY (QString defaultSubstitutions READ getSubstitutionsProperty WRITE setSubstitutionsProperty)

/// Label Text
Q_PROPERTY(QString labelText READ getLabelTextProperty WRITE setLabelTextProperty)

/// Font
Q_PROPERTY(QFont font READ font WRITE setFont)

// This property stores the user info.
// The "Edit User Info..." context menu item must be used to edit this.
/// Specifies the menu entry values, encoded and an XML string.
Expand All @@ -85,6 +91,14 @@ class QE_FRAMEWORK_LIBRARY_SHARED_EXPORT QEMenuButton : public QEAbstractWidget
void setSubstitutionsProperty (const QString& substitutions);
QString getSubstitutionsProperty () const;

// Label text must be mapped to the button
void setLabelTextProperty( QString labelTextIn );
QString getLabelTextProperty();

// Font must be mapped to the button
void setFont(const QFont &);
const QFont & font() const;

void setMenuString (const QString& s);
QString getMenuString () const;

Expand Down
4 changes: 2 additions & 2 deletions qeframeworkSup/project/widgets/QERadioGroup/QERadioGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ QERadioGroup::QERadioGroup (QWidget* parent) :
QEAbstractWidget (parent),
QESingleVariableMethods (this, PV_VARIABLE_INDEX)
{
this->commonSetup (" QERadioGroup ");
this->commonSetup ("");
}

//-----------------------------------------------------------------------------
Expand All @@ -53,7 +53,7 @@ QERadioGroup::QERadioGroup (const QString& variableNameIn, QWidget* parent) :
QEAbstractWidget (parent),
QESingleVariableMethods (this, PV_VARIABLE_INDEX)
{
this->commonSetup (" QERadioGroup ");
this->commonSetup ("");
this->setVariableName (variableNameIn, PV_VARIABLE_INDEX);
activate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// Constructor with no initialisation
//
QRadioGroup::QRadioGroup (QWidget* parent) :
QGroupBox (" QRadioGroup ", parent)
QGroupBox (parent)
{
this->commonSetup ();
}
Expand Down
11 changes: 11 additions & 0 deletions qepluginApp/project/QEMenuButton/QEMenuButtonManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@
#ifndef QE_MENU_BUTTON_MANAGER_H
#define QE_MENU_BUTTON_MANAGER_H

// The QT_VERSION check is in QEDesignerPluginCommon.h, but does not
// work with moc unless restated here. Possibly relevant:
// https://stackoverflow.com/questions/4119688/macro-expansion-in-moc
// Provide Qt version independent plugin-related includes.
//
#if (QT_VERSION >= 0x050500)
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
#else
#include <QDesignerCustomWidgetInterface>
#endif

#include <QEDesignerPluginCommon.h>
#include <QDesignerTaskMenuExtension>
#include <QEPluginLibrary_global.h>
Expand Down
11 changes: 11 additions & 0 deletions qepluginApp/project/QEPeriodic/QEPeriodicManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
#ifndef QE_PERIODIC_MANAGER_H
#define QE_PERIODIC_MANAGER_H

// The QT_VERSION check is in QEDesignerPluginCommon.h, but does not
// work with moc unless restated here. Possibly relevant:
// https://stackoverflow.com/questions/4119688/macro-expansion-in-moc
// Provide Qt version independent plugin-related includes.
//
#if (QT_VERSION >= 0x050500)
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
#else
#include <QDesignerCustomWidgetInterface>
#endif

#include <QEDesignerPluginCommon.h>
#include <QEPluginLibrary_global.h>

Expand Down
11 changes: 11 additions & 0 deletions qepluginApp/project/qeplugin/QEPluginWidgetManagers.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
#ifndef QE_PLUGIN_WIDGET_MANAGERS_H
#define QE_PLUGIN_WIDGET_MANAGERS_H

// The QT_VERSION check is in QEDesignerPluginCommon.h, but does not
// work with moc unless restated here. Possibly relevant:
// https://stackoverflow.com/questions/4119688/macro-expansion-in-moc
// Provide Qt version independent plugin-related includes.
//
#if (QT_VERSION >= 0x050500)
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
#else
#include <QDesignerCustomWidgetInterface>
#endif

#include <QObject>
#include <QEDesignerPluginCommon.h>
#include <QEPluginLibrary_global.h>
Expand Down