mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-15 01:54:14 +02:00
Speed up opening big projects with lazy folios
This commit is contained in:
@@ -150,8 +150,9 @@ void DiagramBgColorToolButton::applyColor(const QColor &color)
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
//A folio not built yet takes the colour when it is drawn
|
||||
for (ProjectView *pv : editor->openedProjects())
|
||||
for (Diagram *d : pv->project()->diagrams())
|
||||
for (Diagram *d : pv->project()->folios())
|
||||
d->update();
|
||||
}
|
||||
|
||||
@@ -175,8 +176,9 @@ void DiagramBgColorToolButton::applySystemColor()
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
//A folio not built yet takes the colour when it is drawn
|
||||
for (ProjectView *pv : editor->openedProjects())
|
||||
for (Diagram *d : pv->project()->diagrams())
|
||||
for (Diagram *d : pv->project()->folios())
|
||||
d->update();
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ void DiagramEditorHandlerSizeWidget::on_comboBox_currentIndexChanged(int index)
|
||||
{
|
||||
editor_->setProperty("graphics_handler_size", size);
|
||||
for (auto project_view : editor_->openedProjects()) {
|
||||
for (auto diagram : project_view->project()->diagrams()) {
|
||||
//Handles exist on built folios only
|
||||
for (auto diagram : project_view->project()->builtFolios()) {
|
||||
for (const auto item : diagram->items()) {
|
||||
if (item->type() == QetGraphicsHandlerItem::Type) {
|
||||
auto handler = qgraphicsitem_cast<QetGraphicsHandlerItem *>(item);
|
||||
|
||||
@@ -169,7 +169,7 @@ void JumpToElementDialog::activateCurrentItem()
|
||||
const int index = current->data(Qt::UserRole).toInt();
|
||||
if (index == -1) {
|
||||
const QList<Diagram *> diagrams = m_diagram->project()
|
||||
? m_diagram->project()->diagrams()
|
||||
? m_diagram->project()->folios()
|
||||
: QList<Diagram *>();
|
||||
const int folio = current->data(Qt::UserRole + 2).toInt();
|
||||
if (folio >= 0 && folio < diagrams.size()) {
|
||||
@@ -208,7 +208,8 @@ QListWidgetItem *JumpToElementDialog::cellItem(const QString &needle) const
|
||||
if (!m_diagram || !m_diagram->project()) {
|
||||
return nullptr;
|
||||
}
|
||||
const QList<Diagram *> diagrams = m_diagram->project()->diagrams();
|
||||
//Folios' cells only (their border): folios() builds nothing
|
||||
const QList<Diagram *> diagrams = m_diagram->project()->folios();
|
||||
|
||||
Diagram *diagram = m_diagram;
|
||||
QString cell = needle;
|
||||
|
||||
Reference in New Issue
Block a user