Example #1
0
void FullMessageCombiner::load()
{
    Imap::Mailbox::TreeItemPart *headerPart = headerPartPtr();
    headerPart->fetch(const_cast<Mailbox::Model *>(m_model));
    Imap::Mailbox::TreeItemPart *bodyPart = bodyPartPtr();
    bodyPart->fetch(const_cast<Mailbox::Model *>(m_model));
    slotDataChanged(QModelIndex(), QModelIndex());
}
/** @short Request a download of the actual bulk data for the given message */
void MessageDownloader::requestDataDownload(const QModelIndex &message)
{
    const uint uid = message.data( Imap::Mailbox::RoleMessageUid ).toUInt();
    Q_ASSERT(uid);

    QMap<uint,MessageMetadata>::iterator it = m_parts.find(uid);
    Q_ASSERT(it != m_parts.end());
    Q_ASSERT(it->hasMessage);

    // Let's see if we can find out what the "main part" is.
    // The "main part" cannot be determined prior to the message's metadata becoming available.

    QModelIndex mainPart;
    Imap::Mailbox::FindInterestingPart::MainPartReturnCode status =
            Imap::Mailbox::FindInterestingPart::findMainPartOfMessage(message, mainPart, it->partMessage, 0);
    it->mainPart = mainPart;
    switch (status) {
    case Imap::Mailbox::FindInterestingPart::MAINPART_FOUND:
    case Imap::Mailbox::FindInterestingPart::MAINPART_PART_LOADING:
        // The MAINPART_PART_LOADING is a confusing name -- as we're calling findMainPartOfMessage with the last parameter being
        // nullptr, the function will not attempt to actually fetch the data, and therefore the exit status cannot be
        // MAINPART_FOUND, so it will be MAINPART_PART_LOADING. Yep, confusing.
#ifdef DEBUG_PENDING_MESSAGES
        qDebug() << "Requesting data for " << uid;
#endif
        // Ask for the data.
        Q_ASSERT(mainPart.isValid());
        mainPart.data(Imap::Mailbox::RolePartData);
        break;

    case Imap::Mailbox::FindInterestingPart::MAINPART_MESSAGE_NOT_LOADED:
        Q_ASSERT(false);
        break;

    case Imap::Mailbox::FindInterestingPart::MAINPART_PART_CANNOT_DETERMINE:
        it->hasMainPart = true;
        it->mainPartFailed = true;
        log(QString::fromUtf8("Cannot find the main part for %1").arg(QString::number(uid)));
        break;
    }

    // Now request the rest of the data
    const QAbstractItemModel *model = message.model();
    Q_ASSERT(model);
    QModelIndex header = model->index(0, Imap::Mailbox::TreeItem::OFFSET_HEADER, message);
    header.data(Imap::Mailbox::RolePartData);
    it->hasHeader = header.data(Imap::Mailbox::RoleIsFetched).toBool();
    QModelIndex text = model->index(0, Imap::Mailbox::TreeItem::OFFSET_TEXT, message);
    text.data(Imap::Mailbox::RolePartData);
    it->hasBody = text.data(Imap::Mailbox::RoleIsFetched).toBool();

    if (it->hasMainPart && it->hasHeader && it->hasBody) {
        // We have everything what we need at this point
        slotDataChanged(message, message);
    }
}
void FullMessageCombiner::load()
{
    if (!indexesValid())
        return;

    m_headerPartIndex.data(Imap::Mailbox::RolePartData);
    m_bodyPartIndex.data(Imap::Mailbox::RolePartData);

    slotDataChanged(QModelIndex(), QModelIndex());
}
Example #4
0
/** show current Page */
void KControlAddEdit::showPage(QWidget *page)
{
    QWizard::showPage(page);
    slotDataChanged();

    if ( page == _pageQuestion ) {
        _questionText->setFocus();
    } else if ( page == _pageAnswer ) {
        _answerText->setFocus();
    }
}
void FullMessageCombiner::slotDataChanged(const QModelIndex &left, const QModelIndex &right)
{
    Q_UNUSED(left);
    Q_UNUSED(right);

    if (headerPartPtr()->fetched() && bodyPartPtr()->fetched()) {
       emit completed();
       // Disconnect this slot from its connected signal to prevent emitting completed() many times
       // when dataChanged() is emitted and the parts are already fetched.
       disconnect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged(QModelIndex,QModelIndex)));
    }
}
Example #6
0
QT_END_NAMESPACE

