Skip to content

Commit

Permalink
基础组件完成
Browse files Browse the repository at this point in the history
  • Loading branch information
HuaGouFdog committed Aug 22, 2020
1 parent 5ede01f commit 02466aa
Show file tree
Hide file tree
Showing 12 changed files with 789 additions and 136 deletions.
Binary file modified debug/FdpgQtStyleSheet1.exe
Binary file not shown.
Binary file modified debug/FdpgQtStyleSheet1.ilk
Binary file not shown.
Binary file modified debug/FdpgQtStyleSheet1.pdb
Binary file not shown.
Binary file modified debug/FdpgQtStyleSheet1.vc.pdb
Binary file not shown.
Binary file modified debug/main.obj
Binary file not shown.
Binary file modified debug/mainwindow.obj
Binary file not shown.
64 changes: 40 additions & 24 deletions debug/moc_mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_MainWindow_t {
QByteArrayData data[20];
char stringdata0[542];
QByteArrayData data[24];
char stringdata0[629];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
Expand Down Expand Up @@ -50,7 +50,11 @@ QT_MOC_LITERAL(15, 439, 33), // "on_comboBox_2_currentIndexCha..."
QT_MOC_LITERAL(16, 473, 5), // "index"
QT_MOC_LITERAL(17, 479, 25), // "on_spinBox_3_valueChanged"
QT_MOC_LITERAL(18, 505, 4), // "arg1"
QT_MOC_LITERAL(19, 510, 31) // "on_comboBox_currentIndexChanged"
QT_MOC_LITERAL(19, 510, 31), // "on_comboBox_currentIndexChanged"
QT_MOC_LITERAL(20, 542, 25), // "on_spinBox_2_valueChanged"
QT_MOC_LITERAL(21, 568, 23), // "on_spinBox_valueChanged"
QT_MOC_LITERAL(22, 592, 34), // "on_fontComboBox_currentFontCh..."
QT_MOC_LITERAL(23, 627, 1) // "f"

},
"MainWindow\0on_horizontalSlider_valueChanged\0"
Expand All @@ -67,7 +71,10 @@ QT_MOC_LITERAL(19, 510, 31) // "on_comboBox_currentIndexChanged"
"on_horizontalSlider_12_valueChanged\0"
"on_comboBox_2_currentIndexChanged\0"
"index\0on_spinBox_3_valueChanged\0arg1\0"
"on_comboBox_currentIndexChanged"
"on_comboBox_currentIndexChanged\0"
"on_spinBox_2_valueChanged\0"
"on_spinBox_valueChanged\0"
"on_fontComboBox_currentFontChanged\0f"
};
#undef QT_MOC_LITERAL

Expand All @@ -77,29 +84,32 @@ static const uint qt_meta_data_MainWindow[] = {
7, // revision
0, // classname
0, 0, // classinfo
15, 14, // methods
18, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount

// slots: name, argc, parameters, tag, flags
1, 1, 89, 2, 0x08 /* Private */,
4, 1, 92, 2, 0x08 /* Private */,
5, 1, 95, 2, 0x08 /* Private */,
6, 1, 98, 2, 0x08 /* Private */,
7, 1, 101, 2, 0x08 /* Private */,
8, 1, 104, 2, 0x08 /* Private */,
9, 1, 107, 2, 0x08 /* Private */,
10, 1, 110, 2, 0x08 /* Private */,
11, 1, 113, 2, 0x08 /* Private */,
12, 1, 116, 2, 0x08 /* Private */,
13, 1, 119, 2, 0x08 /* Private */,
14, 1, 122, 2, 0x08 /* Private */,
15, 1, 125, 2, 0x08 /* Private */,
17, 1, 128, 2, 0x08 /* Private */,
19, 1, 131, 2, 0x08 /* Private */,
1, 1, 104, 2, 0x08 /* Private */,
4, 1, 107, 2, 0x08 /* Private */,
5, 1, 110, 2, 0x08 /* Private */,
6, 1, 113, 2, 0x08 /* Private */,
7, 1, 116, 2, 0x08 /* Private */,
8, 1, 119, 2, 0x08 /* Private */,
9, 1, 122, 2, 0x08 /* Private */,
10, 1, 125, 2, 0x08 /* Private */,
11, 1, 128, 2, 0x08 /* Private */,
12, 1, 131, 2, 0x08 /* Private */,
13, 1, 134, 2, 0x08 /* Private */,
14, 1, 137, 2, 0x08 /* Private */,
15, 1, 140, 2, 0x08 /* Private */,
17, 1, 143, 2, 0x08 /* Private */,
19, 1, 146, 2, 0x08 /* Private */,
20, 1, 149, 2, 0x08 /* Private */,
21, 1, 152, 2, 0x08 /* Private */,
22, 1, 155, 2, 0x08 /* Private */,

// slots: parameters
QMetaType::Void, QMetaType::Int, 3,
Expand All @@ -117,6 +127,9 @@ static const uint qt_meta_data_MainWindow[] = {
QMetaType::Void, QMetaType::Int, 16,
QMetaType::Void, QMetaType::Int, 18,
QMetaType::Void, QMetaType::QString, 18,
QMetaType::Void, QMetaType::Int, 18,
QMetaType::Void, QMetaType::Int, 18,
QMetaType::Void, QMetaType::QFont, 23,

0 // eod
};
Expand All @@ -142,6 +155,9 @@ void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id,
case 12: _t->on_comboBox_2_currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 13: _t->on_spinBox_3_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 14: _t->on_comboBox_currentIndexChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 15: _t->on_spinBox_2_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 16: _t->on_spinBox_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 17: _t->on_fontComboBox_currentFontChanged((*reinterpret_cast< const QFont(*)>(_a[1]))); break;
default: ;
}
}
Expand Down Expand Up @@ -172,13 +188,13 @@ int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 15)
if (_id < 18)
qt_static_metacall(this, _c, _id, _a);
_id -= 15;
_id -= 18;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 15)
if (_id < 18)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 15;
_id -= 18;
}
return _id;
}
Expand Down
Binary file modified debug/moc_mainwindow.obj
Binary file not shown.
70 changes: 48 additions & 22 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MainWindow::~MainWindow()
delete ui;
}

