ShortcutEditor::ShortcutEditor(QMLPlugin * plugin, QWidget * parent) : QWidget(parent), layout_(this), labelShortcut_(this), plugin_(plugin), activable_(true) { layout_.addWidget(&labelShortcut_); layout_.addWidget(&iconView_); editTimer_.setSingleShot(true); editTimer_.setInterval(SHORTCUT_EDITOR_EDIT_INTERVAL); if(plugin_->clipboard()) setShortcut(plugin_->clipboard()->shortcut()); QObject::connect(&KeyLogger::instance(), &KeyLogger::sequence, this, &ShortcutEditor::onKeyDown); QObject::connect(&editTimer_, &QTimer::timeout, this, &ShortcutEditor::onEditTimeout); QObject::connect(plugin, &QMLPlugin::activableChanged, this, &ShortcutEditor::onActivableChanged); onActivableChanged(plugin->activable()); #ifdef GLASS_EFFECT setStyleSheet(fromResource(":/Transparent/Widget")); #endif }
CAboutDialog::CAboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::CAboutDialog) { ui->setupUi(this); setWindowTitle(tr("About %1").arg(g_programName)); ui->label_programmTitle->setText( "<font size=+5>" + G_FULL_PROGRAM_NAME() + "</font>"); ui->plainTextEdit_about->setPlainText( fromResource(":/about/about.txt")); ui->plainTextEdit_authors->setPlainText( fromResource(":/about/authors.txt")); ui->plainTextEdit_license->setPlainText( fromResource(":/about/license.txt")); ui->plainTextEdit_libraries->setPlainText( fromResource(":/about/libraries.txt")); }
QUrl QQuickControlSettings::style() const { QUrl result; QString path = styleFilePath(); if (fromResource(path)) { result.setScheme("qrc"); path.remove(0, 1); // remove ':' prefix result.setPath(path); } else result = QUrl::fromLocalFile(path); return result; }
static QString styleImportPath(QQmlEngine *engine, const QString &styleName) { QString path = qgetenv("QT_QUICK_CONTROLS_STYLE"); QFileInfo info(path); if (fromResource(path)) { path = info.path(); } else if (info.isRelative()) { path = relativeStyleImportPath(engine, styleName); } else { path = info.absolutePath(); } return path; }
PluginTable::PluginTable(QWidget * parent) : QTableView(parent), model_(new PluginTableModel), delegate_(new PluginTableDelegate) { verticalHeader()->setDefaultSectionSize(50); verticalHeader()->setMinimumSectionSize(50); horizontalHeader()->setStretchLastSection(true); setSelectionMode(QAbstractItemView::NoSelection); setModel(model_.get()); setItemDelegate(delegate_.get()); QObject::connect(model_.get(), &QAbstractItemModel::rowsInserted, [this](const QModelIndex &, int start, int end) { updateRow(start); }); #ifdef GLASS_EFFECT setStyleSheet(fromResource(":/Transparent/TableView")); setShowGrid(false); #endif }