21 #include <QColorDialog>
29 mColor(QColor(255, 255, 255))
32 connect(
this, SIGNAL(clicked()),
this, SLOT(
changeColor()));
37 QString btnColorStyle = QString(
38 "background-color:rgb(%1,%2,%3);"
39 "border-style:outset;"
44 setObjectName(
"SelectColorButton");
45 setStyleSheet(btnColorStyle);
52 const int nResult = pDlg.exec();
53 if (nResult == QDialog::Accepted) {
75 QVariant(
static_cast<int>(QFont::Thin)));
76 addItem(QObject::tr(
"ExtraLight"),
77 QVariant(
static_cast<int>(QFont::ExtraLight)));
79 QVariant(
static_cast<int>(QFont::Light)));
81 QVariant(
static_cast<int>(QFont::Normal)));
83 QVariant(
static_cast<int>(QFont::Medium)));
84 addItem(QObject::tr(
"DemiBold"),
85 QVariant(
static_cast<int>(QFont::DemiBold)));
87 QVariant(
static_cast<int>(QFont::Bold)));
88 addItem(QObject::tr(
"ExtraBold"),
89 QVariant(
static_cast<int>(QFont::ExtraBold)));
91 QVariant(
static_cast<int>(QFont::Black)));
93 connect(
this, SIGNAL(currentIndexChanged(
int)),
99 const int nResult = findData(QVariant(
static_cast<int>(
mWeight)));
102 setCurrentIndex(nResult);
104 setCurrentIndex(findData(
static_cast<int>(QFont::Normal)));
111 setWeight(
static_cast<QFont::Weight
>(itemData(index).toInt()));
static void addItem(QMap< QString, unsigned > &m, const QString &key)
void setWeight(QFont::Weight weight)
void changeWeight(int index)
void weightChanged(QFont::Weight newWeight)
SelectFontWeightCombo(QWidget *parent)
const QFont::Weight & getWeight()