mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-23 07:16:15 +00:00
Changed: #1193 code cleanup.
This commit is contained in:
parent
daf2fe51b3
commit
6192d39d50
4 changed files with 71 additions and 72 deletions
|
@ -33,8 +33,8 @@ namespace NLQT
|
|||
|
||||
CColorEditWidget::CColorEditWidget(QWidget *parent)
|
||||
: QWidget(parent),
|
||||
_Wrapper(NULL),
|
||||
_emit(true)
|
||||
_Wrapper(NULL),
|
||||
_emit(true)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
@ -87,8 +87,8 @@ void CColorEditWidget::setRed(int r)
|
|||
{
|
||||
if (_emit)
|
||||
Q_EMIT colorChanged(NLMISC::CRGBA(r, _ui.gSpinBox->value(),
|
||||
_ui.bSpinBox->value(),
|
||||
_ui.aSpinBox->value()));
|
||||
_ui.bSpinBox->value(),
|
||||
_ui.aSpinBox->value()));
|
||||
|
||||
_ui.graphicsWidget->repaint();
|
||||
if (_Wrapper == NULL)
|
||||
|
@ -108,9 +108,9 @@ void CColorEditWidget::setGreen(int g)
|
|||
{
|
||||
if (_emit)
|
||||
Q_EMIT colorChanged(NLMISC::CRGBA(_ui.rSpinBox->value(),
|
||||
g,
|
||||
_ui.bSpinBox->value(),
|
||||
_ui.aSpinBox->value()));
|
||||
g,
|
||||
_ui.bSpinBox->value(),
|
||||
_ui.aSpinBox->value()));
|
||||
_ui.graphicsWidget->repaint();
|
||||
if (_Wrapper == NULL) return;
|
||||
|
||||
|
@ -127,9 +127,9 @@ void CColorEditWidget::setBlue(int b)
|
|||
{
|
||||
if (_emit)
|
||||
Q_EMIT colorChanged(NLMISC::CRGBA(_ui.rSpinBox->value(),
|
||||
_ui.gSpinBox->value(),
|
||||
b,
|
||||
_ui.aSpinBox->value()));
|
||||
_ui.gSpinBox->value(),
|
||||
b,
|
||||
_ui.aSpinBox->value()));
|
||||
_ui.graphicsWidget->repaint();
|
||||
if (_Wrapper == NULL) return;
|
||||
|
||||
|
@ -146,9 +146,9 @@ void CColorEditWidget::setAlpha(int a)
|
|||
{
|
||||
if (_emit)
|
||||
Q_EMIT colorChanged(NLMISC::CRGBA(_ui.rSpinBox->value(),
|
||||
_ui.gSpinBox->value(),
|
||||
_ui.bSpinBox->value(),
|
||||
a));
|
||||
_ui.gSpinBox->value(),
|
||||
_ui.bSpinBox->value(),
|
||||
a));
|
||||
_ui.graphicsWidget->repaint();
|
||||
|
||||
if (_Wrapper == NULL) return;
|
||||
|
|
|
@ -205,7 +205,7 @@ bool CDirectionWidget::eventFilter(QObject *object, QEvent *event)
|
|||
painter.drawText( 10, 15, widget->objectName());
|
||||
painter.setPen(QPen(Qt::red, 2, Qt::SolidLine));
|
||||
painter.drawLine(widget->width() / 2, widget->height() / 2,
|
||||
int((widget->width() / 2) + x * 0.9f * directionSize), int((widget->height() / 2) - _value.z * 0.9f * directionSize));
|
||||
int((widget->width() / 2) + x * 0.9f * directionSize), int((widget->height() / 2) - _value.z * 0.9f * directionSize));
|
||||
break;
|
||||
}
|
||||
case QEvent::MouseButtonDblClick:
|
||||
|
|
|
@ -33,11 +33,19 @@
|
|||
namespace ExtensionSystem
|
||||
{
|
||||
|
||||
CPluginSpec::CPluginSpec():
|
||||
_state(State::Invalid),
|
||||
_hasError(false),
|
||||
_plugin(NULL),
|
||||
_pluginManager(NULL)
|
||||
CPluginSpec::CPluginSpec()
|
||||
: _location(""),
|
||||
_filePath(""),
|
||||
_fileName(""),
|
||||
_name(""),
|
||||
_version(""),
|
||||
_vendor(""),
|
||||
_description(""),
|
||||
_state(State::Invalid),
|
||||
_hasError(false),
|
||||
_errorString(""),
|
||||
_plugin(0),
|
||||
_pluginManager(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -98,16 +106,6 @@ QString CPluginSpec::errorString() const
|
|||
|
||||
bool CPluginSpec::setFileName(const QString &fileName)
|
||||
{
|
||||
_name = _version
|
||||
= _vendor
|
||||
= _description
|
||||
= _location
|
||||
= _filePath
|
||||
= _fileName
|
||||
= "";
|
||||
_state = State::Invalid;
|
||||
_hasError = false;
|
||||
_errorString = "";
|
||||
QFile file(fileName);
|
||||
if (!file.exists())
|
||||
return reportError(QCoreApplication::translate("CPluginSpec", "File does not exist: %1").arg(file.fileName()));
|
||||
|
@ -209,7 +207,7 @@ void CPluginSpec::kill()
|
|||
if (!_plugin)
|
||||
return;
|
||||
delete _plugin;
|
||||
_plugin = NULL;
|
||||
_plugin = 0;
|
||||
_state = State::Deleted;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,6 +96,7 @@ public:
|
|||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue