r25025 by jghali - Replace quite a few repaint() calls by more adapted update() calls

scribus-commit scribus-commit at lists.scribus.net
Sat Mar 12 21:39:55 UTC 2022


Author: jghali
Date: Sat Mar 12 21:39:55 2022
New Revision: 25025

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25025
Log:
Replace quite a few repaint() calls by more adapted update() calls

Modified:
    trunk/Scribus/scribus/ui/customfdialog.cpp
    trunk/Scribus/scribus/ui/dasheditor.cpp
    trunk/Scribus/scribus/ui/picsearch.cpp
    trunk/Scribus/scribus/ui/propertiespalette.cpp
    trunk/Scribus/scribus/ui/propertiespalette_image.cpp
    trunk/Scribus/scribus/ui/propertiespalette_line.cpp
    trunk/Scribus/scribus/ui/propertiespalette_text.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
    trunk/Scribus/scribus/ui/propertywidget_fontfeatures.cpp
    trunk/Scribus/scribus/ui/propertywidget_hyphenation.cpp
    trunk/Scribus/scribus/ui/smtabruler.cpp
    trunk/Scribus/scribus/ui/tabruler.cpp
    trunk/Scribus/scribus/ui/textpalette.cpp

Modified: trunk/Scribus/scribus/ui/customfdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/customfdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/customfdialog.cpp	(original)
+++ trunk/Scribus/scribus/ui/customfdialog.cpp	Sat Mar 12 21:39:55 2022
@@ -193,7 +193,7 @@
 		p.drawText(2, h - 5, tr("Colorspace:") + " " + cSpace);
 		p.end();
 		setPixmap(pm);
-		repaint();
+		update();
 	}
 	else if (allFormatsV.contains(ext.toUtf8()))
 	{
@@ -223,7 +223,7 @@
 		p.drawText(2, h - 5, desc);
 		p.end();
 		setPixmap(pm);
-		repaint();
+		update();
 	}
 	else if (ext.toUtf8() == "sce")
 	{
@@ -249,7 +249,7 @@
 		p.drawText(2, h - 5, desc);
 		p.end();
 		setPixmap(pm);
-		repaint();
+		update();
 		delete pre;
 	}
 	else
@@ -570,9 +570,9 @@
 	filePreview->setVisible(!m_previewIsShown);
 	QCoreApplication::processEvents();
 	filePreview->setVisible(m_previewIsShown);
-	fileDialog->repaint();
+	fileDialog->update();
 	QCoreApplication::processEvents();
-	repaint();
+	update();
 }
 
 void CustomFDialog::setSelection(const QString& fileName)

Modified: trunk/Scribus/scribus/ui/dasheditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/dasheditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/dasheditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/dasheditor.cpp	Sat Mar 12 21:39:55 2022
@@ -129,7 +129,7 @@
 		{
 			m_currentStop = i;
 			emit currStep(m_dashValues[m_currentStop]);
-			repaint();
+			update();
 			return;
 		}
 	}
@@ -154,7 +154,7 @@
 		m_currentStop = 0;
 		m_onlySelect = true;
 		m_mousePressed = false;
-		repaint();
+		update();
 		emit currStep(m_dashValues[m_currentStop]);
 		emit dashChanged();
 		return;
@@ -195,7 +195,7 @@
 			startX += w;
 		}
 		m_onlySelect = true;
-		repaint();
+		update();
 		emit currStep(m_dashValues[m_currentStop]);
 		emit dashChanged();
 	}
@@ -244,7 +244,7 @@
 			startX += w;
 		}
 		m_onlySelect = true;
-		repaint();
+		update();
 		startX = 0.0;
 		for (int i = 0; i < m_currentStop; ++i)
 		{
@@ -279,7 +279,7 @@
 		return;
 	m_dashValues[m_currentStop] = t;
 	m_onlySelect = true;
-	repaint();
+	update();
 	emit dashChanged();
 }
 

Modified: trunk/Scribus/scribus/ui/picsearch.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/picsearch.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/picsearch.cpp	(original)
+++ trunk/Scribus/scribus/ui/picsearch.cpp	Sat Mar 12 21:39:55 2022
@@ -125,7 +125,7 @@
 			cSpace=colorSpaceText(im.imgInfo.colorspace);
 		p.drawText(2, h-5, tr("Colorspace:")+" "+cSpace);
 		p.end();
-		repaint();
+		update();
 	}
 	previewLabel->setPixmap(pm);
 }

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp	Sat Mar 12 21:39:55 2022
@@ -511,7 +511,7 @@
 	xyzPal->setLineMode(mode);
 	xyzPal->showWH(m_item->width(), m_item->height());
 	updateGeometry();
-	repaint();
+	update();
 }
 
 void PropertiesPalette::handleNewShape(int frameType)

Modified: trunk/Scribus/scribus/ui/propertiespalette_image.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/propertiespalette_image.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_image.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_image.cpp	Sat Mar 12 21:39:55 2022
@@ -420,7 +420,6 @@
 		setCurrentItem(currItem);
 	}
 	updateGeometry();
