コード例 #1
0
TreeWidgetEditor::TreeWidgetEditor(QDesignerFormWindowInterface *form, QWidget *parent)
    : AbstractItemEditor(form, parent), m_updatingBrowser(false)
{
    m_columnEditor = new ItemListEditor(form, this);
    m_columnEditor->setObjectName(QLatin1String("columnEditor"));
    m_columnEditor->setNewItemText(tr("New Column"));
    ui.setupUi(this);

    injectPropertyBrowser(ui.itemsTab, ui.widget);
    connect(ui.showPropertiesButton, SIGNAL(clicked()),
            this, SLOT(togglePropertyBrowser()));
    togglePropertyBrowser();

    ui.tabWidget->insertTab(0, m_columnEditor, tr("&Columns"));
    ui.tabWidget->setCurrentIndex(0);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

    ui.newItemButton->setIcon(createIconSet(QString::fromUtf8("plus.png")));
    ui.newSubItemButton->setIcon(createIconSet(QString::fromUtf8("downplus.png")));
    ui.deleteItemButton->setIcon(createIconSet(QString::fromUtf8("minus.png")));
    ui.moveItemUpButton->setIcon(createIconSet(QString::fromUtf8("up.png")));
    ui.moveItemDownButton->setIcon(createIconSet(QString::fromUtf8("down.png")));
    ui.moveItemRightButton->setIcon(createIconSet(QString::fromUtf8("leveldown.png")));
    ui.moveItemLeftButton->setIcon(createIconSet(QString::fromUtf8("levelup.png")));

    ui.treeWidget->header()->setMovable(false);

    connect(iconCache(), SIGNAL(reloaded()), this, SLOT(cacheReloaded()));
}
コード例 #2
0
ファイル: tablewidgeteditor.cpp プロジェクト: mohdpatah/qt
TableWidgetEditor::TableWidgetEditor(QDesignerFormWindowInterface *form, QDialog *dialog)
    : AbstractItemEditor(form, 0), m_updatingBrowser(false)
{
    m_columnEditor = new ItemListEditor(form, this);
    m_columnEditor->setObjectName(QLatin1String("columnEditor"));
    m_columnEditor->setNewItemText(tr("New Column"));
    m_rowEditor = new ItemListEditor(form, this);
    m_rowEditor->setObjectName(QLatin1String("rowEditor"));
    m_rowEditor->setNewItemText(tr("New Row"));
    ui.setupUi(dialog);

    injectPropertyBrowser(ui.itemsTab, ui.widget);
    connect(ui.showPropertiesButton, SIGNAL(clicked()),
            this, SLOT(togglePropertyBrowser()));
    setPropertyBrowserVisible(false);

    ui.tabWidget->insertTab(0, m_columnEditor, tr("&Columns"));
    ui.tabWidget->insertTab(1, m_rowEditor, tr("&Rows"));
    ui.tabWidget->setCurrentIndex(0);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

    ui.tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);

    connect(iconCache(), SIGNAL(reloaded()), this, SLOT(cacheReloaded()));

    connect(ui.tableWidget, SIGNAL(currentCellChanged(int,int,int,int)),
            this, SLOT(on_tableWidget_currentCellChanged(int,int,int,int)));
    connect(ui.tableWidget, SIGNAL(itemChanged(QTableWidgetItem*)),
            this, SLOT(on_tableWidget_itemChanged(QTableWidgetItem*)));
    connect(m_columnEditor, SIGNAL(indexChanged(int)),
            this, SLOT(on_columnEditor_indexChanged(int)));
    connect(m_columnEditor, SIGNAL(itemChanged(int,int,QVariant)),
            this, SLOT(on_columnEditor_itemChanged(int,int,QVariant)));
    connect(m_columnEditor, SIGNAL(itemInserted(int)),
            this, SLOT(on_columnEditor_itemInserted(int)));
    connect(m_columnEditor, SIGNAL(itemDeleted(int)),
            this, SLOT(on_columnEditor_itemDeleted(int)));
    connect(m_columnEditor, SIGNAL(itemMovedUp(int)),
            this, SLOT(on_columnEditor_itemMovedUp(int)));
    connect(m_columnEditor, SIGNAL(itemMovedDown(int)),
            this, SLOT(on_columnEditor_itemMovedDown(int)));

    connect(m_rowEditor, SIGNAL(indexChanged(int)),
            this, SLOT(on_rowEditor_indexChanged(int)));
    connect(m_rowEditor, SIGNAL(itemChanged(int,int,QVariant)),
            this, SLOT(on_rowEditor_itemChanged(int,int,QVariant)));
    connect(m_rowEditor, SIGNAL(itemInserted(int)),
            this, SLOT(on_rowEditor_itemInserted(int)));
    connect(m_rowEditor, SIGNAL(itemDeleted(int)),
            this, SLOT(on_rowEditor_itemDeleted(int)));
    connect(m_rowEditor, SIGNAL(itemMovedUp(int)),
            this, SLOT(on_rowEditor_itemMovedUp(int)));
    connect(m_rowEditor, SIGNAL(itemMovedDown(int)),
            this, SLOT(on_rowEditor_itemMovedDown(int)));
}
コード例 #3
0
TreeWidgetEditor::TreeWidgetEditor(QDesignerFormWindowInterface *form, QDialog *dialog)
    : AbstractItemEditor(form, 0), m_updatingBrowser(false)
{
    m_columnEditor = new ItemListEditor(form, this);
    m_columnEditor->setObjectName(QStringLiteral("columnEditor"));
    m_columnEditor->setNewItemText(tr("New Column"));
    ui.setupUi(dialog);

    injectPropertyBrowser(ui.itemsTab, ui.widget);
    connect(ui.showPropertiesButton, SIGNAL(clicked()),
            this, SLOT(togglePropertyBrowser()));
    setPropertyBrowserVisible(false);

    ui.tabWidget->insertTab(0, m_columnEditor, tr("&Columns"));
    ui.tabWidget->setCurrentIndex(0);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

    ui.newItemButton->setIcon(createIconSet(QString::fromUtf8("plus.png")));
    ui.newSubItemButton->setIcon(createIconSet(QString::fromUtf8("downplus.png")));
    ui.deleteItemButton->setIcon(createIconSet(QString::fromUtf8("minus.png")));
    ui.moveItemUpButton->setIcon(createIconSet(QString::fromUtf8("up.png")));
    ui.moveItemDownButton->setIcon(createIconSet(QString::fromUtf8("down.png")));
    ui.moveItemRightButton->setIcon(createIconSet(QString::fromUtf8("leveldown.png")));
    ui.moveItemLeftButton->setIcon(createIconSet(QString::fromUtf8("levelup.png")));

    ui.treeWidget->header()->setSectionsMovable(false);

    connect(ui.newItemButton, SIGNAL(clicked()), this, SLOT(on_newItemButton_clicked()));
    connect(ui.newSubItemButton, SIGNAL(clicked()), this, SLOT(on_newSubItemButton_clicked()));
    connect(ui.moveItemUpButton, SIGNAL(clicked()), this, SLOT(on_moveItemUpButton_clicked()));
    connect(ui.moveItemDownButton, SIGNAL(clicked()), this, SLOT(on_moveItemDownButton_clicked()));
    connect(ui.moveItemRightButton, SIGNAL(clicked()), this, SLOT(on_moveItemRightButton_clicked()));
    connect(ui.moveItemLeftButton, SIGNAL(clicked()), this, SLOT(on_moveItemLeftButton_clicked()));
    connect(ui.deleteItemButton, SIGNAL(clicked()), this, SLOT(on_deleteItemButton_clicked()));
    connect(ui.treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
            this, SLOT(on_treeWidget_currentItemChanged()));
    connect(ui.treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
            this, SLOT(on_treeWidget_itemChanged(QTreeWidgetItem*,int)));

    connect(m_columnEditor, SIGNAL(indexChanged(int)),
            this, SLOT(on_columnEditor_indexChanged(int)));
    connect(m_columnEditor, SIGNAL(itemChanged(int,int,QVariant)),
            this, SLOT(on_columnEditor_itemChanged(int,int,QVariant)));
    connect(m_columnEditor, SIGNAL(itemInserted(int)),
            this, SLOT(on_columnEditor_itemInserted(int)));
    connect(m_columnEditor, SIGNAL(itemDeleted(int)),
            this, SLOT(on_columnEditor_itemDeleted(int)));
    connect(m_columnEditor, SIGNAL(itemMovedUp(int)),
            this, SLOT(on_columnEditor_itemMovedUp(int)));
    connect(m_columnEditor, SIGNAL(itemMovedDown(int)),
            this, SLOT(on_columnEditor_itemMovedDown(int)));

    connect(iconCache(), SIGNAL(reloaded()), this, SLOT(cacheReloaded()));
}
コード例 #4
0
TreeWidgetEditor::TreeWidgetEditor(QDesignerFormWindowInterface *form, QWidget *parent)
    : QDialog(parent), m_updating(false)
{
    ui.setupUi(this);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    m_form = qobject_cast<FormWindowBase *>(form);
    ui.itemIconSelector->setFormEditor(form->core());
    ui.itemIconSelector->setEnabled(false);
    ui.itemIconSelector->setPixmapCache(m_form->pixmapCache());
    ui.itemIconSelector->setIconCache(m_form->iconCache());

    ui.columnIconSelector->setFormEditor(form->core());
    ui.columnIconSelector->setEnabled(false);
    ui.columnIconSelector->setPixmapCache(m_form->pixmapCache());
    ui.columnIconSelector->setIconCache(m_form->iconCache());

    QIcon upIcon = createIconSet(QString::fromUtf8("up.png"));
    QIcon downIcon = createIconSet(QString::fromUtf8("down.png"));
    QIcon backIcon = createIconSet(QString::fromUtf8("back.png"));
    QIcon forwardIcon = createIconSet(QString::fromUtf8("forward.png"));
    QIcon minusIcon = createIconSet(QString::fromUtf8("minus.png"));
    QIcon plusIcon = createIconSet(QString::fromUtf8("plus.png"));
    ui.newColumnButton->setIcon(plusIcon);
    ui.deleteColumnButton->setIcon(minusIcon);
    ui.moveColumnUpButton->setIcon(upIcon);
    ui.moveColumnDownButton->setIcon(downIcon);
    ui.newItemButton->setIcon(plusIcon);
    ui.deleteItemButton->setIcon(minusIcon);
    ui.moveItemUpButton->setIcon(upIcon);
    ui.moveItemDownButton->setIcon(downIcon);
    ui.moveItemRightButton->setIcon(forwardIcon);
    ui.moveItemLeftButton->setIcon(backIcon);

    ui.treeWidget->header()->setMovable(false);

    connect(m_form->iconCache(), SIGNAL(reloaded()), this, SLOT(cacheReloaded()));
}