embedded this code into main.cpp to see, would it change behavior or not
int fontId = QFontDatabase::addApplicationFont("qrc:/assets/fonts/Expansiva.otf");
QStringList availableFonts = QFontDatabase::families();
if (fontId == -1) {
qDebug() << "Error: Failed to load custom font from resource.";
} else {
QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontId);
if (fontFamilies.isEmpty()) {
qDebug() << "Error: No font families loaded.";
} else {
qDebug() << "Font family loaded successfully: " << fontFamilies.first();
// Step 2: Set the font style (font family, size, and optional weight or style)
QFont customFont;
customFont.setFamily(fontFamilies.first()); // Use the loaded font's family name
customFont.setPointSize(12); // Set desired font size
customFont.setBold(true); // Make the font bold (optional)
customFont.setItalic(false); // Set italic (optional)
// Step 3: Apply the custom font globally
app.setFont(customFont);
}
}
this address does not provide access to font file:
"qrc:/assets/fonts/Expansiva.otf"
this, yes: ```
"calc_salary/fonts/Expansiva.otf"
resource.qrc looks like
<RCC>
<qresource prefix="/assets">
<file>fonts/Expansiva.otf</file>
<file>fonts/ExpansivaBold.otf</file>
<file>fonts/ExpansivaBoldItalic.otf</file>
<file>fonts/ExpansivaItalic.otf</file>
<file>fonts/ArtsyNight.otf</file>
<file>fonts/ROSEMERO.ttf</file>
</qresource>
</RCC>
is it right or not, smart people has to estimate it