QT_BEGIN_NAMESPACE QQuickMaterialTheme::QQuickMaterialTheme(QPlatformTheme *theme) : QQuickProxyTheme(theme) { QFont font; font.setFamily(QStringLiteral("Roboto")); if (!font.exactMatch()) font.setFamily(QStringLiteral("Noto")); if (font.exactMatch()) { systemFont.setFamily(font.family()); buttonFont.setFamily(font.family()); itemViewFont.setFamily(font.family()); menuItemFont.setFamily(font.family()); } systemFont.setPixelSize(14); buttonFont.setPixelSize(14); buttonFont.setCapitalization(QFont::AllUppercase); buttonFont.setWeight(QFont::Medium); itemViewFont.setPixelSize(14); itemViewFont.setWeight(QFont::Medium); menuItemFont.setPixelSize(16); }
bool QFontProto::exactMatch() const { QFont *item = qscriptvalue_cast<QFont*>(thisObject()); if (item) return item->exactMatch(); return false; }
void tst_QFont::exactMatch() { QFont font; // Check if a non-existing font hasn't an exact match font = QFont( "BogusFont", 33 ); QVERIFY( !font.exactMatch() ); QVERIFY(!QFont("sans").exactMatch()); QVERIFY(!QFont("sans-serif").exactMatch()); QVERIFY(!QFont("serif").exactMatch()); QVERIFY(!QFont("monospace").exactMatch()); }
void tst_QFont::sharing() { // QFontCache references the engineData int refs_by_cache = 1; QFont f; f.setStyleHint(QFont::Serif); f.exactMatch(); // loads engine QCOMPARE(QFontPrivate::get(f)->ref.load(), 1); QVERIFY(QFontPrivate::get(f)->engineData); QCOMPARE(QFontPrivate::get(f)->engineData->ref.load(), 1 + refs_by_cache); QFont f2(f); QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f)); QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2); QVERIFY(QFontPrivate::get(f2)->engineData); QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData); QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache); f2.setKerning(!f.kerning()); QVERIFY(QFontPrivate::get(f2) != QFontPrivate::get(f)); QCOMPARE(QFontPrivate::get(f2)->ref.load(), 1); QVERIFY(QFontPrivate::get(f2)->engineData); QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData); QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 2 + refs_by_cache); f2 = f; QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f)); QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2); QVERIFY(QFontPrivate::get(f2)->engineData); QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData); QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache); if (f.pointSize() > 0) f2.setPointSize(f.pointSize() * 2 / 3); else f2.setPixelSize(f.pixelSize() * 2 / 3); QVERIFY(QFontPrivate::get(f2) != QFontPrivate::get(f)); QCOMPARE(QFontPrivate::get(f2)->ref.load(), 1); QVERIFY(!QFontPrivate::get(f2)->engineData); QVERIFY(QFontPrivate::get(f2)->engineData != QFontPrivate::get(f)->engineData); }
QT_BEGIN_NAMESPACE QQuickUniversalTheme::QQuickUniversalTheme(QPlatformTheme *theme) : QQuickProxyTheme(theme) { const QFont font(QStringLiteral("Segoe UI")); if (font.exactMatch()) { systemFont.setFamily(font.family()); groupBoxTitleFont.setFamily(font.family()); tabButtonFont.setFamily(font.family()); } systemFont.setPixelSize(15); groupBoxTitleFont.setPixelSize(15); groupBoxTitleFont.setWeight(QFont::DemiBold); tabButtonFont.setPixelSize(24); tabButtonFont.setWeight(QFont::Light); }
void tst_QFont::exactMatch() { QFont font; // Check if a non-existing font hasn't an exact match font = QFont( "BogusFont", 33 ); QVERIFY( !font.exactMatch() ); #ifdef Q_OS_WIN QSKIP("Exact matching on windows misses a lot because of the sample chars"); #endif if (QGuiApplication::platformName() == QLatin1String("xcb")) { QVERIFY(QFont("sans").exactMatch()); QVERIFY(QFont("sans-serif").exactMatch()); QVERIFY(QFont("serif").exactMatch()); QVERIFY(QFont("monospace").exactMatch()); } QSKIP("This test is bogus on Unix with support for font aliases in fontconfig"); QFontDatabase fdb; QList<QFontDatabase::WritingSystem> systems = fdb.writingSystems(); for (int system = 0; system < systems.count(); ++system) { QStringList families = fdb.families(systems[system]); if (families.isEmpty()) return; QStringList::ConstIterator f_it, f_end = families.end(); for (f_it = families.begin(); f_it != f_end; ++f_it) { const QString &family = *f_it; if (family.contains('[')) continue; QStringList styles = fdb.styles(family); QVERIFY(!styles.isEmpty()); QStringList::ConstIterator s_it, s_end = styles.end(); for (s_it = styles.begin(); s_it != s_end; ++s_it) { const QString &style = *s_it; if (fdb.isSmoothlyScalable(family, style)) { // smoothly scalable font... don't need to load every pointsize font = fdb.font(family, style, 12); QFontInfo fontinfo(font); if (! fontinfo.exactMatch()) { // Unfortunately, this can fail, since // QFontDatabase does not fill in all font // properties. Check to make sure that the // test didn't fail for obvious reasons if (fontinfo.family().isEmpty() && fontinfo.pointSize() == 0) { // this is a box rendering engine... this can happen from // time to time, especially on X11 with iso10646-1 or // unknown font encodings continue; } #ifdef Q_OS_WIN if (font.family().startsWith("MS ") || fontinfo.family().startsWith("MS ")) { /* qDebug("Family matching skipped for MS-Alias font: %s, fontinfo: %s", font.family().latin1(), fontinfo.family().latin1()); */ } else #endif { if (!(font.family() == fontinfo.family() || fontinfo.family().contains(font.family()) || fontinfo.family().isEmpty())) { qDebug("Test about to fail for font: %s, fontinfo: %s", font.family().toLatin1().constData(), fontinfo.family().toLatin1().constData()); } QVERIFY(font.family() == fontinfo.family() || fontinfo.family().contains(font.family()) || fontinfo.family().isEmpty()); } if (font.pointSize() != -1) { QVERIFY(font.pointSize() == fontinfo.pointSize()); } else { QVERIFY(font.pixelSize() == fontinfo.pixelSize()); } QVERIFY(font.italic() == fontinfo.italic()); if (font.weight() != fontinfo.weight()) { qDebug("font is %s", font.toString().toLatin1().constData()); } QVERIFY(font.weight() == fontinfo.weight()); } else { font.setFixedPitch(!fontinfo.fixedPitch()); QFontInfo fontinfo1(font); QVERIFY( !fontinfo1.exactMatch() ); font.setFixedPitch(fontinfo.fixedPitch()); QFontInfo fontinfo2(font); QVERIFY( fontinfo2.exactMatch() ); } } #if 0 // ############## can only work if we have float point sizes in QFD else { QList<int> sizes = fdb.pointSizes(family, style); QVERIFY(!sizes.isEmpty()); QList<int>::ConstIterator z_it, z_end = sizes.end(); for (z_it = sizes.begin(); z_it != z_end; ++z_it) { const int size = *z_it; // Initialize the font, and check if it is an exact match font = fdb.font(family, style, size); QFontInfo fontinfo(font, (QFont::Script) script); if (! fontinfo.exactMatch()) { // Unfortunately, this can fail, since // QFontDatabase does not fill in all font // properties. Check to make sure that the // test didn't fail for obvious reasons if (fontinfo.family().isEmpty() && fontinfo.pointSize() == 0) { // this is a box rendering engine... this can happen from // time to time, especially on X11 with iso10646-1 or // unknown font encodings continue; } // no need to skip MS-fonts here it seems if (!(font.family() == fontinfo.family() || fontinfo.family().contains(font.family()) || fontinfo.family().isEmpty())) { qDebug("Test about to fail for font: %s, fontinfo: %s", font.family().latin1(), fontinfo.family().latin1()); } QVERIFY(font.family() == fontinfo.family() || fontinfo.family().contains(font.family()) || fontinfo.family().isEmpty()); if (font.pointSize() != -1) { QVERIFY(font.pointSize() == fontinfo.pointSize()); } else { QVERIFY(font.pixelSize() == fontinfo.pixelSize()); } QVERIFY(font.italic() == fontinfo.italic()); QVERIFY(font.weight() == fontinfo.weight()); } else { font.setFixedPitch(!fontinfo.fixedPitch()); QFontInfo fontinfo1(font, (QFont::Script) script); QVERIFY( !fontinfo1.exactMatch() ); font.setFixedPitch(fontinfo.fixedPitch()); QFontInfo fontinfo2(font, (QFont::Script) script); QVERIFY( fontinfo2.exactMatch() ); } } } #endif } } } }
/** * Apply any user overrides to the screen geometry */ void MythUIHelperPrivate::StoreGUIsettings() { if (x_override >= 0 && y_override >= 0) { GetMythDB()->OverrideSettingForSession("GuiOffsetX", QString::number(x_override)); GetMythDB()->OverrideSettingForSession("GuiOffsetY", QString::number(y_override)); } if (w_override > 0 && h_override > 0) { GetMythDB()->OverrideSettingForSession("GuiWidth", QString::number(w_override)); GetMythDB()->OverrideSettingForSession("GuiHeight", QString::number(h_override)); } m_screenxbase = GetMythDB()->GetNumSetting("GuiOffsetX"); m_screenybase = GetMythDB()->GetNumSetting("GuiOffsetY"); m_screenwidth = m_screenheight = 0; GetMythDB()->GetResolutionSetting("Gui", m_screenwidth, m_screenheight); // If any of these was _not_ set by the user, // (i.e. they are 0) use the whole-screen defaults if (!m_screenxbase) m_screenxbase = m_xbase; if (!m_screenybase) m_screenybase = m_ybase; if (!m_screenwidth) m_screenwidth = m_width; if (!m_screenheight) m_screenheight = m_height; if (m_screenheight < 160 || m_screenwidth < 160) { LOG(VB_GENERAL, LOG_ERR, LOC + "Somehow, your screen size settings are bad.\n\t\t\t" + QString("GuiResolution: %1\n\t\t\t") .arg(GetMythDB()->GetSetting("GuiResolution")) + QString(" old GuiWidth: %1\n\t\t\t") .arg(GetMythDB()->GetNumSetting("GuiWidth")) + QString(" old GuiHeight: %1\n\t\t\t") .arg(GetMythDB()->GetNumSetting("GuiHeight")) + QString("m_width: %1").arg(m_width) + QString("m_height: %1\n\t\t\t").arg(m_height) + "Falling back to 640x480"); m_screenwidth = 640; m_screenheight = 480; } m_wmult = m_screenwidth / (float)m_baseWidth; m_hmult = m_screenheight / (float)m_baseHeight; // Default font, _ALL_ fonts inherit from this! // e.g All fonts will be 19 pixels unless a new size is explicitly defined. QFont font = QFont("Arial"); if (!font.exactMatch()) font = QFont(); font.setStyleHint(QFont::SansSerif, QFont::PreferAntialias); font.setPixelSize((int)((19.0f * m_hmult) + 0.5f)); int stretch = (int)(100 / GetPixelAspectRatio()); font.setStretch(stretch); // QT m_fontStretch = stretch; // MythUI QApplication::setFont(font); }
void tst_QFontCache::clear() { #ifdef QT_BUILD_INTERNAL QFontEngine_startCollectingEngines(); #else // must not crash, at very least ;) #endif QFontEngine *fontEngine = 0; { // we're never caching the box (and the "test") font engines // let's ensure we're not leaking them as well as the cached ones qt_setQtEnableTestFont(true); QFont f; f.setFamily("__Qt__Box__Engine__"); f.exactMatch(); // loads engine } { QFontDatabase db; QFont f; f.setStyleHint(QFont::Serif); const QString familyForHint(f.defaultFamily()); // it should at least return a family that is available QVERIFY(db.hasFamily(familyForHint)); f.exactMatch(); // loads engine fontEngine = QFontPrivate::get(f)->engineForScript(QChar::Script_Common); QVERIFY(fontEngine); QVERIFY(QFontCache::instance()->engineCacheCount.value(fontEngine) > 0); // ensure it is cached // acquire the engine to use it somewhere else: // (e.g. like the we do in QFontSubset() or like QRawFont does in fromFont()) fontEngine->ref.ref(); // cache the engine once again; there is a special case when the engine is cached more than once QFontCache::instance()->insertEngine(QFontCache::Key(QFontDef(), 0, 0), fontEngine); } // use it: // e.g. fontEngine->stringToCMap(..); // and whilst it is alive, don't hesitate to add/remove the app-local fonts: // (QFontDatabase::{add,remove}ApplicationFont() clears the cache) QFontCache::instance()->clear(); // release the acquired engine: if (fontEngine) { if (!fontEngine->ref.deref()) delete fontEngine; fontEngine = 0; } // we may even exit the application now: QFontCache::instance()->cleanup(); #ifdef QT_BUILD_INTERNAL QList<QFontEngine *> leakedEngines = QFontEngine_stopCollectingEngines(); for (int i = 0; i < leakedEngines.size(); ++i) qWarning() << i << leakedEngines.at(i) << leakedEngines.at(i)->ref.load(); // and we are not leaking! QCOMPARE(leakedEngines.size(), 0); #endif }
void KeypadWidget::setType(bool is83, unsigned color_scheme) { QColor c_center; QColor c_sides; QColor c_num, c_text, c_other, c_graph; curr_color = color_scheme; c_num = QColor::fromRgb(0xeeeeee); c_text = QColor::fromRgb(0xeeeeee); c_other = QColor::fromRgb(0x1d1d1d); c_graph = QColor::fromRgb(0xeeeeee); switch(color_scheme) { default: case KEYPAD_BLACK: c_center = QColor::fromRgb(0x191919); c_sides = QColor::fromRgb(0x3b3b3b); break; case KEYPAD_WHITE: c_center = QColor::fromRgb(0xe8e8e8); c_sides = QColor::fromRgb(0xc4c4c4); c_num = QColor::fromRgb(0x707880); c_text = QColor::fromRgb(0x222222); c_other = QColor::fromRgb(0xc0c0c0); break; case KEYPAD_TRUE_BLUE: c_center = QColor::fromRgb(0x385E9D); c_sides = c_center.lighter(130); c_num = QColor::fromRgb(0xdedede); c_other = QColor::fromRgb(0x274F91); break; case KEYPAD_DENIM: c_center = QColor::fromRgb(0x003C71); c_sides = c_center.lighter(130); c_other = QColor::fromRgb(0x013766); break; case KEYPAD_SILVER: c_center = QColor::fromRgb(0x7C878E); c_sides = c_center.lighter(130); c_other = QColor::fromRgb(0x191919); c_graph = QColor::fromRgb(0xD0D3D4); break; case KEYPAD_PINK: c_center = QColor::fromRgb(0xDF1995); c_sides = c_center.lighter(130); c_other = QColor::fromRgb(0xAA0061); break; case KEYPAD_PLUM: c_center = QColor::fromRgb(0x830065); c_sides = c_center.lighter(130); c_other = QColor::fromRgb(0x5E2751); break; case KEYPAD_RED: c_center = QColor::fromRgb(0xAB2328); c_sides = c_center.lighter(130); c_other = QColor::fromRgb(0x8A2A2B); break; case KEYPAD_LIGHTNING: c_center = QColor::fromRgb(0x0077C8); c_sides = c_center.lighter(130); c_other = QColor::fromRgb(0x0077C8); break; case KEYPAD_GOLDEN: c_center = QColor::fromRgb(0xD8D3B6); c_sides = c_center.lighter(130); c_other = QColor::fromRgb(0xD8D3B6); break; } m_background = {s_baseRect.topLeft(), s_baseRect.topRight()}; m_background.setColorAt(0.00, c_sides); m_background.setColorAt(0.18, c_center); m_background.setColorAt(0.82, c_center); m_background.setColorAt(1.00, c_sides); QFont font; font.setStyleHint(QFont::SansSerif, QFont::PreferOutline); font.setFamily("Helvetica Neue Bold"); if (!font.exactMatch()) { font.setFamily("Open Sans Bold"); } font.setBold(true); font.setPixelSize(5); #ifdef Q_OS_WIN font.setWeight(QFont::Black); #else font.setStretch(QFont::SemiCondensed); #endif m_config.labelFont = font, m_config.secondFont = font, m_config.alphaFont = font, m_config.secondColor = QColor::fromRgb(0x93c3f3), m_config.alphaColor = QColor::fromRgb(0xa0ca1e), m_config.graphColor = c_graph, m_config.numColor = c_num, m_config.otherColor = c_other, m_config.blackColor = QColor::fromRgb(0x222222), m_config.whiteColor = QColor::fromRgb(0xeeeeee), m_config.textColor = c_text, m_config.key = {1, 0}; #ifdef _MSC_VER /* Temporary hack... QStringLiteral mangles the UTF-8 string on MSVC for some reason */ #define Label(str) QString::fromUtf8(str) #else #define Label(str) QStringLiteral(str) #endif #define LabelFrEn(fr, en) (is83 ? Label(fr) : Label(en)) addKey(new GraphKey{m_config, LabelFrEn("graphe", "graph"), Label("table"), Label("f5"), 15, 2, 2 - is83}); addKey(new GraphKey{m_config, Label("trace"), LabelFrEn("calculs", "calc"), Label("f4"), is83 ? 10 : 12, 2 + is83 * 2, 1}); addKey(new GraphKey{m_config, Label("zoom"), Label("format"), Label("f3"), is83 ? 11 : 13, 2 + is83 * 2, is83 ? 1 : 5}); addKey(new GraphKey{m_config, LabelFrEn("fenêtre", "window"), LabelFrEn("déf table", "tblset"), Label("f2"), 15 - is83, is83 ? 6 : 2, 4 - is83}); addKey(new GraphKey{m_config, is83 ? Label("f(x)") : Label("y="), LabelFrEn("graph stats", "stat plot"), Label("f1"), 6 + is83, is83 ? 6 : 2, is83 ? 10 : 8}); addKey(new SecondKey{m_config, LabelFrEn("2nde", "2nd")}); #ifdef Q_OS_MACX addKey(new OtherKey{m_config, 16 - is83 * 2, 45, 37, Label(" mode"), LabelFrEn("quitter", "quit")}); #else addKey(new OtherKey{m_config, 16 - is83 * 2, 45, 37, Label("mode"), LabelFrEn("quitter", "quit")}); #endif addKey(new OtherKey{m_config, is83 ? 14 : 8, 72, 37, LabelFrEn("suppr", "del"), LabelFrEn("insérer", "ins")}); addKey(new OtherKey{m_config, 7, Label("on"), Label("off")}); addKey(new OtherKey{m_config, 13, Label("sto→"), LabelFrEn("rappel", "rcl"), Label("X"), is83 * 2, is83 * 3}); #ifdef Q_OS_MACX addKey(new OtherKey{m_config, 7, Label(" ln"), Label("eˣ"), Label("S"), is83 * 2, is83 * 2}); addKey(new OtherKey{m_config, 9, Label(" log"), Label("10ˣ"), Label("N"), is83 * 2, is83 * 3}); #else addKey(new OtherKey{m_config, 7, Label("ln"), Label("eˣ"), Label("S"), is83 * 2, is83 * 2}); addKey(new OtherKey{m_config, 9, Label("log"), Label("10ˣ"), Label("N"), is83 * 2, is83 * 3}); #endif addKey(new OtherKey{m_config, 6, Label("x²"), Label("√‾‾"), Label("I"), is83, is83 * 3}); addKey(new OtherKey{m_config, is83 ? 6 : 8, LabelFrEn("◀ ▶", "x⁻¹"), LabelFrEn("angle", "matrix"), Label("D"), is83 * 2, is83 ? 2 : 4}); #ifdef Q_OS_MACX addKey(new OtherKey{m_config, 14, Label(" math"), LabelFrEn("tests", "test"), Label("A"), is83 * 2, is83 * 2}); #else addKey(new OtherKey{m_config, 14, Label("math"), LabelFrEn("tests", "test"), Label("A"), is83 * 2, is83 * 2}); #endif addKey(new AlphaKey{m_config, LabelFrEn("verr A", "A-lock")}); #ifdef Q_OS_MACX addKey(new NumKey{m_config, Label("0"), Label("catalog"), Label("_"), is83 * 2, 6}); #else addKey(new NumKey{m_config, Label("0"), Label("catalog"), Label("⎵"), is83 * 2, 6}); #endif addKey(new NumKey{m_config, Label("1"), Label("L1"), Label("Y"), is83 * 2, is83 ? 3 : 1}); addKey(new NumKey{m_config, Label("4"), Label("L4"), Label("T"), is83 * 2, is83 ? 3 : 1}); #if defined(_WIN32) || defined(Q_OS_MACX) addKey(new NumKey{m_config, Label("7"), LabelFrEn("un", "u"), Label("O"), is83 * 2, 1 + is83}); #else addKey(new NumKey{m_config, Label("7"), LabelFrEn("uₙ", "u"), Label("O"), is83 * 2, 1 + is83}); #endif addKey(new OtherKey{m_config, 2, Label(","), Label("EE"), Label("J"), is83 * 2, 1 + is83}); addKey(new OtherKey{m_config, 8 + is83, LabelFrEn("trig", "sin"), LabelFrEn("π", "sin⁻¹"), Label("E"), is83 * 2, 1}); #ifdef Q_OS_MACX addKey(new OtherKey{m_config, 14 + is83, LabelFrEn("matrice ", " apps"), LabelFrEn("x⁻¹", "angle"), Label("B"), is83 * 2, 1}); #else addKey(new OtherKey{m_config, 14 + is83, LabelFrEn("matrice", "apps"), LabelFrEn("x⁻¹", "angle"), Label("B"), is83 * 2, 1}); #endif #ifdef _WIN32 addKey(new OtherKey{m_config, 15 + is83, Label("X,T,θ,n"), LabelFrEn("échanger", "link"), QString{}, is83 * 2, is83 * 3}); #elif defined(Q_OS_MACX) addKey(new OtherKey{m_config, 15 + is83, Label(" X,T,θ,n "), LabelFrEn("échanger", "link"), QString{}, 1, 1}); #else addKey(new OtherKey{m_config, 15 + is83, Label("X,T,θ,n"), LabelFrEn("échanger", "link"), QString{}, 1, 1}); #endif addKey(new NumKey{m_config, is83 * 2}); addKey(new NumKey{m_config, Label("2"), Label("L2"), Label("Z"), is83 * 2, is83 * 3}); addKey(new NumKey{m_config, Label("5"), Label("L5"), Label("U"), is83 * 2, is83 * 3}); #if defined(_WIN32) || defined(Q_OS_MACX) addKey(new NumKey{m_config, Label("8"), LabelFrEn("vn", "v"), Label("P"), is83 * 2, is83 * 2}); #else addKey(new NumKey{m_config, Label("8"), LabelFrEn("vₙ", "v"), Label("P"), is83 * 2, is83 * 2}); #endif addKey(new OtherKey{m_config, 3, Label("("), Label("{"), Label("K"), is83 * 2, is83}); #ifdef Q_OS_MACX addKey(new OtherKey{m_config, is83 ? 12 : 9, LabelFrEn("résol", "cos"), LabelFrEn("apps", "cos⁻¹"), Label("F"), is83 * 2, is83 * 2}); #else addKey(new OtherKey{m_config, is83 ? 12 : 9, LabelFrEn("résol", "cos"), LabelFrEn("apps", "cos⁻¹"), Label("F"), is83 * 2, is83 * 2}); #endif #ifdef Q_OS_MACX addKey(new OtherKey{m_config, 14, Label(" prgm"), LabelFrEn("dessin", "draw"), Label("C"), is83 * 2, is83 * 2}); addKey(new OtherKey{m_config, 11 + is83, LabelFrEn("stats", " stat"), LabelFrEn("listes", "list")}); #else addKey(new OtherKey{m_config, 14, Label("prgm"), LabelFrEn("dessin", "draw"), Label("C"), is83 * 2, is83 * 2}); addKey(new OtherKey{m_config, 11 + is83, LabelFrEn("stats", "stat"), LabelFrEn("listes", "list")}); #endif addKey(new NumKey{m_config, Label("(-)"), LabelFrEn("rép", "ans"), Label("?"), is83 * 2, is83 * 3, 11}); addKey(new NumKey{m_config, Label("3"), Label("L3"), Label("θ"), is83 * 2, is83 * 3}); addKey(new NumKey{m_config, Label("6"), Label("L6"), Label("V"), is83 * 2, is83 * 3}); #if defined(_WIN32) || defined(Q_OS_MACX) addKey(new NumKey{m_config, Label("9"), LabelFrEn("wn", "w"), Label("Q"), is83 * 2, is83 * 3}); #else addKey(new NumKey{m_config, Label("9"), LabelFrEn("wₙ", "w"), Label("Q"), is83 * 2, is83 * 3}); #endif addKey(new OtherKey{m_config, 3, Label(")"), Label("}"), Label("L"), is83 * 2, is83}); #ifdef _WIN32 addKey(new OtherKey{m_config, 9, LabelFrEn("⸋|⸋", "tan"), LabelFrEn("∫⸋|⸋d▫‣", "tan⁻¹"), Label("G"), is83 * 2, is83 * 2}); #elif defined(Q_OS_MACX) addKey(new OtherKey{m_config, 9, LabelFrEn("▫/▫", "tan"), LabelFrEn("∫⸋d▫‣", "tan⁻¹"), Label("G"), is83 * 2, is83 * 2}); #else addKey(new OtherKey{m_config, 9, LabelFrEn("▫/▫", "tan"), LabelFrEn("∫⸋̻◻d▫‣", "tan⁻¹"), Label("G"), is83 * 2, is83 * 2}); #endif addKey(new OtherKey{m_config, is83 ? 9 : 12, LabelFrEn("var", "vars"), LabelFrEn("distrib", "distr"), Label(""), 0, is83}); m_config.next(); #ifdef Q_OS_MACX addKey(new OperKey{m_config, LabelFrEn(" entrer", " enter"), LabelFrEn("précéd", "entry"), is83 ? QString{} : Label("solve"), 6, is83 ? 0 : 5, {16, 5}}); #else addKey(new OperKey{m_config, LabelFrEn("entrer", "enter"), LabelFrEn("précéd", "entry"), is83 ? QString{} : Label("solve"), 6, is83 ? 0 : 5, {16, 5}}); #endif addKey(new OperKey{m_config, Label("+"), LabelFrEn("mém", "mem"), Label("“"), is83 * 2, is83 * 5}); addKey(new OperKey{m_config, Label("—"), Label("]"), Label("W"), is83 * 2, is83 * 2}); addKey(new OperKey{m_config, Label("×"), Label("["), Label("R"), is83 * 2, is83 * 2}); addKey(new OperKey{m_config, Label("÷"), Label("e"), Label("M"), is83 * 2, is83 * 2}); addKey(new OtherKey{m_config, is83 ? QString{} : Label("π"), is83 * 2}); #ifdef Q_OS_MACX addKey(new OtherKey{m_config, 15, LabelFrEn(" annul", " clear")}); #else addKey(new OtherKey{m_config, 15, LabelFrEn("annul", "clear")}); #endif #undef Label #undef LabelFrEn m_config.next(); QPoint center{121, 53}; QRect outer, inner; outer.setSize({35, 35}); inner.setSize({16, 16}); outer.moveCenter(center); inner.moveCenter(center); addKey(new ArrowKey{m_config, outer, inner, 3}); addKey(new ArrowKey{m_config, outer, inner, 2}); addKey(new ArrowKey{m_config, outer, inner, 0}); addKey(new ArrowKey{m_config, outer, inner, 1}); update(); }