Priorities::Priorities(QWidget *parent /* = 0 */):
    DictionaryTemplate(parent)
  , actualRecords(true)
{
    m_model      = new QStandardItemModel(this);

    m_proxymodel = new QSortFilterProxyModel(this);
    m_proxymodel->setSourceModel(m_model);
    m_proxymodel->setFilterKeyColumn(1);
    m_proxymodel->setFilterCaseSensitivity(Qt::CaseInsensitive);

    m_selectionModel  = new QItemSelectionModel(m_proxymodel);

    treeView->setRootIsDecorated(false);
    treeView->setAlternatingRowColors(true);
    treeView->setModel(m_proxymodel);
    treeView->setSelectionModel(m_selectionModel);

    ui->m_lblCurrentUser->setText(QString("Пользователь: <b><u>" + currentUser() + "</u></b>"));

    dictionaryDialog->ui->comboBoxIcon->addItem(QIcon("data/picture/additionally/red.ico"),    "Высокий");
    dictionaryDialog->ui->comboBoxIcon->addItem(QIcon("data/picture/additionally/yellow.ico"), "Средний");
    dictionaryDialog->ui->comboBoxIcon->addItem(QIcon("data/picture/additionally/green.ico"),  "Низкий");

    connect(this, SIGNAL(pushSelectRecordData()), SLOT(slotPushSelectRecordData()));
    connect(lineEditSearchToItem, SIGNAL(textEdited(QString)),
            m_proxymodel, SLOT(setFilterWildcard(QString)));
    connect(getClearButton(), SIGNAL(clicked()), SLOT(slotClearSearchToItem()));
    connect(dictionaryDialog, SIGNAL(saveDataChanged()), this,      SLOT(slotInsertOrUpdateRecords()));
    connect(m_selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            this, SLOT(slotDataChanged(QModelIndex)));
    connect(treeView, SIGNAL(clicked(QModelIndex)),
            this, SLOT(slotDataChanged(QModelIndex)));
    connect(this, SIGNAL(selectionModelIndex(QModelIndex)), SLOT(slotGetSelectionModel(QModelIndex)));

    slotSelectRecords(actualRecords);
}
Example #7
0
KNewEquityEntryDlg::KNewEquityEntryDlg(QWidget *parent)
    : kNewEquityEntryDecl(parent)
{
  setModal(true);
  edtFraction->setCalculatorButtonVisible(false);
  edtFraction->setPrecision(0);
  edtFraction->loadText("100");

  connect(btnOK, SIGNAL(clicked()), this, SLOT(onOKClicked()));
  connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));

  connect(edtFraction, SIGNAL(textChanged(QString)), this, SLOT(slotDataChanged()));
  connect(edtMarketSymbol, SIGNAL(textChanged(QString)), this, SLOT(slotDataChanged()));
  connect(edtEquityName, SIGNAL(textChanged(QString)), this, SLOT(slotDataChanged()));

  // add icons to buttons
  btnOK->setGuiItem(KStandardGuiItem::ok());
  btnCancel->setGuiItem(KStandardGuiItem::cancel());

  slotDataChanged();

  edtEquityName->setFocus();
}
Example #8
0
FullMessageCombiner::FullMessageCombiner(const QModelIndex &messageIndex, QObject *parent) :
    QObject(parent), m_model(0), m_messageIndex(messageIndex)
{
    Imap::Mailbox::Model::realTreeItem(messageIndex, &m_model);
    Q_ASSERT(m_model);
    Imap::Mailbox::TreeItemPart *headerPart = headerPartPtr();
    Imap::Mailbox::TreeItemPart *bodyPart = bodyPartPtr();

    Q_ASSERT(headerPart);
    Q_ASSERT(bodyPart);

    m_headerPartIndex = headerPart->toIndex(const_cast<Mailbox::Model *>(m_model));
    Q_ASSERT(m_headerPartIndex.isValid());

    m_bodyPartIndex = bodyPart->toIndex(const_cast<Mailbox::Model *>(m_model));
    Q_ASSERT(m_bodyPartIndex.isValid());

    connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(slotDataChanged(QModelIndex,QModelIndex)));
}
Example #9
0
void ImportRatingOverlay::setActive(bool active)
{
    AbstractWidgetDelegateOverlay::setActive(active);

    if (active)
    {
        connect(ratingWidget(), SIGNAL(signalRatingChanged(int)),
                this, SLOT(slotRatingChanged(int)));

        if (view()->model())
        {
            connect(view()->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
                    this, SLOT(slotDataChanged(QModelIndex,QModelIndex)));
        }
    }
    else
    {
        // widget is deleted

        if (view() && view()->model())
EdgeSetTypeWidget::EdgeSetTypeWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::EdgeSetTypeWidget)
{
    ui->setupUi(this);

    table = new PointsTableModel();
//    QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
//    proxyModel->setSourceModel(table);
//    ui->tableView->setModel(proxyModel);

    ui->tableView->setModel(table);
    ui->tableView->resizeColumnsToContents();
    ui->tableView->setSortingEnabled(false);
//    ui->tableView->set
    ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    ui->tableView->verticalHeader()->hide();
//    ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
//    table->insertRows(0,2,QModelIndex());
//    selectedEdgeId=-1;

    QDoubleValidator * dvalidator = new QDoubleValidator();
    ui->radiusLineEdit->setValidator(dvalidator);
    ui->radiusLineEdit->setText("1.0");
    connect(ui->tableView->selectionModel(),
        SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
        this, SIGNAL(selectionChanged(QItemSelection)));

    connect(table,SIGNAL(pointEdited()),
            this,SLOT(slotDataChanged()));
    connect(ui->pushButtonApply,SIGNAL(clicked()),this,SLOT(slotApply()));
    connect(ui->selectPatchPushButton,SIGNAL(clicked()),
            this,SIGNAL(startSelectPatch()));
    connect(ui->typeComboBox,SIGNAL(currentIndexChanged(int)),
            this,SLOT(slotTypeChanged()));
    connect(ui->useRadiusCheckBox,SIGNAL(toggled(bool)),
            this,SLOT(slotUseRadiusToggled()));
}
Example #11
0
void FullMessageCombiner::slotDataChanged(const QModelIndex &left, const QModelIndex &right)
{
    Q_UNUSED(left);
    Q_UNUSED(right);

    if (headerPartPtr()->fetched() && bodyPartPtr()->fetched()) {
       emit completed();
       // Disconnect this slot from its connected signal to prevent emitting completed() many times
       // when dataChanged() is emitted and the parts are already fetched.
       disconnect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged(QModelIndex,QModelIndex)));
    }

    Imap::Mailbox::Model *model = const_cast<Imap::Mailbox::Model*>(m_model);
    bool headerOffline = headerPartPtr()->isUnavailable(model);
    bool bodyOffline = bodyPartPtr()->isUnavailable(model);
    if (headerOffline && bodyOffline) {
        emit failed(tr("Offline mode: uncached message data not available"));
    } else if (headerOffline) {
        emit failed(tr("Offline mode: uncached header data not available"));
    } else if (bodyOffline) {
        emit failed(tr("Offline mode: uncached body data not available"));
    }
}
void TagsLineEditOverlay::setActive(bool active)
{
    AbstractWidgetDelegateOverlay::setActive(active);

    if (active)
    {
        connect(addTagsLineEdit(), SIGNAL(returnPressed(QString)),
                this, SLOT(slotTagChanged(QString)));

        if (view()->model())
            connect(view()->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
                    this, SLOT(slotDataChanged(QModelIndex,QModelIndex)));
    }
    else
    {
        // widget is deleted

        if (view() && view()->model())
        {
            disconnect(view()->model(), 0, this, 0);
        }
    }
}
void EdgeSetTypeWidget::setSelectedPatch(vtkIdType selPatchId)
{
    double c[3];
    HexPatch * p = HexPatch::SafeDownCast(
        hexBlocker->patches->GetItemAsObject(selPatchId)
                );
    p->getCenter(c);
    p->resetColor();
    if(ui->useRadiusCheckBox->isChecked())
    {
        double R=ui->radiusLineEdit->text().toDouble();

        //check for sensible radius.
        if(R==0.0)
        {
            emit setStatusText(tr("Cannot use zero radius"));
            return;
        }
        double edgeLength = selectedEdge->getLength();
        if( -edgeLength/2.0 < R &&  R < edgeLength/2.0)
        {
            QString msg=QString(
  "The radius has to be larger than or equal to  half the edge length, i.e >= ");
            msg.append(QString::number(edgeLength/2.0));
            emit setStatusText(tr(msg));
            return;
        }
        selectedEdge->calcArcControlPointFromCenter(c,R);
    }
    else
    {
        selectedEdge->calcArcControlPointFromCenter(c);
    }
//    selectedEdge->getControlPoint(0,c);
    table->update();
    slotDataChanged();
}
Example #14
0
void SaveButtonHelper::monitor(QLineEdit * lineEdit)
{
    connect(lineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotDataChanged()));
}
Example #15
0
void OptionsDialog::setupConnections()
{
    connect(ui->pageSelectionWidget, SIGNAL(currentRowChanged(int)), this, SLOT(slotCurrentPageChanged(int)));

    QPushButton * applyButton = ui->buttonBox->button(QDialogButtonBox::Apply);
    connect(applyButton, SIGNAL(clicked()), this, SLOT(slotApplyChanges()));
    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    connect(ui->currencyComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotCurrencyChanged(QString)));
    connect(ui->currencyFormatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotDataChanged()));

    connect(ui->makeUnitDefaultButton, SIGNAL(clicked()), this, SLOT(slotMakeCurrentUnitDefault()));
    connect(ui->partUnitsTableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),this, SLOT(slotUnitSelectionChanged(QItemSelection,QItemSelection)));
    connect(ui->partUnitsTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotUnitDoubleClick(QModelIndex)));
    connect(_partUnitsModel,SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged()));    
    connect(ui->partUnitsTableView->itemDelegate(), SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this,SLOT(slotClosePartUnitEditor(QWidget*,QAbstractItemDelegate::EndEditHint)));

    connect(ui->addUnitButton, SIGNAL(clicked()), this, SLOT(slotAddUnit()));
    connect(ui->deleteUnitButton, SIGNAL(clicked()), this, SLOT(slotDeleteUnit()));

    connect(ui->paramUnitsTableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(slotParamUnitRowChanged(QModelIndex,QModelIndex)));
    connect(_parameterUnitsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged()));
    connect(ui->addParamUnitButton, SIGNAL(clicked()), this, SLOT(slotAddParamUnit()));
    connect(ui->deleteParamUnitButton, SIGNAL(clicked()), this, SLOT(slotDeleteParamUnit()));

    connect(ui->partConditionTableView->selectionModel(), SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)), this, SLOT(slotPartConditionRowChanged(QModelIndex,QModelIndex)));
    connect(_partConditionModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged()));
    connect(ui->addConditionButton, SIGNAL(clicked()), this, SLOT(slotAddPartCondition()));
    connect(ui->deleteConditionButton, SIGNAL(clicked()), this, SLOT(slotDeletePartCondition()));
    connect(ui->makeConditionDefaultButton, SIGNAL(clicked()), this, SLOT(slotMakeCurrentConditionDefault()));
