toqstr(makeRelPath(qstring_to_ucs4(outname), qstring_to_ucs4(relpath)));
QString testname = reloutname;
+#if QT_VERSION < 0x060000
testname.remove(QRegExp("^(\\.\\./)+"));
+#else
+ testname.remove(QRegularExpression("^(\\.\\./)+"));
+#endif
if (testname.contains("/"))
return outname;
{
setupUi(this);
+#if QT_VERSION < 0x050e00
connect(screenRomanCO, SIGNAL(activated(QString)),
this, SLOT(selectRoman(QString)));
connect(screenSansCO, SIGNAL(activated(QString)),
this, SLOT(selectSans(QString)));
connect(screenTypewriterCO, SIGNAL(activated(QString)),
this, SLOT(selectTypewriter(QString)));
+#else
+ connect(screenRomanCO, SIGNAL(textActivated(QString)),
+ this, SLOT(selectRoman(QString)));
+ connect(screenSansCO, SIGNAL(textActivated(QString)),
+ this, SLOT(selectSans(QString)));
+ connect(screenTypewriterCO, SIGNAL(textActivated(QString)),
+ this, SLOT(selectTypewriter(QString)));
+#endif
+#if QT_VERSION >= 0x060000
+ const QStringList families(QFontDatabase::families());
+#else
QFontDatabase fontdb;
- QStringList families(fontdb.families());
+ const QStringList families(fontdb.families());
+#endif
for (auto const & family : families) {
screenRomanCO->addItem(family);
screenSansCO->addItem(family);
screenTypewriterCO->addItem(family);
}
+#if QT_VERSION < 0x050e00
connect(screenRomanCO, SIGNAL(activated(QString)),
this, SIGNAL(changed()));
connect(screenSansCO, SIGNAL(activated(QString)),
this, SIGNAL(changed()));
connect(screenTypewriterCO, SIGNAL(activated(QString)),
this, SIGNAL(changed()));
+#else
+ connect(screenRomanCO, SIGNAL(textActivated(QString)),
+ this, SIGNAL(changed()));
+ connect(screenSansCO, SIGNAL(textActivated(QString)),
+ this, SIGNAL(changed()));
+ connect(screenTypewriterCO, SIGNAL(textActivated(QString)),
+ this, SIGNAL(changed()));
+#endif
connect(screenZoomSB, SIGNAL(valueChanged(int)),
this, SIGNAL(changed()));
connect(screenTinyED, SIGNAL(textChanged(QString)),
void PrefColors::updateRC(LyXRC const & rc)
{
for (size_type i = 0; i < lcolors_.size(); ++i) {
- QColor color = QColor(guiApp->colorCache().get(lcolors_[i], false));
+ QColor color = guiApp->colorCache().get(lcolors_[i], false);
QPixmap coloritem(32, 32);
coloritem.fill(color);
lyxObjectsLW->item(int(i))->setIcon(QIcon(coloritem));
QColor PrefColors::getDefaultColorByRow(int const row)
{
ColorSet const defaultcolor;
- return defaultcolor.getX11HexName(lcolors_[size_t(row)]).c_str();
+ return defaultcolor.getX11HexName(lcolors_[size_t(row)],
+ guiApp->colorCache().isDarkMode()).c_str();
}
this, SLOT(updateConverter()));
connect(convertersLW, SIGNAL(currentRowChanged(int)),
this, SLOT(switchConverter()));
+#if QT_VERSION < 0x050e00
connect(converterFromCO, SIGNAL(activated(QString)),
this, SLOT(changeConverter()));
connect(converterToCO, SIGNAL(activated(QString)),
this, SLOT(changeConverter()));
+#else
+ connect(converterFromCO, SIGNAL(textActivated(QString)),
+ this, SLOT(changeConverter()));
+ connect(converterToCO, SIGNAL(textActivated(QString)),
+ this, SLOT(changeConverter()));
+#endif
connect(converterED, SIGNAL(textEdited(QString)),
this, SLOT(changeConverter()));
connect(converterFlagED, SIGNAL(textEdited(QString)),
this, SLOT(updatePrettyname()));
connect(formatsCB->lineEdit(), SIGNAL(textEdited(QString)),
this, SIGNAL(changed()));
+#if QT_VERSION < 0x050e00
connect(defaultFormatCB, SIGNAL(activated(QString)),
this, SIGNAL(changed()));
connect(defaultOTFFormatCB, SIGNAL(activated(QString)),
this, SIGNAL(changed()));
connect(defaultPlatexFormatCB, SIGNAL(activated(QString)),
this, SIGNAL(changed()));
+#else
+ connect(defaultFormatCB, SIGNAL(textActivated(QString)),
+ this, SIGNAL(changed()));
+ connect(defaultOTFFormatCB, SIGNAL(textActivated(QString)),
+ this, SIGNAL(changed()));
+ connect(defaultPlatexFormatCB, SIGNAL(textActivated(QString)),
+ this, SIGNAL(changed()));
+#endif
connect(viewerCO, SIGNAL(activated(int)),
this, SIGNAL(changed()));
connect(editorCO, SIGNAL(activated(int)),
viewerCO->blockSignals(true);
viewerCO->clear();
viewerCO->addItem(qt_("None"), QString());
+ viewerCO->addItem(qt_("System Default"), QString("auto"));
updateComboBox(viewer_alternatives, f.name(), viewerCO);
viewerCO->addItem(qt_("Custom"), QString("custom viewer"));
viewerCO->blockSignals(false);
editorCO->blockSignals(true);
editorCO->clear();
editorCO->addItem(qt_("None"), QString());
+ editorCO->addItem(qt_("System Default"), QString("auto"));
updateComboBox(editor_alternatives, f.name(), editorCO);
editorCO->addItem(qt_("Custom"), QString("custom editor"));
editorCO->blockSignals(false);
startCommandED->setValidator(new NoNewLineValidator(startCommandED));
endCommandED->setValidator(new NoNewLineValidator(endCommandED));
+#if QT_VERSION < 0x060000
defaultDecimalSepED->setValidator(new QRegExpValidator(QRegExp("\\S"), this));
+#else
+ defaultDecimalSepED->setValidator(new QRegularExpressionValidator(QRegularExpression("\\S"), this));
+#endif
defaultDecimalSepED->setMaxLength(1);
defaultLengthUnitCO->addItem(lyx::qt_(unit_name_gui[Length::CM]), Length::CM);
index.data(Qt::UserRole).toString());
}
uiLanguageCO->blockSignals(false);
+
+ // FIXME: restore this when it works (see discussion in #6450).
+ respectOSkbdCB->hide();
}
iconSetCO->addItem(qt_("Classic"), "classic");
iconSetCO->addItem(qt_("Oxygen"), "oxygen");
-#if (!(defined Q_WS_X11 || defined(QPA_XCB)) || QT_VERSION < 0x040600)
- useSystemThemeIconsCB->hide();
+#if QT_VERSION >= 0x040600
+ if (guiApp->platformName() != "qt4x11"
+ && guiApp->platformName() != "xcb"
+ && !guiApp->platformName().contains("wayland"))
#endif
+ useSystemThemeIconsCB->hide();
}
QTreeWidgetItem * newItem = nullptr;
// for unbind items, try to find an existing item in the system bind list
if (tag == KeyMap::UserUnbind) {
- QList<QTreeWidgetItem*> const items = shortcutsTW->findItems(lfun_name,
- Qt::MatchFlags(Qt::MatchExactly | Qt::MatchRecursive), 0);
+ QList<QTreeWidgetItem*> const items = shortcutsTW->findItems(shortcut,
+ Qt::MatchFlags(Qt::MatchExactly | Qt::MatchRecursive), 1);
for (auto const & item : items) {
- if (item->text(1) == shortcut) {
+ if (item->text(0) == lfun_name || lfun == FuncRequest::unknown) {
newItem = item;
break;
}
// this should not happen
newItem = new QTreeWidgetItem(shortcutsTW);
}
+ newItem->setText(0, lfun_name);
+ newItem->setText(1, shortcut);
}
- newItem->setText(0, lfun_name);
- newItem->setText(1, shortcut);
// record BindFile representation to recover KeySequence when needed.
newItem->setData(1, Qt::UserRole, toqstr(seq.print(KeySequence::BindFile)));
setItemType(newItem, tag);
if (item) {
user_bind_.bind(&k, func);
shortcutsTW->sortItems(0, Qt::AscendingOrder);
- item->parent()->setExpanded(true);
+ if (item->parent())
+ item->parent()->setExpanded(true);
shortcutsTW->setCurrentItem(item);
shortcutsTW->scrollToItem(item);
} else {