-	//repaint();
 }
 
 void PropertiesPalette_Image::handleUpdateRequest(int updateFlags)

Modified: trunk/Scribus/scribus/ui/propertiespalette_line.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/propertiespalette_line.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_line.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_line.cpp	Sat Mar 12 21:39:55 2022
@@ -224,7 +224,6 @@
 		setCurrentItem(currItem);
 	}
 	updateGeometry();
-	//repaint();
 }
 
 void PropertiesPalette_Line::handleUpdateRequest(int updateFlags)

Modified: trunk/Scribus/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_text.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_text.cpp	Sat Mar 12 21:39:55 2022
@@ -275,7 +275,6 @@
 		setCurrentItem(currItem);
 	}
 	updateGeometry();
-	//repaint();
 }
 
 void PropertiesPalette_Text::handleUpdateRequest(int updateFlags)

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp	Sat Mar 12 21:39:55 2022
@@ -511,7 +511,6 @@
 		setCurrentItem(currItem);
 	}
 	updateGeometry();
-	//repaint();
 }
 
 void PropertiesPalette_XYZ::unitChange()

Modified: trunk/Scribus/scribus/ui/propertywidget_fontfeatures.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/propertywidget_fontfeatures.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_fontfeatures.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_fontfeatures.cpp	Sat Mar 12 21:39:55 2022
@@ -279,7 +279,7 @@
 	PageItem* currItem = currentItemFromSelection();
 	setCurrentItem(currItem);
 	updateGeometry();
-	repaint();
+	update();
 }
 
 void PropertyWidget_FontFeatures::updateCharStyle(const CharStyle& charStyle)

Modified: trunk/Scribus/scribus/ui/propertywidget_hyphenation.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/propertywidget_hyphenation.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_hyphenation.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_hyphenation.cpp	Sat Mar 12 21:39:55 2022
@@ -114,7 +114,7 @@
 	PageItem* currItem = currentItemFromSelection();
 	setCurrentItem(currItem);
 	updateGeometry();
-	repaint();
+	update();
 }
 
 void PropertyWidget_Hyphenation::updateCharStyle(const CharStyle& charStyle)

Modified: trunk/Scribus/scribus/ui/smtabruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/smtabruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtabruler.cpp	(original)
+++ trunk/Scribus/scribus/ui/smtabruler.cpp	Sat Mar 12 21:39:55 2022
@@ -57,33 +57,28 @@
 
 void SMTabruler::unitChange(int unitIndex)
 {
-	this->blockSignals(true);
+	QSignalBlocker thisBlocker(this);
+	QSignalBlocker firstLineSpinBlocker(firstLineSpin);
+	QSignalBlocker leftIndentSpinBlocker(leftIndentSpin);
+	QSignalBlocker rightIndentSpinBlocker(rightIndentSpin);
+	QSignalBlocker tabDataBlocker(tabData);
+
 	Tabruler::setTabs(ruler->tabValues, unitIndex);
-	Tabruler::repaint();
-
-	firstLineSpin->blockSignals(true);
-	leftIndentSpin->blockSignals(true);
-	rightIndentSpin->blockSignals(true);
-	tabData->blockSignals(true);
+	Tabruler::update();
 
 	firstLineSpin->setNewUnit(unitIndex);
 	leftIndentSpin->setNewUnit(unitIndex);
 	rightIndentSpin->setNewUnit(unitIndex);
 	tabData->setNewUnit(unitIndex);
 
-	firstLineSpin->blockSignals(false);
-	leftIndentSpin->blockSignals(false);
-	rightIndentSpin->blockSignals(false);
-	tabData->blockSignals(false);
-
 	m_unitIndex = unitIndex;
-	this->blockSignals(false);
 }
 
 void SMTabruler::setTabs(const QList<ParagraphStyle::TabRecord>& Tabs, int unitIndex)
 {
 	disconnect(this, SIGNAL(tabsChanged()), this, SLOT(slotTabsChanged()));
 	disconnect(this, SIGNAL(mouseReleased()), this, SLOT(slotTabsChanged()));
+
 	m_hasParent = false;
 	m_parentButton->hide();
 	Tabruler::setTabs(Tabs, unitIndex);
@@ -98,6 +93,7 @@
 {
 	disconnect(this, SIGNAL(tabsChanged()), this, SLOT(slotTabsChanged()));
 	disconnect(this, SIGNAL(mouseReleased()), this, SLOT(slotTabsChanged()));
+
 	m_hasParent  = true;
 	m_unitIndex = unitIndex;
 	if (isParentValue)
@@ -105,7 +101,7 @@
 	else
 		m_parentButton->show();
 	Tabruler::setTabs(Tabs, unitIndex);
-	Tabruler::repaint();
+	Tabruler::update();
 	firstLineSpin->setNewUnit(unitIndex);
 	leftIndentSpin->setNewUnit(unitIndex);
 	rightIndentSpin->setNewUnit(unitIndex);
@@ -241,7 +237,7 @@
 	if (ret && m_hasParent)
 	{
 		setTabs(m_parentTabs, m_unitIndex, true);
-		Tabruler::repaint();
+		Tabruler::update();
 		m_parentButton->hide();
 		m_useParentTabs = false;
 	}

Modified: trunk/Scribus/scribus/ui/tabruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/tabruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabruler.cpp	(original)
+++ trunk/Scribus/scribus/ui/tabruler.cpp	Sat Mar 12 21:39:55 2022
@@ -67,7 +67,7 @@
 	m_iter2 = unitRulerGetIter2FromIndex(unitIndex);
 	tabValues = tabs;
 	actTab    = -1;
-	repaint();
+	update();
 }
 
 void RulerT::paintEvent(QPaintEvent *)
@@ -207,7 +207,7 @@
 				emit typeChanged(tabValues[actTab].tabType);
 				emit tabMoved(tabValues[actTab].tabPosition);
 				emit fillCharChanged(tabValues[actTab].tabFillChar);
-				repaint();
+				update();
 				return;
 			}
 		}
