GuiClipboard::GuiClipboard() { connect(qApp->clipboard(), SIGNAL(dataChanged()), this, SLOT(on_dataChanged())); // initialize clipboard status. on_dataChanged(); }
void HexFilesMenager::on_addPage(QByteArray arr,QString text) { HexEditorWidget * w = new HexEditorWidget(dynamic_cast<QWidget*> (this->parent())); connect(w,SIGNAL(dataChanged()),this,SLOT(on_dataChanged())); w->setLineText(infoline); w->setData(arr); QStringList tnames; QString tline=text; for(int i=0; i<tw->count(); i++) tnames.append(tw->tabText(i)); int cn =1; while(tnames.contains(tline) || tnames.contains(tline+"*")) { tline = text + "-" + QString("%1").arg(cn); cn++; } tw->addTab(w,tline); w->on_dataChanged(); tw->setCurrentIndex(tw->count()-1); on_dataChanged(); }
GuiSelection::GuiSelection() : schedule_check_(true), selection_supported_(qApp->clipboard()->supportsSelection()) { connect(qApp->clipboard(), SIGNAL(selectionChanged()), this, SLOT(on_dataChanged())); }
MessageViewItem::MessageViewItem(MessageItem *data, QWidget *parent) : itemData(data), QWidget(parent), ui(new Ui::MessageViewItem) { setVisible(false); ui->setupUi(this); // set black background QPalette Pal(palette()); //Pal.setColor(QPalette::Background, palette().color(QPalette::AlternateBase)); setAutoFillBackground(true); setPalette(Pal); MessageEventFilter * filter = new MessageEventFilter(parent); installEventFilter(filter); ui->textEdit->setText(data->getText()); ui->textEdit->setReadOnly(true); backgroundColor = palette().color(QPalette::Background); setContextMenuPolicy(Qt::CustomContextMenu); connect(this,SIGNAL(customContextMenuRequested(QPoint)),parent,SLOT(on_customContextMenuRequested(QPoint))); connect(ui->textEdit,SIGNAL(focusOut()), parent, SLOT(on_dataChanged())); ui->listView->setModel(itemData->getVideoModel()); if(!itemData->getVideoModel()->rowCount() > 0) ui->listView->hide(); }
qMirrorModel::qMirrorModel(const QAbstractItemModel *src_mdl, QObject *parent): srcModel(src_mdl), QStandardItemModel(parent) { recreate(); if(src_mdl) { connect(src_mdl, SIGNAL(columnsInserted(QModelIndex,int,int)), this, SLOT(on_columnsInserted(QModelIndex,int,int))); connect(src_mdl, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(on_columnsMoved(QModelIndex,int,int,QModelIndex,int))); connect(src_mdl, SIGNAL(columnsRemoved(QModelIndex,int,int)), this, SLOT(on_columnsRemoved(QModelIndex,int,int))); connect(src_mdl, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_dataChanged(QModelIndex,QModelIndex))); connect(src_mdl, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)), this, SLOT(on_dataChanged(QModelIndex,QModelIndex,QVector<int>))); connect(src_mdl, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), this, SLOT(on_headerDataChanged(Qt::Orientation,int,int))); connect(src_mdl, SIGNAL(modelReset()), this, SLOT(on_modelReset())); connect(src_mdl, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(on_rowsInserted(QModelIndex,int,int))); connect(src_mdl, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(on_rowsMoved(QModelIndex,int,int,QModelIndex,int))); connect(src_mdl, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(on_rowsRemoved(QModelIndex,int,int))); } }