Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 274de09e authored by Julien Wintz's avatar Julien Wintz
Browse files

Better integration.

parent bb141c27
Pipeline #205460 failed with stage
in 0 seconds
......@@ -21,6 +21,9 @@
#include <QtWebEngineWidgets>
#include <QtWidgets>
#include <dtkThemes>
#include <dtkWidgets>
// /////////////////////////////////////////////////////////////////////////////
// dtkReferenceFetcher
// /////////////////////////////////////////////////////////////////////////////
......@@ -615,8 +618,6 @@ dtkReferenceFetcherDialog::~dtkReferenceFetcherDialog(void)
void dtkReferenceFetcherDialog::setIndex(int index)
{
qDebug() << Q_FUNC_INFO << index;
this->setHtml(QString("<html><body><h1>%1</h1><br/><br/><p>There will be some results</p></body></html>").arg(index));
}
......@@ -631,7 +632,12 @@ void dtkReferenceFetcherDialog::setFetcher(dtkReferenceFetcher *fetcher)
int main(int argc, char **argv)
{
dtkThemesEngine::instance()->apply();
QApplication application(argc, argv);
application.setApplicationName("dtkWidgetsReferences");
application.setOrganizationName("inria");
application.setOrganizationDomain("fr");
// /////////////////////////////////////////////////////////////////////////////
// PoC
......@@ -672,53 +678,72 @@ int main(int argc, char **argv)
fetcher.fetch();
// TODO: Fixme
qDebug() << "count" << fetcher.count();
qDebug() << "link for to the second element" << fetcher.at(1);
// qDebug() << "count" << fetcher.count();
// qDebug() << "link for to the second element" << fetcher.at(1);
// /////////////////////////////////////////////////////////////////////////////
// Fetcher (Ux Part - Model)
// /////////////////////////////////////////////////////////////////////////////
dtkReferenceModel model_p;
dtkReferenceModel model;
model.load(fetcher.document);
QTreeView view_t;
view_t.setModel(&model);
view_t.show();
view_t.raise();
// /////////////////////////////////////////////////////////////////////////////
dtkReferenceModel model_p;
QTableView view_a;
view_a.setModel(&model_p);
view_a.setAlternatingRowColors(true);
view_a.horizontalHeader()->setStretchLastSection(true);
QTableView view_a; view_a.setModel(&model_p); view_a.setAlternatingRowColors(true); view_a.horizontalHeader()->setStretchLastSection(true);
QListView view_l; view_l.setModel(&model); view_l.setAlternatingRowColors(true);
QListView view_l;
view_l.setModel(&model);
view_l.setAlternatingRowColors(true);
view_l.setFixedWidth(80);
dtkReferenceFetcherDialog fetcher_dialog;
fetcher_dialog.setFetcher(&fetcher);
// fetcher_dialog.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
fetcher_dialog.setFixedHeight(400);
QVBoxLayout *layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(&view_a);
layout->addWidget(&fetcher_dialog);
QVBoxLayout *layout_i = new QVBoxLayout;
layout_i->setContentsMargins(0, 0, 0, 0);
layout_i->setSpacing(0);
layout_i->addWidget(&view_a);
layout_i->addWidget(&fetcher_dialog);
QWidget *rhs = new QWidget;
rhs->setLayout(layout);
rhs->setLayout(layout_i);
QSplitter *splitter = new QSplitter;
splitter->addWidget(&view_l);
splitter->addWidget(rhs);
splitter->resize(800, 600);
splitter->show();
splitter->raise();
splitter->setHandleWidth(1);
// /////////////////////////////////////////////////////////////////////////////
// Fetcher (Ux Part - Dialog)
// /////////////////////////////////////////////////////////////////////////////
QWidget *central = new QWidget;
dtkWidgetsMenuBar *menu = new dtkWidgetsMenuBar(splitter);
menu->setWidth(32);
dtkWidgetsMenu *menu_themes = menu->addMenu(fa::paintbrush, "Choose Themes");
for (const QString theme : dtkThemesEngine::instance()->themes()) {
dtkWidgetsMenuItem * item = menu_themes->addItem(new dtkWidgetsMenuItemTheme(theme));
QObject::connect(item, &dtkWidgetsMenuItem::clicked, [=] () {
dtkThemesEngine::instance()->apply(theme);
});
}
menu->touch();
QHBoxLayout *layout = new QHBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(menu);
layout->addWidget(splitter);
central->setLayout(layout);
QMainWindow *window = new QMainWindow;
window->setCentralWidget(central);
window->resize(800, 400);
window->show();
window->raise();
// /////////////////////////////////////////////////////////////////////////////
// Connections
......@@ -736,7 +761,6 @@ int main(int argc, char **argv)
model_p.revert();
});
// /////////////////////////////////////////////////////////////////////////////
// Fetcher (Ux Part - MenuItem) - c.f. dtkWidgetsMenu*
// /////////////////////////////////////////////////////////////////////////////
......@@ -747,15 +771,9 @@ int main(int argc, char **argv)
// /////////////////////////////////////////////////////////////////////////////
int status = application.exec();
dtkThemesEngine::instance()->apply();
// /////////////////////////////////////////////////////////////////////////////
// Cleanup
// /////////////////////////////////////////////////////////////////////////////
// delete view_t;
// /////////////////////////////////////////////////////////////////////////////
int status = application.exec();
return status;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment