예제 #1
0
파일: itemdata.cpp 프로젝트: yarod39/CopyQ
ItemWidget *ItemDataLoader::create(const QModelIndex &index, QWidget *parent) const
{
    const QStringList formats = index.data(contentType::formats).toStringList();
    if ( emptyIntersection(formats, formatsToSave()) )
        return NULL;

    return new ItemData( index, m_settings.value("max_bytes", defaultMaxBytes).toInt(), parent );
}
예제 #2
0
QWidget *ItemDataLoader::createSettingsWidget(QWidget *parent)
{
    ui.reset(new Ui::ItemDataSettings);
    QWidget *w = new QWidget(parent);
    ui->setupUi(w);

    const QStringList formats = formatsToSave();
    ui->plainTextEditFormats->setPlainText( formats.join(QString("\n")) );
    ui->spinBoxMaxChars->setValue( m_settings.value("max_bytes", defaultMaxBytes).toInt() );

    connect( ui->treeWidgetFormats, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
             SLOT(on_treeWidgetFormats_itemActivated(QTreeWidgetItem*,int)) );

    return w;
}