本文整理汇总了C++中slotSelectionChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ slotSelectionChanged函数的具体用法?C++ slotSelectionChanged怎么用?C++ slotSelectionChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了slotSelectionChanged函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotSelectionChanged
void KXmlCommandAdvancedDlg::slotMoveDown()
{
TQListViewItem *item = m_view->currentItem(), *next = 0;
if (item && (next=findNext(item)))
{
item->moveItem(next);
m_view->setSelected(item, true);
slotSelectionChanged(item);
}
}
示例2: OptionBaseView
OptionListView::OptionListView(TQWidget *parent, const char *name)
: OptionBaseView(parent,name)
{
m_list = new TDEListBox(this);
TQVBoxLayout *main_ = new TQVBoxLayout(this, 0, 10);
main_->addWidget(m_list);
connect(m_list,TQT_SIGNAL(selectionChanged()),TQT_SLOT(slotSelectionChanged()));
}
示例3: QSplitter
void FixtureManager::initDataView()
{
// Create a splitter to divide list view and text view
m_splitter = new QSplitter(Qt::Horizontal, this);
layout()->addWidget(m_splitter);
m_splitter->setSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Expanding);
/* Create a tree widget to the left part of the splitter */
m_tree = new QTreeWidget(this);
m_splitter->addWidget(m_tree);
QStringList labels;
labels << "Universe" << "Address" << "Name";
m_tree->setHeaderLabels(labels);
m_tree->setRootIsDecorated(false);
m_tree->setSortingEnabled(true);
m_tree->setAllColumnsShowFocus(true);
m_tree->sortByColumn(KColumnAddress, Qt::AscendingOrder);
m_tree->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_tree, SIGNAL(itemSelectionChanged()),
this, SLOT(slotSelectionChanged()));
connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
this, SLOT(slotDoubleClicked(QTreeWidgetItem*)));
connect(m_tree, SIGNAL(customContextMenuRequested(const QPoint&)),
this, SLOT(slotContextMenuRequested(const QPoint&)));
/* Create a tab widget to the right part of the splitter */
m_tab = new QTabWidget(this);
m_splitter->addWidget(m_tab);
/* Create the text view */
m_info = new QTextBrowser(this);
m_tab->addTab(m_info, tr("Information"));
m_splitter->setStretchFactor(0, 1);
m_splitter->setStretchFactor(1, 0);
slotSelectionChanged();
}
示例4: m_proxyModel
MetaListViewPart::MetaListViewPart(QObject *parent)
: KParts::Part(parent), m_proxyModel(NULL), m_defaultRow(-1)
{
m_widget = new MetaListViewWidget;
setWidget(m_widget);
connect(m_widget, SIGNAL(itemActivated(QModelIndex)),
SLOT(slotItemActivated(QModelIndex)) );
connect(m_widget, SIGNAL(selectionChanged(QItemSelection)),
SLOT(slotSelectionChanged(QItemSelection)) );
connect(m_widget, SIGNAL(contextMenuRequested(QModelIndex)),
SLOT(slotContextMenuRequested(QModelIndex)) );
// Show initial information on the metaBar
slotSelectionChanged(QItemSelection());
//populate the listView (later, in order to respect the size of the listView)
QMetaObject::invokeMethod(this, "loadModel", Qt::QueuedConnection);
/* ACTIONS */
KSelectAction *view_mode = new KSelectAction(i18n("View mode"), this);
connect(view_mode, SIGNAL(triggered(int)), SLOT(changeViewMode(int)) );
actionCollection()->addAction("view_mode", view_mode);
actionCollection()->addAction("view_mode_list",
view_mode->addAction(KIcon("view-list-details"), i18n("List")) );
actionCollection()->addAction("view_mode_icons",
view_mode->addAction(KIcon("view-list-icons"), i18n("Icons")) );
KSelectAction *metabar_position = new KSelectAction(i18n("Metabar position"), this);
connect(metabar_position, SIGNAL(triggered(int)), SLOT(changeMetaBarPosition(int)) );
actionCollection()->addAction("metabar_position", metabar_position);
QString str_left = i18nc("Opposite of right", "Left");
QString str_right = i18nc("Opposite of left", "Right");
if ( QApplication::isLeftToRight() ) {
actionCollection()->addAction("metabar_position_left", metabar_position->addAction(str_left));
actionCollection()->addAction("metabar_position_right", metabar_position->addAction(str_right));
} else {
actionCollection()->addAction("metabar_position_right", metabar_position->addAction(str_right));
actionCollection()->addAction("metabar_position_left", metabar_position->addAction(str_left));
}
actionCollection()->addAction("metabar_position_hidden", metabar_position->addAction(i18n("Hidden")) );
}
示例5: QDialog
IconSizeDialog::IconSizeDialog(const QString &caption, const QString &message, const QString &icon, int iconSize, QWidget *parent)
: QDialog(parent)
{
// QDialog options
setWindowTitle(caption);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
setModal(true);
QWidget *page = new QWidget(this);
QVBoxLayout *topLayout = new QVBoxLayout(page);
QLabel *label = new QLabel(message, page);
topLayout->addWidget(label);
QListWidget *iconView = new UndraggableKIconView(page);
m_size16 = new QListWidgetItem(DesktopIcon(icon, 16), i18n("16 by 16 pixels"), iconView);
m_size22 = new QListWidgetItem(DesktopIcon(icon, 22), i18n("22 by 22 pixels"), iconView);
m_size32 = new QListWidgetItem(DesktopIcon(icon, 32), i18n("32 by 32 pixels"), iconView);
m_size48 = new QListWidgetItem(DesktopIcon(icon, 48), i18n("48 by 48 pixels"), iconView);
m_size64 = new QListWidgetItem(DesktopIcon(icon, 64), i18n("64 by 64 pixels"), iconView);
m_size128 = new QListWidgetItem(DesktopIcon(icon, 128), i18n("128 by 128 pixels"), iconView);
iconView->setIconSize(QSize(128, 128));
iconView->setMinimumSize(QSize(128*6 + (6 + 2) * iconView->spacing() + 20, m_size128->sizeHint().height() + 2 * iconView->spacing() + 20));
topLayout->addWidget(iconView);
switch (iconSize) {
case 16: m_size16->setSelected(true); m_iconSize = 16; break;
case 22: m_size22->setSelected(true); m_iconSize = 22; break;
default:
case 32: m_size32->setSelected(true); m_iconSize = 32; break;
case 48: m_size48->setSelected(true); m_iconSize = 48; break;
case 64: m_size64->setSelected(true); m_iconSize = 64; break;
case 128: m_size128->setSelected(true); m_iconSize = 128; break;
}
connect(iconView, SIGNAL(executed(QListWidgetItem*)), this, SLOT(choose(QListWidgetItem*)));
connect(iconView, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(choose(QListWidgetItem*)));
connect(iconView, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged()));
mainLayout->addWidget(page);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this);
okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
mainLayout->addWidget(buttonBox);
connect(buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), SLOT(slotCancel()));
}
示例6: TaskWPGanttView
TaskWPGanttView *View::createGanttView()
{
TaskWPGanttView *v = new TaskWPGanttView( part(), this );
connect( v, SIGNAL(requestPopupMenu(QString,QPoint)), this, SLOT(slotPopupMenu(QString,QPoint)) );
connect( v, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) );
v->updateReadWrite( m_readWrite );
v->loadContext();
return v;
}
示例7: TaskWorkPackageView
TaskWorkPackageView *View::createTaskWorkPackageView()
{
TaskWorkPackageView *v = new TaskWorkPackageView( part(), this );
connect( v, SIGNAL( requestPopupMenu( const QString&, const QPoint & ) ), this, SLOT( slotPopupMenu( const QString&, const QPoint& ) ) );
connect( v, SIGNAL( selectionChanged() ), SLOT( slotSelectionChanged() ) );
v->updateReadWrite( m_readWrite );
v->loadContext();
return v;
}
示例8: QWidget
CTrackToolWidget::CTrackToolWidget(QTabWidget * parent)
: QWidget(parent)
, originator(false)
{
setupUi(this);
setObjectName("Tracks");
parent->addTab(this,QIcon(":/icons/iconTrack16x16.png"),"");
parent->setTabToolTip(parent->indexOf(this), tr("Tracks"));
connect(&CTrackDB::self(), SIGNAL(sigModified(const QString&)), this, SLOT(slotDBChanged()));
connect(&CTrackDB::self(), SIGNAL(sigNeedUpdate(const QString&)), this, SLOT(slotDBChanged()));
connect(&CTrackDB::self(), SIGNAL(sigChanged()), this, SLOT(slotDBChanged()));
connect(listTracks,SIGNAL(itemClicked(QListWidgetItem*) ),this,SLOT(slotItemClicked(QListWidgetItem*)));
connect(listTracks,SIGNAL(itemDoubleClicked(QListWidgetItem*) ),this,SLOT(slotItemDoubleClicked(QListWidgetItem*)));
connect(listTracks,SIGNAL(itemSelectionChanged()),this,SLOT(slotSelectionChanged()));
contextMenu = new QMenu(this);
actEdit = contextMenu->addAction(QPixmap(":/icons/iconEdit16x16.png"),tr("Edit..."),this,SLOT(slotEdit()));
actRevert = contextMenu->addAction(QPixmap(":/icons/iconReload16x16.png"),tr("Revert"),this,SLOT(slotRevert()));
contextMenu->addSeparator();
actDistance = contextMenu->addAction(QPixmap(":/icons/iconDistance16x16.png"),tr("Make Overlay"),this,SLOT(slotToOverlay()));
contextMenu->addSeparator();
actHide = contextMenu->addAction(tr("Show"),this,SLOT(slotShow()));
actShowBullets = contextMenu->addAction(tr("Show Bullets"),this,SLOT(slotShowBullets()));
actShowMinMax = contextMenu->addAction(tr("Show Min/Max"),this,SLOT(slotShowMinMax()));
contextMenu->addSeparator();
actZoomToFit = contextMenu->addAction(QPixmap(":/icons/iconZoomArea16x16.png"),tr("Zoom to fit"),this,SLOT(slotZoomToFit()));
actDel = contextMenu->addAction(QPixmap(":/icons/iconClear16x16.png"),tr("Delete"),this,SLOT(slotDelete()));
actHide->setCheckable(true);
actShowBullets->setCheckable(true);
actShowBullets->setChecked(CTrackDB::self().getShowBullets());
actShowMinMax->setCheckable(true);
actShowMinMax->setChecked(CTrackDB::self().getShowMinMax());
connect(listTracks,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(slotContextMenu(const QPoint&)));
QFontMetrics fm(listTracks->font());
listTracks->setIconSize(QSize(15,N_LINES*fm.height()));
connect(toolSortAlpha, SIGNAL(clicked()), this, SLOT(slotDBChanged()));
connect(toolSortTime, SIGNAL(clicked()), this, SLOT(slotDBChanged()));
toolSortAlpha->setIcon(QPixmap(":/icons/iconDec16x16.png"));
toolSortTime->setIcon(QPixmap(":/icons/iconTime16x16.png"));
SETTINGS;
toolSortAlpha->setChecked(cfg.value("track/sortAlpha", true).toBool());
toolSortTime->setChecked(cfg.value("track/sortTime", true).toBool());
listTracks->installEventFilter(this);
}
示例9: QTreeWidget
ServersList::ServersList(Servers *_servers, QWidget * parent )
: QTreeWidget(parent), servers(_servers)
{
serversDbName="servers";
dbEnv=0;
serverDb=0;
connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged()));
serverSpeedTimer = new QTimer();
connect(serverSpeedTimer, SIGNAL(timeout()), this, SLOT(slotServerSpeedTimeout()));
qDebug() << "In ServersList::ServersList 2";
}
示例10: View
K3b::MovixView::MovixView( K3b::MovixDoc* doc, QWidget* parent )
:
View( doc, parent ),
m_doc( doc ),
m_model( new MovixProjectModel( m_doc, this ) ),
m_view( new QTreeView( this ) )
{
m_view->setModel( m_model );
m_view->setAcceptDrops( true );
m_view->setDragEnabled( true );
m_view->setDragDropMode( QTreeView::DragDrop );
m_view->setItemsExpandable( false );
m_view->setRootIsDecorated( false );
m_view->setSelectionMode( QTreeView::ExtendedSelection );
m_view->setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );
m_view->setContextMenuPolicy( Qt::ActionsContextMenu );
// FIXME: make QHeaderView::Interactive the default but connect to model changes and call header()->resizeSections( QHeaderView::ResizeToContents );
m_view->header()->setResizeMode( QHeaderView::ResizeToContents );
m_view->setEditTriggers( QAbstractItemView::NoEditTriggers );
setMainWidget( m_view );
// setup actions
m_actionProperties = K3b::createAction( this, i18n("Properties"), "document-properties",
0, this, SLOT(showPropertiesDialog()),
actionCollection(), "movix_show_props" );
m_actionRemove = K3b::createAction( this, i18n( "Remove" ), "edit-delete",
Qt::Key_Delete, this, SLOT(slotRemove()),
actionCollection(), "movix_remove_item" );
m_actionRemoveSubTitle = K3b::createAction( this, i18n( "Remove Subtitle File" ), "edit-delete",
0, this, SLOT(slotRemoveSubTitleItems()),
actionCollection(), "movix_remove_subtitle_item" );
m_actionAddSubTitle = K3b::createAction( this, i18n("Add Subtitle File..."), 0,
0, this, SLOT(slotAddSubTitleFile()),
actionCollection(), "movix_add_subtitle" );
connect( m_view->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(slotSelectionChanged()) );
QAction* separator = new QAction( this );
separator->setSeparator( true );
m_view->addAction( m_actionRemove );
m_view->addAction( m_actionRemoveSubTitle );
m_view->addAction( m_actionAddSubTitle );
m_view->addAction( separator );
m_view->addAction( m_actionProperties );
m_view->addAction( separator );
m_view->addAction( actionCollection()->action("project_burn") );
// Setup toolbar
toolBox()->addActions( createPluginsActions( m_doc->type() ) );
toolBox()->addWidget( new VolumeNameWidget( doc, toolBox() ) );
}
示例11: QWidget
WBSDefinitionPanel::WBSDefinitionPanel( Project &project, WBSDefinition &def, QWidget *p, const char *n)
: QWidget(p),
m_project( project ),
m_def(def),
selectedRow(-1)
{
setObjectName(n);
setupUi(this);
projectCode->setText( m_def.projectCode() );
projectSeparator->setText( m_def.projectSeparator() );
QStringList codeList = m_def.codeList();
kDebug()<<codeList;
defaultSeparator->setText(m_def.defaultSeparator());
defaultCode->addItems(codeList);
defaultCode->setCurrentIndex(m_def.defaultCodeIndex());
defaultCode->setFocus();
levelsTable->setItemDelegateForColumn(0, new ComboBoxDelegate(codeList, this));
levelsGroup->setChecked(m_def.isLevelsDefEnabled());
int i = 0;
const QMap<int, WBSDefinition::CodeDef> &lev = m_def.levelsDef();
levelsTable->setRowCount(lev.count());
QStringList sl;
kDebug()<<"Map size="<<lev.count();
QMap<int, WBSDefinition::CodeDef>::const_iterator it;
for (it = lev.begin(); it != lev.end(); ++it) {
sl << QString("%1").arg(it.key());
QTableWidgetItem *item = new QTableWidgetItem();
item->setData(Qt::DisplayRole, it.value().code);
levelsTable->setItem(i, 0, item);
item = new QTableWidgetItem();
item->setText(it.value().separator);
levelsTable->setItem(i, 1, item);
i++;
}
levelsTable->setVerticalHeaderLabels(sl);
//levelsTable->setColumnStretchable(0, true);
slotLevelChanged(level->value());
connect(projectCode, SIGNAL(textChanged(const QString&)), SLOT(slotChanged()));
connect(projectSeparator, SIGNAL(textChanged(const QString&)), SLOT(slotChanged()));
connect(defaultCode, SIGNAL(activated(int)), SLOT(slotChanged()));
connect(defaultSeparator, SIGNAL(textChanged(const QString&)), SLOT(slotChanged()));
connect(levelsGroup, SIGNAL(toggled(bool)), SLOT(slotLevelsGroupToggled(bool)));
connect(levelsTable, SIGNAL(cellChanged(int, int)), SLOT(slotChanged()));
connect(levelsTable, SIGNAL(itemSelectionChanged()), SLOT(slotSelectionChanged()));
connect(level, SIGNAL(valueChanged(int)), SLOT(slotLevelChanged(int)));
connect(removeBtn, SIGNAL(clicked(bool)), SLOT(slotRemoveBtnClicked()));
connect(addBtn, SIGNAL(clicked(bool)), SLOT(slotAddBtnClicked()));
removeBtn->setEnabled(false);
}
示例12: QWidget
CategoriesWidget::CategoriesWidget(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
m_buttonAddCategory->setIcon(KIcon(QLatin1String("list-add")));
m_buttonRemoveCategory->setIcon(KIcon(QLatin1String("list-remove")));
m_buttonEditCategory->setIcon(KIcon(QLatin1String("configure")));
connect(m_buttonAddCategory, SIGNAL(clicked()), this, SLOT(slotAddCategory()));
connect(m_buttonRemoveCategory, SIGNAL(clicked()), this, SLOT(slotRemoveCategory()));
connect(m_buttonEditCategory, SIGNAL(clicked()), this, SLOT(slotEditCategory()));
m_categoriesModel = new CategoriesModel(this);
m_viewCategories->setModel(m_categoriesModel);
connect(m_viewCategories->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(slotSelectionChanged(QItemSelection,QItemSelection)));
connect(m_viewCategories, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(slotEditCategory()));
slotSelectionChanged(QItemSelection(), QItemSelection());
}
示例13: d
KipiUploadWidget::KipiUploadWidget(KipiInterface* const iface, QWidget* const parent)
: KIPI::UploadWidget(parent),
d(new Private)
{
d->iface = iface;
QVBoxLayout* const vlay = new QVBoxLayout(this);
d->albumSel = new AlbumSelectWidget(this);
vlay->addWidget(d->albumSel);
vlay->setContentsMargins(QMargins());
vlay->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
connect(d->albumSel, SIGNAL(itemSelectionChanged()),
this, SLOT(slotSelectionChanged()));
}
示例14: signalSave
void ViewDepartments::slotCancel()
{
if (m_model->cancel())
{
m_editMode = false;
emit signalSave(-1, false);
}
else
QMessageBox::critical(this, "", "Не удалось отменить изменения", QMessageBox::Ok);
auto index = ui->tableView->selectionModel()->currentIndex();
ui->tableView->reset();
ui->tableView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::Select |
QItemSelectionModel::Rows);
slotSelectionChanged(QItemSelection(), QItemSelection());
}
示例15: slotSelectionChanged
void AddFixture::slotModeActivated(const QString& modeName)
{
QLCFixtureMode* mode = NULL;
if (m_fixtureDef == NULL)
return;
m_mode = m_fixtureDef->mode(modeName);
if (m_mode == NULL)
{
slotSelectionChanged(NULL);
return;
}
m_channelsSpin->setValue(m_mode->channels());
}