本文整理汇总了C++中currentRow函数的典型用法代码示例。如果您正苦于以下问题:C++ currentRow函数的具体用法?C++ currentRow怎么用?C++ currentRow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了currentRow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: file
void MusicSongsListWidget::musicFileInformation()
{
if(rowCount() == 0 || currentRow() < 0 )
{
return;
}
MusicFileInformationWidget file(this);
QString path = !m_musicSongs->isEmpty() ? m_musicSongs->at(currentRow()).getMusicPath() : QString();
file.setFileInformation(path);
file.exec();
}
示例2: currentRow
void QListWidgetWithDrop::dropEvent(QDropEvent *e)
{
int fromRow = currentRow();
QListWidget::dropEvent(e);
int toRow = currentRow();
for (int i = 0; i < count(); i++){
FilterButton *fb = (FilterButton*) itemWidget(this->item(i));
fb->setName(QString::number(i+1));
}
emit listItemMoved(fromRow, toRow);
}
示例3: QString
void MusicSongsListWidget::musicOpenFileDir()
{
if(rowCount() == 0 || currentRow() < 0)
{
return;
}
QString path = !m_musicSongs->isEmpty() ?m_musicSongs->at(currentRow()).getMusicPath() : QString();
if(!QDesktopServices::openUrl(QUrl(QFileInfo(path).absolutePath(), QUrl::TolerantMode)))
{
MusicMessageBox message;
message.setText(tr("The origin one does not exsit!"));
message.exec();
}
}
示例4: musicOpenFileDir
void MusicMyDownloadRecordWidget::musicOpenFileDir()
{
if(rowCount() == 0 || currentRow() < 0)
{
return;
}
if(!QDesktopServices::openUrl(QUrl(QFileInfo(m_musicRecord.m_paths[currentRow()]).absolutePath(),
QUrl::TolerantMode)))
{
MusicMessageBox message;
message.setText(tr("The origin one does not exsit!"));
message.exec();
}
}
示例5: currentRow
void MusicQueryTableWidget::createContextMenu(QMenu &menu)
{
menu.setStyleSheet(MusicUIObject::MMenuStyle02);
m_actionGroup->addAction(menu.addAction(tr("musicDownload")));
menu.addSeparator();
QString songName = currentRow() != -1 && rowCount() > 0 ?
item(currentRow(), 1)->text() : QString();
QString artistName = currentRow() != -1 && rowCount() > 0 ?
item(currentRow(), 2)->text() : QString();
m_actionGroup->addAction(menu.addAction(tr("search '%1'").arg(songName)));
m_actionGroup->addAction(menu.addAction(tr("search '%1'").arg(artistName)));
m_actionGroup->addAction(menu.addAction(tr("search '%1 - %2'").arg(songName).arg(artistName)));
}
示例6: recalculate
void UISpreadsheet::somethingChanged()
{
/*
if (autoRecalc)
recalculate();
*/
// emit modified();
UICell *c = cell(currentRow(),currentColumn());
c->setCell(spreadSheet->getCell(currentRow(),currentColumn()));
c->setWidget(this);
c->update();
cout<<"something changeeeeeeeeeeeeeeeeeeeeeeeeeeee"<<endl;
// this->setCurrentCell(currentRow()+1,currentColumn());
}
示例7: closePersistentEditor
void MusicSongsListWidget::mousePressEvent(QMouseEvent *event)
{
QTableWidget::mousePressEvent(event);
//just close the rename edittext;
if(m_renameActived)
{
closePersistentEditor(m_renameItem);
}
//it may be a bug in closePersistentEditor,so we select
//the two if function to deal with
if(m_renameActived)
{
(*m_musicSongs)[m_renameItem->row()].setMusicName(m_renameItem->text());
m_renameItem->setText(QFontMetrics(font()).elidedText(
m_renameItem->text(), Qt::ElideRight, 243));
m_renameActived = false;
}
if( event->button() == Qt::LeftButton )//Press the left key
{
m_leftButtonPressed = true;
m_dragStartIndex = currentRow();
m_dragStartPoint = event->pos();
}
}
示例8: rectBu
bool ButtonDelegate::editorEvent(QEvent *event, QAbstractItemModel *, const QStyleOptionViewItem &option, const QModelIndex &index)
{
QRect rect = option.rect;
QRect rectBu(rect.left() + rect.width()/2 - 15,
rect.top() + rect.height()/2 - 5,
30, 15);
if (event->type() == QEvent::MouseMove) {
QMouseEvent* e =(QMouseEvent*)event;
if (rectBu.contains(e->x(), e->y())) {
}
}
if (event->type() == QEvent::MouseButtonRelease) {
QMouseEvent* e =(QMouseEvent*)event;
if (rectBu.contains(e->x(), e->y())) {
int row = index.row();
emit currentRow(row);
return true;
}
}
return false;
}
示例9:
void favorites2::toggleAutoMount()
{
auto table = m_ui->tableWidget ;
if( table->rowCount() > 0 ){
auto row = table->currentRow() ;
auto e = this->getEntry( row ) ;
if( !e.volumePath.isEmpty() ){
auto f = e ;
if( f.autoMountVolume == "true" ){
f.autoMountVolume = "false" ;
}else{
f.autoMountVolume = "true" ;
}
m_ui->textEditAutoMount->setText( f.autoMountVolume ) ;
m_settings.replaceFavorite( e,f ) ;
}
}
}
示例10: currentPlaylistWidget
void PlaylistWindow::selectNext()
{
auto qdp = currentPlaylistWidget();
int index = qdp->currentRow();
if (index < qdp->count())
qdp->setCurrentRow(index + 1);
}
示例11: item
void UTableNotes::clickActionHide()
{
QTableWidgetItem *curItem = item(currentRow(), indexColumnVisible);
curItem->setData(pointerOnDataColumnVisible, false);
curItem->setIcon(QIcon(IconHide));
emit clickActionHideItem();
}
示例12: currentRow
bool
wDBTable::searchColumn( const QString & text, bool FromCurrent, bool Forward )
{
QString s;
uint curr = currentRow(), curc=currentColumn(), row = 0, idx;
bool found = FALSE;
aSQLTable *t = ( aSQLTable *) sqlCursor();
if ( FromCurrent ) row = curr;
if ( Forward ) row++; else row--;
idx = indexOf( curc );
while ( t->seek( row ) ){
s = t->value( idx ).toString();
if ( s.left( text.length() ) == text ) {
found = TRUE;
break;
}
if ( Forward ) row++; else row--;
}
if ( found ) {
setCurrentCell( row, curc );
};
return found;
}
示例13: delete
void ContactListWidget::del_contact()
{
QMessageBox mbx;
mbx.setText(QString(tr("Are you sure you want to remove user \"%1\" from your contact list?")).arg(currentItem()->text()));
mbx.setIcon(QMessageBox::Question);
mbx.addButton(QMessageBox::Yes);
mbx.addButton(QMessageBox::No);
mbx.setDefaultButton(QMessageBox::No);
if (QMessageBox::Yes==mbx.exec())
{
QByteArray rm_id;
QListWidgetItem *rm_ptr;
storage->Delete(rm_id = wgitem_to_recs[currentItem()]->id);
delete (rm_ptr=takeItem(currentRow()));
for(int i=0;i<contact_records.size();i++)
{
if (contact_records[i].id==rm_id)
{
contact_records.removeAt(i);
break;
}
}
wgitem_to_recs.remove(rm_ptr);
}
}
示例14: slotMount
void MainWindow::slotMount()
{
auto table = m_ui->tableWidget ;
int row = table->currentRow() ;
this->mount( volumeEntryProperties( tablewidget::tableRowEntries( table,row ) ) ) ;
}
示例15: currentColumn
void MTable::stopEditing()
{
int cCol = currentColumn();
int cRow = currentRow();
endEdit( cRow, cCol, TRUE, TRUE );
}