예제 #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::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()));
}