void MainWindow::Labelshow(int value)
void MainWindow::Labelshow()
{
QString str_1 = QString("background-color:rgba(%1,%2,%3,%4);")
.arg(ui->horizontalSlider->value())
Expand All @@ -34,80 +34,97 @@ void MainWindow::Labelshow(int value)
.arg(ui->horizontalSlider_10->value())
.arg(ui->horizontalSlider_11->value())
.arg(ui->horizontalSlider_12->value());
QString s = str_1+str_2+str_3;
QString str_4 = QString("border-style:%1;").arg(ui->comboBox->currentText());
QString str_5 = QString("border-width:%1px;").arg(ui->spinBox_2->value());
QString str_6 = QString("border-radius:%1px;").arg(ui->spinBox_3->value());

QString str_7 = QString("font:%1px \"%2\";").arg(ui->spinBox->value()).arg(ui->fontComboBox->currentText());

qDebug().noquote()<<str_7;


QString s = str_1+str_2+str_3+str_4+str_5+str_6+str_7;
ui->label->setStyleSheet(s);
ui->pushButton->setStyleSheet(s);
ui->lineEdit_13->setStyleSheet(s);
ui->comboBox_6->setStyleSheet(s);
ui->spinBox_5->setStyleSheet(s);
ui->buttonBox->setStyleSheet(s);
ui->checkBox->setStyleSheet(s);
ui->radioButton->setStyleSheet(s);
ui->textEdit->setText(s);
}

void MainWindow::on_horizontalSlider_valueChanged(int value)
{
ui->lineEdit->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_2_valueChanged(int value)
{
ui->lineEdit_2->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_3_valueChanged(int value)
{
ui->lineEdit_3->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_4_valueChanged(int value)
{
ui->lineEdit_4->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_5_valueChanged(int value)
{
ui->lineEdit_5->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_6_valueChanged(int value)
{
ui->lineEdit_6->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_7_valueChanged(int value)
{
ui->lineEdit_7->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_8_valueChanged(int value)
{
ui->lineEdit_8->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_9_valueChanged(int value)
{
ui->lineEdit_9->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_10_valueChanged(int value)
{
ui->lineEdit_10->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_11_valueChanged(int value)
{
ui->lineEdit_11->setText(QString::number(value));
Labelshow(value);
Labelshow();
}

void MainWindow::on_horizontalSlider_12_valueChanged(int value)
{
ui->lineEdit_12->setText(QString::number(value));
Labelshow(value);
Labelshow();
}


Expand Down Expand Up @@ -149,16 +166,25 @@ void MainWindow::on_comboBox_2_currentIndexChanged(int index)

void MainWindow::on_spinBox_3_valueChanged(int arg1)
{
//border-style:solid;
QString str = QString("border-radius:%1px;").arg(arg1);
ui->label->setStyleSheet(str);
Labelshow();
}

void MainWindow::on_comboBox_currentIndexChanged(const QString &arg1)
{
if(arg1 == "solid")
{
qDebug()<<"11";
ui->label->setStyleSheet("border-style:solid;");
}
Labelshow();
}

void MainWindow::on_spinBox_2_valueChanged(int arg1)
{
Labelshow();
}

void MainWindow::on_spinBox_valueChanged(int arg1)
{
Labelshow();
}

void MainWindow::on_fontComboBox_currentFontChanged(const QFont &f)
{
Labelshow();
}
9 changes: 8 additions & 1 deletion mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MainWindow : public QMainWindow
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

void Labelshow(int value);
void Labelshow();

private slots:

Expand Down Expand Up @@ -50,6 +50,13 @@ private slots:

void on_comboBox_currentIndexChanged(const QString &arg1);

void on_spinBox_2_valueChanged(int arg1);


void on_spinBox_valueChanged(int arg1);

void on_fontComboBox_currentFontChanged(const QFont &f);

private:
Ui::MainWindow *ui;
};
Expand Down
Loading

0 comments on commit 02466aa

Please sign in to comment.