MCPcopy Create free account
hub / github.com/Zalafina/QKeyMapper / parseComboBoxTextToSize

Method parseComboBoxTextToSize

QKeyMapper/qtablesetupdialog.cpp:182–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182QSize QTableSetupDialog::parseComboBoxTextToSize(const QString &text)
183{
184 // Parse text like "16×16" or "32×32" to QSize
185 // Return QSize() (invalid) if parsing fails or values are not positive
186 QStringList sizeParts = text.split(ICON_SIZE_SEPARATORT);
187 if (sizeParts.size() != 2) {
188 return QSize(); // Invalid format
189 }
190
191 bool ok1, ok2;
192 int width = sizeParts[0].toInt(&ok1);
193 int height = sizeParts[1].toInt(&ok2);
194
195 if (ok1 && ok2 && width > 0 && height > 0) {
196 return QSize(width, height);
197 }
198
199 return QSize(); // Invalid size
200}
201
202void QTableSetupDialog::updateTrayIconPixelSizeWithCurrentText()
203{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected