- enhancement: paint color editor use system palette's disabled group color
- fix: add watch not work when there's no editor openned; - enhancement: rainbow parenthesis - enhancement: run executable with parameters
This commit is contained in:
parent
ad5b3f5e28
commit
77356215aa
5
NEWS.md
5
NEWS.md
|
@ -0,0 +1,5 @@
|
|||
Version 0.2
|
||||
- enhancement: paint color editor use system palette's disabled group color
|
||||
- fix: add watch not work when there's no editor openned;
|
||||
- enhancement: rainbow parenthesis
|
||||
- enhancement: run executable with parameters
|
|
@ -78,7 +78,7 @@ void ExecutableRunner::run()
|
|||
break;
|
||||
}
|
||||
if (errorOccurred) {
|
||||
qDebug()<<"process error:"<<process.error();
|
||||
//qDebug()<<"process error:"<<process.error();
|
||||
switch (process.error()) {
|
||||
case QProcess::FailedToStart:
|
||||
emit runErrorOccurred(tr("The runner process '%1' failed to start.").arg(mFilename));
|
||||
|
|
|
@ -2771,9 +2771,33 @@ void Editor::applySettings()
|
|||
}
|
||||
}
|
||||
|
||||
static PSynHighlighterAttribute createRainbowAttribute(const QString& attrName, const QString& schemeName, const QString& schemeItemName) {
|
||||
PColorSchemeItem item = pColorManager->getItem(schemeName,schemeItemName);
|
||||
if (item) {
|
||||
PSynHighlighterAttribute attr = std::make_shared<SynHighlighterAttribute>(attrName);
|
||||
attr->setForeground(item->foreground());
|
||||
attr->setBackground(item->background());
|
||||
return attr;
|
||||
}
|
||||
return PSynHighlighterAttribute();
|
||||
}
|
||||
void Editor::applyColorScheme(const QString& schemeName)
|
||||
{
|
||||
SynEditorOptions options = getOptions();
|
||||
options.setFlag(SynEditorOption::eoShowRainbowColor, pSettings->editor().rainbowParenthesis());
|
||||
setOptions(options);
|
||||
highlighterManager.applyColorScheme(highlighter(),schemeName);
|
||||
if (pSettings->editor().rainbowParenthesis()) {
|
||||
PSynHighlighterAttribute attr0 =createRainbowAttribute(COLOR_SCHEME_BRACE_1,
|
||||
schemeName,COLOR_SCHEME_BRACE_1);
|
||||
PSynHighlighterAttribute attr1 =createRainbowAttribute(COLOR_SCHEME_BRACE_2,
|
||||
schemeName,COLOR_SCHEME_BRACE_2);
|
||||
PSynHighlighterAttribute attr2 =createRainbowAttribute(COLOR_SCHEME_BRACE_3,
|
||||
schemeName,COLOR_SCHEME_BRACE_3);
|
||||
PSynHighlighterAttribute attr3 =createRainbowAttribute(COLOR_SCHEME_BRACE_4,
|
||||
schemeName,COLOR_SCHEME_BRACE_4);
|
||||
setRainbowAttrs(attr0,attr1,attr2,attr3);
|
||||
}
|
||||
PColorSchemeItem item = pColorManager->getItem(schemeName,COLOR_SCHEME_ACTIVE_LINE);
|
||||
if (item) {
|
||||
setActiveLineColor(item->background());
|
||||
|
|
|
@ -931,7 +931,11 @@ void MainWindow::runExecutable(const QString &exeName,const QString &filename)
|
|||
showMinimized();
|
||||
}
|
||||
updateAppTitle();
|
||||
mCompilerManager->run(exeName,"",QFileInfo(exeName).absolutePath());
|
||||
if (pSettings->executor().useParams()) {
|
||||
mCompilerManager->run(exeName,pSettings->executor().params(),QFileInfo(exeName).absolutePath());
|
||||
} else {
|
||||
mCompilerManager->run(exeName,"",QFileInfo(exeName).absolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::runExecutable()
|
||||
|
@ -2649,12 +2653,12 @@ void MainWindow::on_actionAdd_Watch_triggered()
|
|||
{
|
||||
QString s = "";
|
||||
Editor *e = mEditorList->getEditor();
|
||||
if (e==nullptr)
|
||||
return;
|
||||
if (e->selAvail()) {
|
||||
s = e->selText();
|
||||
} else {
|
||||
s = e->WordAtCursor();
|
||||
if (e!=nullptr) {
|
||||
if (e->selAvail()) {
|
||||
s = e->selText();
|
||||
} else {
|
||||
s = e->WordAtCursor();
|
||||
}
|
||||
}
|
||||
bool isOk;
|
||||
s=QInputDialog::getText(this,
|
||||
|
|
|
@ -1092,6 +1092,10 @@
|
|||
</property>
|
||||
</action>
|
||||
<action name="actionOptions">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/images/newlook24/061-rebuild.png</normaloff>:/icons/images/newlook24/061-rebuild.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Options</string>
|
||||
</property>
|
||||
|
|
|
@ -3292,6 +3292,26 @@ void SynEdit::onScrolled(int)
|
|||
invalidate();
|
||||
}
|
||||
|
||||
const PSynHighlighterAttribute &SynEdit::rainbowAttr3() const
|
||||
{
|
||||
return mRainbowAttr3;
|
||||
}
|
||||
|
||||
const PSynHighlighterAttribute &SynEdit::rainbowAttr2() const
|
||||
{
|
||||
return mRainbowAttr2;
|
||||
}
|
||||
|
||||
const PSynHighlighterAttribute &SynEdit::rainbowAttr1() const
|
||||
{
|
||||
return mRainbowAttr1;
|
||||
}
|
||||
|
||||
const PSynHighlighterAttribute &SynEdit::rainbowAttr0() const
|
||||
{
|
||||
return mRainbowAttr0;
|
||||
}
|
||||
|
||||
bool SynEdit::caretUseTextColor() const
|
||||
{
|
||||
return mCaretUseTextColor;
|
||||
|
@ -5238,6 +5258,14 @@ bool SynEdit::isIdentChar(const QChar &ch)
|
|||
}
|
||||
}
|
||||
|
||||
void SynEdit::setRainbowAttrs(const PSynHighlighterAttribute &attr0, const PSynHighlighterAttribute &attr1, const PSynHighlighterAttribute &attr2, const PSynHighlighterAttribute &attr3)
|
||||
{
|
||||
mRainbowAttr0 = attr0;
|
||||
mRainbowAttr1 = attr1;
|
||||
mRainbowAttr2 = attr2;
|
||||
mRainbowAttr3 = attr3;
|
||||
}
|
||||
|
||||
void SynEdit::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
if (mPainterLock>0)
|
||||
|
|
|
@ -256,7 +256,10 @@ public:
|
|||
bool PointToLine(const QPoint& point, int& line);
|
||||
bool isIdentChar(const QChar& ch);
|
||||
|
||||
|
||||
void setRainbowAttrs(const PSynHighlighterAttribute &attr0,
|
||||
const PSynHighlighterAttribute &attr1,
|
||||
const PSynHighlighterAttribute &attr2,
|
||||
const PSynHighlighterAttribute &attr3);
|
||||
// setter && getters
|
||||
int topLine() const;
|
||||
void setTopLine(int value);
|
||||
|
@ -351,6 +354,14 @@ public:
|
|||
bool caretUseTextColor() const;
|
||||
void setCaretUseTextColor(bool newCaretUseTextColor);
|
||||
|
||||
const PSynHighlighterAttribute &rainbowAttr0() const;
|
||||
|
||||
const PSynHighlighterAttribute &rainbowAttr1() const;
|
||||
|
||||
const PSynHighlighterAttribute &rainbowAttr2() const;
|
||||
|
||||
const PSynHighlighterAttribute &rainbowAttr3() const;
|
||||
|
||||
signals:
|
||||
void linesDeleted(int FirstLine, int Count);
|
||||
void linesInserted(int FirstLine, int Count);
|
||||
|
@ -576,6 +587,11 @@ private:
|
|||
QColor mSelectedForeground;
|
||||
QColor mSelectedBackground;
|
||||
QColor mCaretColor;
|
||||
PSynHighlighterAttribute mRainbowAttr0;
|
||||
PSynHighlighterAttribute mRainbowAttr1;
|
||||
PSynHighlighterAttribute mRainbowAttr2;
|
||||
PSynHighlighterAttribute mRainbowAttr3;
|
||||
|
||||
bool mCaretUseTextColor;
|
||||
QColor mActiveLineColor;
|
||||
PSynEditUndoList mUndoList;
|
||||
|
|
|
@ -681,20 +681,23 @@ void SynEditTextPainter::GetBraceColorAttr(int level, PSynHighlighterAttribute &
|
|||
return;
|
||||
if (attr != edit->mHighlighter->symbolAttribute())
|
||||
return;
|
||||
PSynHighlighterAttribute oldAttr = attr;
|
||||
switch(level % 4) {
|
||||
case 0:
|
||||
attr = edit->mHighlighter->keywordAttribute();
|
||||
attr = edit->mRainbowAttr0;
|
||||
break;
|
||||
case 1:
|
||||
attr = edit->mHighlighter->symbolAttribute();
|
||||
attr = edit->mRainbowAttr1;
|
||||
break;
|
||||
case 2:
|
||||
attr = edit->mHighlighter->stringAttribute();
|
||||
attr = edit->mRainbowAttr2;
|
||||
break;
|
||||
case 3:
|
||||
attr = edit->mHighlighter->identifierAttribute();
|
||||
attr = edit->mRainbowAttr3;
|
||||
break;
|
||||
}
|
||||
if (!attr)
|
||||
attr = oldAttr;
|
||||
}
|
||||
|
||||
void SynEditTextPainter::PaintLines()
|
||||
|
|
|
@ -460,6 +460,16 @@ void Settings::Editor::setCaretUseTextColor(bool newUseIdentifierColor)
|
|||
mCaretUseTextColor = newUseIdentifierColor;
|
||||
}
|
||||
|
||||
bool Settings::Editor::rainbowParenthesis() const
|
||||
{
|
||||
return mRainbowParenthesis;
|
||||
}
|
||||
|
||||
void Settings::Editor::setRainbowParenthesis(bool newRainbowParenthesis)
|
||||
{
|
||||
mRainbowParenthesis = newRainbowParenthesis;
|
||||
}
|
||||
|
||||
int Settings::Editor::rightEdgeWidth() const
|
||||
{
|
||||
return mRightEdgeWidth;
|
||||
|
@ -933,6 +943,7 @@ void Settings::Editor::doSave()
|
|||
|
||||
//color scheme
|
||||
saveValue("color_scheme", mColorScheme);
|
||||
saveValue("rainbow_parenthesis",mRainbowParenthesis);
|
||||
|
||||
//Symbol Completion
|
||||
saveValue("complete_symbols", mCompleteSymbols);
|
||||
|
@ -1032,6 +1043,7 @@ void Settings::Editor::doLoad()
|
|||
|
||||
//color
|
||||
mColorScheme = stringValue("color_scheme", "VS Code");
|
||||
mRainbowParenthesis = boolValue("rainbow_parenthesis", true);
|
||||
|
||||
//Symbol Completion
|
||||
mCompleteSymbols = boolValue("complete_symbols",true);
|
||||
|
@ -2521,10 +2533,54 @@ void Settings::Executor::setMinimizeOnRun(bool minimizeOnRun)
|
|||
mMinimizeOnRun = minimizeOnRun;
|
||||
}
|
||||
|
||||
bool Settings::Executor::useParams() const
|
||||
{
|
||||
return mUseParams;
|
||||
}
|
||||
|
||||
void Settings::Executor::setUseParams(bool newUseParams)
|
||||
{
|
||||
mUseParams = newUseParams;
|
||||
}
|
||||
|
||||
const QString &Settings::Executor::params() const
|
||||
{
|
||||
return mParams;
|
||||
}
|
||||
|
||||
void Settings::Executor::setParams(const QString &newParams)
|
||||
{
|
||||
mParams = newParams;
|
||||
}
|
||||
|
||||
bool Settings::Executor::redirectInput() const
|
||||
{
|
||||
return mRedirectInput;
|
||||
}
|
||||
|
||||
void Settings::Executor::setRedirectInput(bool newRedirectInput)
|
||||
{
|
||||
mRedirectInput = newRedirectInput;
|
||||
}
|
||||
|
||||
const QString &Settings::Executor::inputFilename() const
|
||||
{
|
||||
return mInputFilename;
|
||||
}
|
||||
|
||||
void Settings::Executor::setInputFilename(const QString &newInputFilename)
|
||||
{
|
||||
mInputFilename = newInputFilename;
|
||||
}
|
||||
|
||||
void Settings::Executor::doSave()
|
||||
{
|
||||
saveValue("pause_console", mPauseConsole);
|
||||
saveValue("minimize_on_run", mMinimizeOnRun);
|
||||
saveValue("use_params",mUseParams);
|
||||
saveValue("params",mParams);
|
||||
saveValue("redirect_input",mRedirectInput);
|
||||
saveValue("input_filename",mInputFilename);
|
||||
}
|
||||
|
||||
bool Settings::Executor::pauseConsole() const
|
||||
|
@ -2541,6 +2597,11 @@ void Settings::Executor::doLoad()
|
|||
{
|
||||
mPauseConsole = boolValue("pause_console",true);
|
||||
mMinimizeOnRun = boolValue("minimize_on_run",false);
|
||||
mUseParams = boolValue("use_params",false);
|
||||
mParams = stringValue("params", "");
|
||||
mRedirectInput = boolValue("redirect_input",false);
|
||||
mInputFilename = stringValue("input_filename","");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -302,6 +302,9 @@ public:
|
|||
bool caretUseTextColor() const;
|
||||
void setCaretUseTextColor(bool newUseIdentifierColor);
|
||||
|
||||
bool rainbowParenthesis() const;
|
||||
void setRainbowParenthesis(bool newRainbowParenthesis);
|
||||
|
||||
private:
|
||||
//General
|
||||
// indents
|
||||
|
@ -366,6 +369,7 @@ public:
|
|||
|
||||
//Color
|
||||
QString mColorScheme;
|
||||
bool mRainbowParenthesis;
|
||||
|
||||
//Symbol Completion
|
||||
bool mCompleteSymbols;
|
||||
|
@ -705,10 +709,23 @@ public:
|
|||
bool minimizeOnRun() const;
|
||||
void setMinimizeOnRun(bool minimizeOnRun);
|
||||
|
||||
bool useParams() const;
|
||||
void setUseParams(bool newUseParams);
|
||||
const QString ¶ms() const;
|
||||
void setParams(const QString &newParams);
|
||||
bool redirectInput() const;
|
||||
void setRedirectInput(bool newRedirectInput);
|
||||
const QString &inputFilename() const;
|
||||
void setInputFilename(const QString &newInputFilename);
|
||||
|
||||
private:
|
||||
// general
|
||||
bool mPauseConsole;
|
||||
bool mMinimizeOnRun;
|
||||
bool mUseParams;
|
||||
QString mParams;
|
||||
bool mRedirectInput;
|
||||
QString mInputFilename;
|
||||
|
||||
protected:
|
||||
void doSave() override;
|
||||
|
|
|
@ -281,6 +281,7 @@ void EditorColorSchemeWidget::changeSchemeComboFont()
|
|||
void EditorColorSchemeWidget::doLoad()
|
||||
{
|
||||
ui->cbScheme->setCurrentText(pSettings->editor().colorScheme());
|
||||
ui->chkRainborParenthesis->setChecked(pSettings->editor().rainbowParenthesis());
|
||||
}
|
||||
|
||||
void EditorColorSchemeWidget::doSave()
|
||||
|
@ -290,6 +291,7 @@ void EditorColorSchemeWidget::doSave()
|
|||
pColorManager->saveScheme(name);
|
||||
}
|
||||
pSettings->editor().setColorScheme(ui->cbScheme->currentText());
|
||||
pSettings->editor().setRainbowParenthesis(ui->chkRainborParenthesis->isChecked());
|
||||
pSettings->editor().save();
|
||||
pMainWindow->updateEditorColorSchemes();
|
||||
} catch (FileError e) {
|
||||
|
|
|
@ -336,6 +336,20 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkRainborParenthesis">
|
||||
<property name="text">
|
||||
<string>Rainbow parenthesis</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionCopy_Scheme">
|
||||
<property name="text">
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "ui_executorgeneralwidget.h"
|
||||
#include "../settings.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
|
||||
ExecutorGeneralWidget::ExecutorGeneralWidget(const QString& name, const QString& group, QWidget *parent):
|
||||
SettingsWidget(name,group,parent),
|
||||
ui(new Ui::ExecutorGeneralWidget)
|
||||
|
@ -18,12 +20,33 @@ void ExecutorGeneralWidget::doLoad()
|
|||
{
|
||||
ui->chkPauseConsole->setChecked(pSettings->executor().pauseConsole());
|
||||
ui->chkMinimizeOnRun->setChecked(pSettings->executor().minimizeOnRun());
|
||||
ui->grpExecuteParameters->setChecked(pSettings->executor().useParams());
|
||||
ui->txtExecuteParamaters->setText(pSettings->executor().params());
|
||||
ui->grpRedirectInput->setChecked(pSettings->executor().redirectInput());
|
||||
ui->txtRedirectInputFile->setText(pSettings->executor().inputFilename());
|
||||
}
|
||||
|
||||
void ExecutorGeneralWidget::doSave()
|
||||
{
|
||||
pSettings->executor().setPauseConsole(ui->chkPauseConsole->isChecked());
|
||||
pSettings->executor().setMinimizeOnRun(ui->chkMinimizeOnRun->isChecked());
|
||||
pSettings->executor().setUseParams(ui->grpExecuteParameters->isChecked());
|
||||
pSettings->executor().setParams(ui->txtExecuteParamaters->text());
|
||||
pSettings->executor().setRedirectInput(ui->grpRedirectInput->isChecked());
|
||||
pSettings->executor().setInputFilename(ui->txtRedirectInputFile->text());
|
||||
|
||||
pSettings->executor().save();
|
||||
}
|
||||
|
||||
void ExecutorGeneralWidget::on_btnBrowse_triggered(QAction *arg1)
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Choose input file"),
|
||||
QString(),
|
||||
tr("All files (*.*)"));
|
||||
if (!filename.isEmpty() && fileExists(filename)) {
|
||||
ui->txtRedirectInputFile->setText(filename);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ private:
|
|||
protected:
|
||||
void doLoad() override;
|
||||
void doSave() override;
|
||||
private slots:
|
||||
void on_btnBrowse_triggered(QAction *arg1);
|
||||
};
|
||||
|
||||
#endif // EXECUTORGENERALWIDGET_H
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<width>617</width>
|
||||
<height>449</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -47,7 +47,22 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpExecuteParameters">
|
||||
<property name="title">
|
||||
<string>Parameters to pass to your program</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="txtExecuteParamaters"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -60,8 +75,49 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpRedirectInput">
|
||||
<property name="title">
|
||||
<string>Redirect input to the following file:</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="txtRedirectInputFile"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="btnBrowse">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/images/newlook24/053-open.png</normaloff>:/icons/images/newlook24/053-open.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Note: Debugger doesn't support this feature.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
@ -63,14 +63,26 @@ void ColorEdit::paintEvent(QPaintEvent *)
|
|||
{
|
||||
QPainter painter(this);
|
||||
QRect rect = QRect(lineWidth(),lineWidth(),width()-2*lineWidth(),height()-2*lineWidth());
|
||||
if (mColor.isValid()) {
|
||||
if (mColor.isValid() ) {
|
||||
//painter.fillRect(rect,mColor);
|
||||
painter.setPen(contrast());
|
||||
painter.setBrush(mColor);
|
||||
if (isEnabled()) {
|
||||
painter.setPen(contrast());
|
||||
painter.setBrush(mColor);
|
||||
} else {
|
||||
painter.setBrush(palette().color(QPalette::Disabled,QPalette::Text));
|
||||
painter.setBrush(palette().color(QPalette::Disabled,QPalette::Base));
|
||||
}
|
||||
painter.drawRect(rect);
|
||||
painter.drawText(rect,Qt::AlignCenter, mColor.name());
|
||||
} else {
|
||||
//painter.fillRect(rect,palette().color(QPalette::Base));
|
||||
if (isEnabled()) {
|
||||
painter.setBrush(palette().color(QPalette::Text));
|
||||
painter.setBrush(palette().color(QPalette::Base));
|
||||
} else {
|
||||
painter.setBrush(palette().color(QPalette::Disabled,QPalette::Text));
|
||||
painter.setBrush(palette().color(QPalette::Disabled,QPalette::Base));
|
||||
}
|
||||
painter.setPen(contrast());
|
||||
painter.setBrush(palette().color(QPalette::Base));
|
||||
painter.drawRect(rect);
|
||||
|
@ -78,7 +90,7 @@ void ColorEdit::paintEvent(QPaintEvent *)
|
|||
}
|
||||
}
|
||||
|
||||
void ColorEdit::mouseReleaseEvent(QMouseEvent *event)
|
||||
void ColorEdit::mouseReleaseEvent(QMouseEvent *)
|
||||
{
|
||||
QColor c = QColorDialog::getColor();
|
||||
if (c.isValid()) {
|
||||
|
@ -86,12 +98,12 @@ void ColorEdit::mouseReleaseEvent(QMouseEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
void ColorEdit::enterEvent(QEvent *event)
|
||||
void ColorEdit::enterEvent(QEvent *)
|
||||
{
|
||||
setCursor(Qt::PointingHandCursor);
|
||||
}
|
||||
|
||||
void ColorEdit::leaveEvent(QEvent *event)
|
||||
void ColorEdit::leaveEvent(QEvent *)
|
||||
{
|
||||
setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue