Set clang-format argument options.
This commit is contained in:
@@ -19,7 +19,8 @@ DebugConsole::DebugConsole(QWidget * owner, const QString & key) :
|
||||
{
|
||||
}
|
||||
|
||||
DebugConsole::DebugConsole(QWidget * owner, const QString & key,
|
||||
DebugConsole::DebugConsole(QWidget * owner,
|
||||
const QString & key,
|
||||
const QString & name)
|
||||
{
|
||||
ui_ = new Ui::DebugConsole;
|
||||
|
||||
@@ -36,9 +36,13 @@ MainWindow::MainWindow(QWidget * parent) : QMainWindow(parent)
|
||||
// Add GUI 'view' toolbar option to show debug console.
|
||||
ui_->menuView->addAction(qtkWidget->getActionToggleConsole());
|
||||
// Refresh GUI widgets when scene or objects are updated.
|
||||
connect(qtkWidget->getScene(), &Qtk::Scene::sceneUpdated, this,
|
||||
connect(qtkWidget->getScene(),
|
||||
&Qtk::Scene::sceneUpdated,
|
||||
this,
|
||||
&MainWindow::refreshScene);
|
||||
connect(qtkWidget, &Qtk::QtkWidget::objectFocusChanged, ui_->qtk__ToolBox,
|
||||
connect(qtkWidget,
|
||||
&Qtk::QtkWidget::objectFocusChanged,
|
||||
ui_->qtk__ToolBox,
|
||||
&Qtk::ToolBox::updateFocus);
|
||||
}
|
||||
|
||||
|
||||
@@ -231,9 +231,10 @@ void QtkScene::init()
|
||||
// Building more complex objects for showing examples of lighting techniques
|
||||
|
||||
/* Test alien Model with phong lighting and specular mapping. */
|
||||
model = addObject(new Qtk::Model(
|
||||
"alienTest", ":/models/models/alien-hominid/alien.obj",
|
||||
":/shaders/model-specular.vert", ":/shaders/model-specular.frag"));
|
||||
model = addObject(new Qtk::Model("alienTest",
|
||||
":/models/models/alien-hominid/alien.obj",
|
||||
":/shaders/model-specular.vert",
|
||||
":/shaders/model-specular.frag"));
|
||||
model->getTransform().setTranslation(3.0f, -1.0f, 10.0f);
|
||||
model->getTransform().scale(0.15f);
|
||||
model->setUniform("uMaterial.ambient", QVector3D(1.0f, 1.0f, 1.0f));
|
||||
@@ -257,9 +258,10 @@ void QtkScene::init()
|
||||
mesh->setColor(GREEN);
|
||||
|
||||
/* Test spartan Model with phong lighting, specular and normal mapping. */
|
||||
model = addObject(new Qtk::Model(
|
||||
"spartanTest", ":/models/models/spartan/spartan.obj",
|
||||
":/shaders/model-normals.vert", ":/shaders/model-normals.frag"));
|
||||
model = addObject(new Qtk::Model("spartanTest",
|
||||
":/models/models/spartan/spartan.obj",
|
||||
":/shaders/model-normals.vert",
|
||||
":/shaders/model-normals.frag"));
|
||||
model->getTransform().setTranslation(0.0f, -1.0f, 10.0f);
|
||||
model->getTransform().scale(2.0f);
|
||||
model->setUniform("uMaterial.ambient", QVector3D(1.0f, 1.0f, 1.0f));
|
||||
@@ -493,8 +495,8 @@ void QtkScene::update()
|
||||
|
||||
// Rotate lighting example cubes
|
||||
mTestPhong->getTransform().rotate(0.75f, 0.5f, 0.3f, 0.2f);
|
||||
MeshRenderer::getInstance("noLight")->getTransform().rotate(0.75f, 0.5f, 0.3f,
|
||||
0.2f);
|
||||
MeshRenderer::getInstance("noLight")->getTransform().rotate(
|
||||
0.75f, 0.5f, 0.3f, 0.2f);
|
||||
mTestAmbient->getTransform().rotate(0.75f, 0.5f, 0.3f, 0.2f);
|
||||
mTestDiffuse->getTransform().rotate(0.75f, 0.5f, 0.3f, 0.2f);
|
||||
mTestSpecular->getTransform().rotate(0.75f, 0.5f, 0.3f, 0.2f);
|
||||
|
||||
@@ -88,7 +88,9 @@ void QtkWidget::initializeGL()
|
||||
mDebugLogger = new QOpenGLDebugLogger(this);
|
||||
if (mDebugLogger->initialize()) {
|
||||
qDebug() << "GL_DEBUG Debug Logger" << mDebugLogger << "\n";
|
||||
connect(mDebugLogger, SIGNAL(messageLogged(QOpenGLDebugMessage)), this,
|
||||
connect(mDebugLogger,
|
||||
SIGNAL(messageLogged(QOpenGLDebugMessage)),
|
||||
this,
|
||||
SLOT(messageLogged(QOpenGLDebugMessage)));
|
||||
mDebugLogger->startLogging();
|
||||
}
|
||||
@@ -109,8 +111,8 @@ void QtkWidget::initializeGL()
|
||||
void QtkWidget::resizeGL(int width, int height)
|
||||
{
|
||||
Scene::getProjectionMatrix().setToIdentity();
|
||||
Scene::getProjectionMatrix().perspective(45.0f, float(width) / float(height),
|
||||
0.1f, 1000.0f);
|
||||
Scene::getProjectionMatrix().perspective(
|
||||
45.0f, float(width) / float(height), 0.1f, 1000.0f);
|
||||
}
|
||||
|
||||
void QtkWidget::paintGL()
|
||||
@@ -126,7 +128,9 @@ void QtkWidget::setScene(Scene * scene)
|
||||
{
|
||||
if (mScene != Q_NULLPTR) {
|
||||
delete mScene;
|
||||
connect(scene, &Scene::sceneUpdated, MainWindow::getMainWindow(),
|
||||
connect(scene,
|
||||
&Scene::sceneUpdated,
|
||||
MainWindow::getMainWindow(),
|
||||
&MainWindow::refreshScene);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,13 +74,19 @@ void ToolBox::createPageProperties(const Object * object)
|
||||
rowLayout->addWidget(spinBox);
|
||||
|
||||
if (i == 0) {
|
||||
connect(spinBox, &QDoubleSpinBox::valueChanged, object,
|
||||
connect(spinBox,
|
||||
&QDoubleSpinBox::valueChanged,
|
||||
object,
|
||||
&Object::setTranslationX);
|
||||
} else if (i == 1) {
|
||||
connect(spinBox, &QDoubleSpinBox::valueChanged, object,
|
||||
connect(spinBox,
|
||||
&QDoubleSpinBox::valueChanged,
|
||||
object,
|
||||
&Object::setTranslationY);
|
||||
} else if (i == 2) {
|
||||
connect(spinBox, &QDoubleSpinBox::valueChanged, object,
|
||||
connect(spinBox,
|
||||
&QDoubleSpinBox::valueChanged,
|
||||
object,
|
||||
&Object::setTranslationZ);
|
||||
}
|
||||
}
|
||||
@@ -97,14 +103,14 @@ void ToolBox::createPageProperties(const Object * object)
|
||||
rowLayout->addWidget(spinBox);
|
||||
|
||||
if (i == 0) {
|
||||
connect(spinBox, &QDoubleSpinBox::valueChanged, object,
|
||||
&Object::setScaleX);
|
||||
connect(
|
||||
spinBox, &QDoubleSpinBox::valueChanged, object, &Object::setScaleX);
|
||||
} else if (i == 1) {
|
||||
connect(spinBox, &QDoubleSpinBox::valueChanged, object,
|
||||
&Object::setScaleY);
|
||||
connect(
|
||||
spinBox, &QDoubleSpinBox::valueChanged, object, &Object::setScaleY);
|
||||
} else if (i == 2) {
|
||||
connect(spinBox, &QDoubleSpinBox::valueChanged, object,
|
||||
&Object::setScaleZ);
|
||||
connect(
|
||||
spinBox, &QDoubleSpinBox::valueChanged, object, &Object::setScaleZ);
|
||||
}
|
||||
}
|
||||
layout->addRow(rowLayout);
|
||||
|
||||
@@ -19,7 +19,9 @@ Qtk::TreeView::TreeView(QWidget * parent) :
|
||||
QDockWidget(parent), ui(new Ui::TreeView)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->treeWidget, &QTreeWidget::itemDoubleClicked, this,
|
||||
connect(ui->treeWidget,
|
||||
&QTreeWidget::itemDoubleClicked,
|
||||
this,
|
||||
&TreeView::itemFocus);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
* Constructors, Destructors
|
||||
******************************************************************************/
|
||||
|
||||
WidgetPlugin::WidgetPlugin(QString group, QString class_name, QString include,
|
||||
WidgetPlugin::WidgetPlugin(QString group,
|
||||
QString class_name,
|
||||
QString include,
|
||||
WidgetPlugin::Factory factory) :
|
||||
m_group(std::move(group)), m_className(std::move(class_name)),
|
||||
m_includeFile(std::move(include)), m_factory(std::move(factory)),
|
||||
|
||||
@@ -27,7 +27,9 @@ class QDESIGNER_WIDGET_EXPORT WidgetPlugin :
|
||||
* Contructors / Destructors
|
||||
**************************************************************************/
|
||||
|
||||
WidgetPlugin(QString group, QString class_name, QString include,
|
||||
WidgetPlugin(QString group,
|
||||
QString class_name,
|
||||
QString include,
|
||||
Factory factory);
|
||||
|
||||
explicit WidgetPlugin(QObject * parent = nullptr);
|
||||
|
||||
@@ -23,13 +23,19 @@ WidgetPluginCollection::WidgetPluginCollection(QObject * parent) :
|
||||
{
|
||||
m_collection = {
|
||||
new WidgetPlugin(
|
||||
m_collectionName, "Qtk::QtkWidget", "qtkwidget.h",
|
||||
m_collectionName,
|
||||
"Qtk::QtkWidget",
|
||||
"qtkwidget.h",
|
||||
[](QWidget * parent) { return new Qtk::QtkWidget(parent); }),
|
||||
new WidgetPlugin(
|
||||
m_collectionName, "Qtk::TreeView", "treeview.h",
|
||||
m_collectionName,
|
||||
"Qtk::TreeView",
|
||||
"treeview.h",
|
||||
[](QWidget * parent) { return new Qtk::TreeView(parent); }),
|
||||
new WidgetPlugin(
|
||||
m_collectionName, "Qtk::ToolBox", "toolbox.h",
|
||||
m_collectionName,
|
||||
"Qtk::ToolBox",
|
||||
"toolbox.h",
|
||||
[](QWidget * parent) { return new Qtk::ToolBox(parent); }),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user