Skip to content

Commit

Permalink
feat: DTK changed-template
Browse files Browse the repository at this point in the history
Log: Replacing Qt controls with DTK
  • Loading branch information
JWWTSL committed Nov 21, 2023
1 parent 6911611 commit 2df5a8f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/plugins/template/wizard/maindialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
#include <DTreeView>
#include <DTitlebar>
#include <DListWidget>
#include <QStackedWidget>
#include <DStackedWidget>
#include <DStandardItem>

#include <QStandardItemModel>
#include <QDebug>
#include <QHBoxLayout>
#include <QUuid>
#include <QStackedWidget>

DWIDGET_USE_NAMESPACE
using namespace dpfservice;
Expand All @@ -28,7 +29,7 @@ class MainDialogPrivate
{
friend class MainDialog;
QMap<QString, DetailWidget*> detailWidgetMap;
QStackedWidget *detailStackedWidget = nullptr;
DStackedWidget *detailStackedWidget = nullptr;
DWidget *blankWidget = nullptr;
};

Expand Down Expand Up @@ -59,7 +60,7 @@ void MainDialog::setupUI(TemplateVector &templateVec)

DLabel *title = new DLabel(tr("Choose a template:"));

d->detailStackedWidget = new QStackedWidget();
d->detailStackedWidget = new DStackedWidget();
d->blankWidget = new DetailWidget(this);
d->detailStackedWidget->addWidget(d->blankWidget);

Expand All @@ -74,17 +75,17 @@ void MainDialog::setupUI(TemplateVector &templateVec)
QStandardItem * rootItem = standardModel->invisibleRootItem();

for (auto iterTpl = templateVec.begin(); iterTpl != templateVec.end(); ++iterTpl) {
QStandardItem *tpl = new QStandardItem(iterTpl->category);
DStandardItem *tpl = new DStandardItem(iterTpl->category);
rootItem->appendRow(tpl);

QVector<TemplateCategory> tplVec = iterTpl->templateVec;
for (auto iterCate = tplVec.begin(); iterCate != tplVec.end(); ++iterCate) {
QStandardItem *typeItem = new QStandardItem(iterCate->type);
DStandardItem *typeItem = new DStandardItem(iterCate->type);
tpl->appendRow(typeItem);

auto iterDetail = iterCate->templateVec.begin();
for (; iterDetail != iterCate->templateVec.end(); ++iterDetail) {
QStandardItem *detailItem = new QStandardItem(iterDetail->name);
DStandardItem *detailItem = new DStandardItem(iterDetail->name);
TemplateDetail detail;
detail.name = iterDetail->name;
detail.path = iterDetail->path;
Expand Down

0 comments on commit 2df5a8f

Please sign in to comment.