Example #16
0
TagPropWidget::TagPropWidget(QWidget* const parent)
    : QWidget(parent), d(new Private())
{
    QGridLayout* const grid = new QGridLayout(this);
    QLabel* const logo      = new QLabel(this);

    logo->setPixmap(KIcon("tag-properties").pixmap(30,30));
    d->topLabel = new QLabel(this);
    d->topLabel->setText(i18n("Tag Properties"));
    d->topLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
    d->topLabel->setWordWrap(false);

    KSeparator* const line = new KSeparator(Qt::Horizontal, this);

    // --------------------------------------------------------

    QLabel* const titleLabel = new QLabel(this);
    titleLabel->setText(i18n("&Title:"));
    titleLabel->setMargin(KDialog::marginHint());
    titleLabel->setIndent(KDialog::spacingHint());

    d->titleEdit = new SearchTextBar(this, "TagEditDlgTitleEdit",
                                     i18n("Enter tag name here"));
    d->titleEdit->setCaseSensitive(false);
    titleLabel->setBuddy(d->titleEdit);

    QLabel* const tipLabel = new QLabel(this);
    tipLabel->setTextFormat(Qt::RichText);
    tipLabel->setWordWrap(true);
    tipLabel->setMargin(KDialog::marginHint());
    tipLabel->setIndent(KDialog::spacingHint());

    QLabel* const iconTextLabel = new QLabel(this);
    iconTextLabel->setText(i18n("&Icon:"));
    iconTextLabel->setMargin(KDialog::marginHint());
    iconTextLabel->setIndent(KDialog::spacingHint());

    d->iconButton         = new QPushButton(this);
    d->iconButton->setFixedSize(40, 40);
    iconTextLabel->setBuddy(d->iconButton);

    d->resetIconButton = new QPushButton(KIcon("view-refresh"), i18n("Reset"), this);

    QLabel* const kscTextLabel = new QLabel(this);
    kscTextLabel->setText(i18n("&Shortcut:"));
    kscTextLabel->setMargin(KDialog::marginHint());
    kscTextLabel->setIndent(KDialog::spacingHint());

    d->keySeqWidget      = new KKeySequenceWidget(this);
    kscTextLabel->setBuddy(d->keySeqWidget);
    d->keySeqWidget->setCheckActionCollections(TagsActionMngr::defaultManager()->actionCollections());

    QLabel* const tipLabel2 = new QLabel(this);
    tipLabel2->setTextFormat(Qt::RichText);
    tipLabel2->setWordWrap(true);
    tipLabel2->setText(i18n("<p><b>Note:</b> <i>This shortcut can be used "
                            "to assign or unassign tag to items.</i></p>"));
    tipLabel2->setMargin(KDialog::marginHint() );
    tipLabel2->setIndent(KDialog::spacingHint());

    d->saveButton = new QPushButton(i18n("Save"));
    d->discardButton = new QPushButton(i18n("Discard"));

    // --------------------------------------------------------

    grid->addWidget(logo,               0, 0, 1, 1);
    grid->addWidget(d->topLabel,        0, 1, 1, 4);
    grid->addWidget(line,               1, 0, 1, 4);
    grid->addWidget(tipLabel,           2, 0, 1, 4);
    grid->addWidget(titleLabel,         3, 0, 1, 1);
    grid->addWidget(d->titleEdit,       3, 1, 1, 3);
    grid->addWidget(iconTextLabel,      4, 0, 1, 1);
    grid->addWidget(d->iconButton,      4, 1, 1, 1);
    grid->addWidget(d->resetIconButton, 4, 2, 1, 1);
    grid->addWidget(kscTextLabel,       5, 0, 1, 1);
    grid->addWidget(d->keySeqWidget,    5, 1, 1, 3);
    grid->addWidget(tipLabel2,          6, 0, 1, 4);
    grid->addWidget(d->saveButton,      7, 0, 1, 1);
    grid->addWidget(d->discardButton,   7, 1, 1, 1);
    grid->setRowStretch(8, 10);
    grid->setColumnStretch(3, 10);
    grid->setMargin(KDialog::marginHint());
    grid->setVerticalSpacing(KDialog::spacingHint());

    adjustSize();

    connect(d->iconButton, SIGNAL(clicked()),
            this, SLOT(slotIconChanged()));

    connect(d->titleEdit, SIGNAL(textEdited(QString)),
            this, SLOT(slotDataChanged()));

    connect(d->resetIconButton, SIGNAL(clicked()),
            this,SLOT(slotIconResetClicked()));

    connect(d->keySeqWidget, SIGNAL(keySequenceChanged(QKeySequence)),
            this, SLOT(slotDataChanged()));

    connect(d->saveButton, SIGNAL(clicked()),
            this, SLOT(slotSaveChanges()));

    connect(d->discardButton, SIGNAL(clicked()),
            this, SLOT(slotDiscardChanges()));

    enableItems(TagPropWidget::DisabledAll);
}
Example #17
0
TrashView::TrashView(QWidget* parent)
    : QWidget(parent), d(new Private)
{
    // Layouts
    d->mainLayout = new QVBoxLayout(this);
    d->btnsLayout = new QHBoxLayout();

    // View and plugins
    d->tableView     = new QTableView(this);
    d->model         = new DTrashItemModel(this);
    d->thumbDelegate = new ThumbnailAligningDelegate(this);

    // Table view settings
    d->tableView->setModel(d->model);
    d->tableView->setItemDelegateForColumn(0, d->thumbDelegate);
    d->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    d->tableView->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
    d->tableView->verticalHeader()->setDefaultSectionSize(d->thumbSize.size());
    d->tableView->verticalHeader()->hide();
    d->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    d->tableView->setShowGrid(false);
    d->tableView->setSortingEnabled(true);
    d->tableView->sortByColumn(2, Qt::DescendingOrder);

    // Action Buttons
    d->restoreButton   = new QPushButton(i18n("Restore"));
    d->deleteButton    = new QPushButton(i18n("Delete Permanently"));
    d->deleteAllButton = new QPushButton(i18n("Delete All Permanently"));

    d->restoreButton->setEnabled(false);
    d->deleteButton->setEnabled(false);
    d->deleteAllButton->setEnabled(false);

    // Adding widgets to layouts
    d->mainLayout->addWidget(d->tableView);

    d->btnsLayout->addWidget(d->restoreButton);
    d->btnsLayout->addWidget(d->deleteButton);
    d->btnsLayout->addWidget(d->deleteAllButton);

    d->mainLayout->addLayout(d->btnsLayout);

    // Signals and Slots connections
    connect(d->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
            this, SLOT(slotSelectionChanged()));

    connect(d->restoreButton, SIGNAL(released()),
            this, SLOT(slotRestoreSelectedItems()));

    connect(d->deleteButton, SIGNAL(released()),
            this, SLOT(slotDeleteSelectedItems()));

    connect(d->deleteAllButton, SIGNAL(released()),
            this, SLOT(slotDeleteAllItems()));

    connect(d->model, SIGNAL(dataChange()),
            this, SLOT(slotDataChanged()));

    connect(d->tableView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
            this, SLOT(slotChangeLastSelectedItem(QModelIndex,QModelIndex)));
}
void KConcatenateRowsProxyModel::addSourceModel(QAbstractItemModel *sourceModel)
{
    Q_ASSERT(sourceModel);
    Q_ASSERT(!d->m_models.contains(sourceModel));
    connect(sourceModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)), this, SLOT(slotDataChanged(QModelIndex,QModelIndex,QVector<int>)));
    connect(sourceModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(slotRowsInserted(QModelIndex,int,int)));
    connect(sourceModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(slotRowsRemoved(QModelIndex,int,int)));
    connect(sourceModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), this, SLOT(slotRowsAboutToBeInserted(QModelIndex,int,int)));
    connect(sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int)));

    connect(sourceModel, SIGNAL(columnsInserted(QModelIndex,int,int)), this, SLOT(slotColumnsInserted(QModelIndex,int,int)));
    connect(sourceModel, SIGNAL(columnsRemoved(QModelIndex,int,int)), this, SLOT(slotColumnsRemoved(QModelIndex,int,int)));
    connect(sourceModel, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), this, SLOT(slotColumnsAboutToBeInserted(QModelIndex,int,int)));
    connect(sourceModel, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), this, SLOT(slotColumnsAboutToBeRemoved(QModelIndex,int,int)));

    connect(sourceModel, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>, QAbstractItemModel::LayoutChangeHint)),
            this, SLOT(slotSourceLayoutAboutToBeChanged(QList<QPersistentModelIndex>, QAbstractItemModel::LayoutChangeHint)));
    connect(sourceModel, SIGNAL(layoutChanged(QList<QPersistentModelIndex>, QAbstractItemModel::LayoutChangeHint)),
            this, SLOT(slotSourceLayoutChanged(QList<QPersistentModelIndex>, QAbstractItemModel::LayoutChangeHint)));
    connect(sourceModel, SIGNAL(modelAboutToBeReset()), this, SLOT(slotModelAboutToBeReset()));
    connect(sourceModel, SIGNAL(modelReset()), this, SLOT(slotModelReset()));

    const int newRows = sourceModel->rowCount();
    if (newRows > 0) {
        beginInsertRows(QModelIndex(), d->m_rowCount, d->m_rowCount + newRows - 1);
    }
    d->m_rowCount += newRows;
    d->m_models.append(sourceModel);
    if (newRows > 0) {
        endInsertRows();
    }
}