29 #include "../vmisc/logging.h"
30 #include "../vmisc/vabstractapplication.h"
34 Q_LOGGING_CATEGORY(penToolBar,
"pentoolbar")
40 : QToolBar(title, parent)
46 currentPen.color =
qApp->Settings()->getDefaultLineColor();
47 currentPen.lineType =
qApp->Settings()->getDefaultLineType();
48 currentPen.lineWeight =
qApp->Settings()->getDefaultLineWeight();
50 int index = colorBox->findData(currentPen.color);
53 colorBox->setCurrentIndex(index);
55 index = lineTypeBox->findData(currentPen.lineType);
58 lineTypeBox->setCurrentIndex(index);
60 index = lineWeightBox->findData(currentPen.lineWeight);
63 lineWeightBox->setCurrentIndex(index);
67 colorBox->setToolTip(tr(
"Current line color"));
70 addWidget(lineTypeBox);
71 lineTypeBox->setToolTip(tr(
"Current line type"));
74 addWidget(lineWeightBox);
75 lineWeightBox->setToolTip(tr(
"Current line weight"));
78 QToolButton *resetButton =
new QToolButton;
79 resetButton->setIcon(QIcon(
":/icons/win.icon.theme/24x24/actions/edit-undo.png"));
80 resetButton->setToolTip (
"Reset current pen to defaults");
81 addWidget(resetButton);
84 QToolButton *savePresetButton =
new QToolButton;
85 savePresetButton->setIcon(QIcon(
":/icons/win.icon.theme/24x24/actions/document-save-as.png"));
86 savePresetButton->setToolTip (
"Save current pen preset");
87 addWidget(savePresetButton);
107 qCDebug(penToolBar,
"PenToolBar::lineTypeChanged - Pen type changed\n");
118 qCDebug(penToolBar,
"PenToolBar::colorChanged - Pen color changed\n");
129 qCDebug(penToolBar,
"PenToolBar::lineWeightChanged - Pen width changed\n");
140 qCDebug(penToolBar,
"Pen Reset");
143 int index =
colorBox->findData(
qApp->Settings()->getDefaultLineColor());
void colorChangedSignal(const QString &color)
void lineTypeChanged(const QString &type)
void lineWeightChanged(const qreal &weight)