@@ -220,7 +220,7 @@
 		actTab = 0;
 		rulerCode = 3;
 		updateTabList();
-		repaint();
+		update();
 		emit newTab();
 		emit typeChanged(tabValues[actTab].tabType);
 		emit tabMoved(tabValues[actTab].tabPosition);
@@ -245,7 +245,7 @@
 				if (tabValues[actTab].tabType > 4)
 					tabValues[actTab].tabType = 0;
 				emit typeChanged(tabValues[actTab].tabType);
-				repaint();
+				update();
 			}
 		}
 	}
@@ -263,7 +263,7 @@
 			}
 			else
 				emit noTabs();
-			repaint();
+			update();
 		}
 	}
 	rulerCode = 0;
@@ -288,7 +288,7 @@
 				if (firstLine + leftIndent > m_rulerWidth)
 					firstLine  = m_rulerWidth - leftIndent;
 				emit firstLineMoved(firstLine);
-				repaint();
+				update();
 				break;
 			case 2:
 				oldInd = leftIndent+firstLine;
@@ -300,7 +300,7 @@
 				firstLine = oldInd - leftIndent;
 				emit leftIndentMoved(leftIndent);
 				emit firstLineMoved(firstLine);
-				repaint();
+				update();
 				break;
 			case 3:
 				tabValues[actTab].tabPosition -= mouseX - mPosX;
@@ -310,7 +310,7 @@
 					tabValues[actTab].tabPosition = m_rulerWidth - 1;
 				updateTabList();
 				emit tabMoved(tabValues[actTab].tabPosition);
-				repaint();
+				update();
 				break;
 			default:
 				break;
@@ -403,7 +403,7 @@
 		offsetIncrement = 30;
 	if (offset + width() > static_cast<int>(m_rulerWidth))
 		offset -= 5;
-	repaint();
+	update();
 }
 
 void RulerT::decreaseOffset()
@@ -414,7 +414,7 @@
 		offsetIncrement = 30;
 	if (offset < 0)
 		offset = 0;
-	repaint();
+	update();
 }
 
 void RulerT::changeTab(int t)
@@ -422,7 +422,7 @@
 	if (actTab < 0 || actTab >= tabValues.count())
 		return;
 	tabValues[actTab].tabType = t;
-	repaint();
+	update();
 }
 
 void RulerT::changeTabChar(QChar t)
@@ -430,7 +430,7 @@
 	if (actTab < 0 || actTab >= tabValues.count())
 		return;
 	tabValues[actTab].tabFillChar = t;
-	repaint();
+	update();
 }
 
 void RulerT::moveTab(double t)
@@ -439,7 +439,7 @@
 		return;
 	tabValues[actTab].tabPosition = t;
 	updateTabList();
-	repaint();
+	update();
 }
 
 void RulerT::removeActTab()
@@ -457,7 +457,7 @@
 		else
 			emit noTabs();
 	}
-	repaint();
+	update();
 }
 
 void RulerT::moveFirstLine(double t)
@@ -473,7 +473,7 @@
 		firstLine = m_rulerWidth - leftIndent;
 		emit firstLineMoved(firstLine);
 	}
-	repaint();
+	update();
 }
 
 void RulerT::moveLeftIndent(double t)
@@ -487,7 +487,7 @@
 	}
 	firstLine = oldInd - leftIndent;
 	emit firstLineMoved(firstLine);
-	repaint();
+	update();
 }
 
 Tabruler::Tabruler( QWidget* parent, bool haveFirst, int unit, const QList<ParagraphStyle::TabRecord>& tabs, double wid ): QWidget( parent )
@@ -774,7 +774,7 @@
 void Tabruler::clearAll()
 {
 	ruler->tabValues.clear();
-	ruler->repaint();
+	ruler->update();
 	lastTabRemoved();
 	emit tabrulerChanged();
 	emit tabsChanged();

Modified: trunk/Scribus/scribus/ui/textpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25025&path=/trunk/Scribus/scribus/ui/textpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/textpalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/textpalette.cpp	Sat Mar 12 21:39:55 2022
@@ -310,7 +310,7 @@
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
 	updateGeometry();
-	repaint();
+	update();
 }
 
 void TextPalette::updateColorList()




More information about the scribus-commit mailing list