void KFileInfoContents::addItemList(const KFileInfoList *list) { setAutoUpdate(false); bool repaint_needed = false; KFileInfoListIterator it(*list); for (; it.current(); ++it) { debugC("insert %s", it.current()->fileName()); repaint_needed |= addItem(it.current()); } setAutoUpdate(true); if (repaint_needed) repaint(true); }
Nepomuk::TagCloud::TagCloud( QWidget* parent ) : KTagCloudWidget( parent ), d( new Private() ) { updateTags(); setAutoUpdate( true ); }
void Ableton::setup(string abletonOscHost) { this->abletonOscHost = abletonOscHost; sender.setup(abletonOscHost, ABLETON_OSC_PORT_OUT); receiver.setup(ABLETON_OSC_PORT_IN); setConnected(true); setAutoUpdate(true); setAutoDraw(true); control.addToggle("Connected", &connected, this, &Ableton::eventSetConnected); // unusued control.addButton("Refresh", this, &Ableton::eventRefresh); GuiWidget *widgetGlobal = control.addWidget("Global"); widgetGlobal->addSlider("Tempo", &tempo, 4.0f, 999.0f, this, &Ableton::eventSetTempo); widgetGlobal->addSlider("Time", &time, 4.0f, 999.0f, this, &Ableton::eventSetTime); widgetGlobal->addSlider("Volume", &volume, 0.0f, 1.0f, this, &Ableton::eventSetVolume); widgetGlobal->addSlider("Pan", &pan, -1.0f, 1.0f, this, &Ableton::eventSetPan); widgetGlobal->addToggle("Overdub", &overdub, this, &Ableton::eventSetOverdub); GuiWidget *widgetPlayback = control.addWidget("Playback"); widgetPlayback->addButton("Prev cue", this, &Ableton::eventPrevCue); widgetPlayback->addButton("Next cue", this, &Ableton::eventNextCue); widgetPlayback->addButton("Play", this, &Ableton::eventPlay); widgetPlayback->addButton("Continue", this, &Ableton::eventPlayContinue); widgetPlayback->addButton("Play selection", this, &Ableton::eventPlaySelection); widgetPlayback->addButton("Stop", this, &Ableton::eventStop); scanLiveSet(); // REFRESH OPTION! // -> delete everything // -> redo scanLiveSet // CONNECTED variable }
Ableton::Ableton() { connected = false; setAutoUpdate(false); setAutoDraw(false); // initialize variables }
/*! Constructor \param query needed to create model \param pointer to public implementation object connected */ CaItemModelPrivate::CaItemModelPrivate(const CaQuery &query, CaItemModel *itemModelPublic) : QObject(), m_q(itemModelPublic), mParentEntry(), mQuery(query), mService(CaService::instance()), mEntries(mService), mNotifier(NULL), mSize(defaultIconSize), mSecondLineVisibility(true) { updateModel(); setAutoUpdate(true); }
//----------------------------------------------- KFileDnDDetailView::KFileDnDDetailView(QWidget *parent, const char *name ) : KFileDetailView(parent,name), m_autoOpenTimer( this ), m_autoOpenTime( autoOpenTime ), m_useAutoOpenTimer( true ), m_dropItem(0), m_dndEnabled( true ) { setAutoUpdate( true ); setDnDEnabled( true ); useAutoOpenTimer( true ); }
// recompute the widths of displayed columns void Pstable::recompute_table_widths() { int rows = procview->procs.size(); int cols = procview->cats.size(); setNumRows(rows); // this will clear all selections in pstable setAutoUpdate(FALSE); // avoid redundant repaints setNumCols(cols); // this will clear all widths setAutoUpdate(TRUE); leftmostchanged = -1; for(int col = 0; col < cols; col++) { if(widthChanged(col) && leftmostchanged == -1) leftmostchanged = col; } if(leftmostchanged != -1) updateTableSize(); }
//BaseTreeBranch implementation BaseTreeBranch::BaseTreeBranch(KFileTreeView *parent, const KURL& url, const QString& name, const QPixmap& pix, bool showHidden , KFileTreeViewItem *branchRoot) : KFileTreeBranch(parent, url, name, pix, showHidden, branchRoot) { bool localFile = url.isLocalFile(); setAutoUpdate(localFile); setChildRecurse(false); }
KUserTable::KUserTable(QWidget *parent, const char *name) : KRowTable(SelectRow, parent, name) { QString pixdir = kapp->kde_datadir() + QString("/kuser/pics/"); pmUser = new QPixmap(pixdir + "user.xpm"); setCellHeight( max( fontMetrics().lineSpacing(), pmUser->height()) ); setNumCols( 2 ); setAutoUpdate(TRUE); current = -1; sort = -1; }
void FingerList::endSession() { // num is overral number of chord fingerings. If it's 0 - then there are no // fingerings. In the appl array, indexes should be ranged from 0 to (num-1) setNumRows((num - 1) / perRow + 1); #if QT_VERSION < 300 setAutoUpdate(TRUE); repaint(); #else repaintContents(true); #endif }
void KFileInfoContents::setSorting(QDir::SortSpec new_sort) { QDir::SortSpec old_sort = static_cast<QDir::SortSpec>(sorting() & QDir::SortByMask); QDir::SortSpec sortflags = static_cast<QDir::SortSpec>(sorting() & (~QDir::SortByMask)); if (mySortMode == Switching) { if (new_sort == old_sort) reversed = !reversed; else reversed = false; } else reversed = (mySortMode == Decreasing); mySorting = static_cast<QDir::SortSpec>(new_sort | sortflags); if (count() <= 1) // nothing to do in this case return; if ( mySorting & QDir::DirsFirst ) keepDirsFirst = true; else keepDirsFirst = false; setAutoUpdate(false); clearView(); debugC("qsort %ld", time(0)); QuickSort(sortedArray, 0, sorted_length - 1); debugC("qsort %ld", time(0)); for (uint i = 0; i < sorted_length; i++) insertItem(sortedArray[i], -1); debugC("qsort %ld", time(0)); setAutoUpdate(true); repaint(true); }
RemoteLister::RemoteLister( const KURL &url, QWidget *parent ) : KDirLister( true /*don't fetch mimetypes*/ ) , m_root( new Store( url, url.url(), 0 ) ) , m_store( m_root ) { setAutoUpdate( false ); //don't use KDirWatchers setShowingDotFiles( true ); //stupid KDirLister API function names setMainWindow( parent ); //use SIGNAL(result(KIO::Job*)) instead and then use Job::error() connect( this, SIGNAL(completed()), SLOT(completed()) ); connect( this, SIGNAL(canceled()), SLOT(canceled()) ); //we do this non-recursively - it is the only way! openURL( url ); }
bool QgsLegendModel::readXML( const QDomElement& legendModelElem, const QDomDocument& doc ) { Q_UNUSED( doc ); if ( legendModelElem.isNull() ) { return false; } clear(); QDomNodeList topLevelItemList = legendModelElem.childNodes(); QDomElement currentElem; QgsComposerLegendItem* currentItem = 0; int nTopLevelItems = topLevelItemList.size(); for ( int i = 0; i < nTopLevelItems; ++i ) { currentElem = topLevelItemList.at( i ).toElement(); if ( currentElem.isNull() ) { continue; } //toplevel items can be groups or layers if ( currentElem.tagName() == "LayerItem" ) { currentItem = new QgsComposerLayerItem(); } else if ( currentElem.tagName() == "GroupItem" ) { currentItem = new QgsComposerGroupItem(); } currentItem->readXML( currentElem, mHasTopLevelWindow ); QList<QStandardItem *> itemsList; itemsList << currentItem << new QgsComposerStyleItem( currentItem ); appendRow( itemsList ); } setAutoUpdate( legendModelElem.attribute( "autoUpdate", "1" ).toInt() ); return true; }
K3bDeviceBranch::K3bDeviceBranch( KFileTreeView* view, K3bDevice::Device* dev, KFileTreeViewItem* item ) : KFileTreeBranch( view, KURL( "media:/" + dev->blockDeviceName() ), QString("%1 - %2").arg(dev->vendor()).arg(dev->description()), ( dev->burner() ? SmallIcon("cdwriter_unmount") : SmallIcon("cdrom_unmount") ), false, item == 0 ? new K3bDeviceBranchViewItem( view, dev, this ) : item ), m_device( dev ), m_showBlockDeviceName( false ) { setAutoUpdate(true); root()->setExpandable(false); updateLabel(); connect( k3bappcore->mediaCache(), SIGNAL(mediumChanged(K3bDevice::Device*)), this, SLOT(slotMediumChanged(K3bDevice::Device*)) ); }
TodoView::TodoView(CalObject *cal, QWidget *parent, const char *name) : KTabListBox(parent, name, 5) { calendar = cal; // set up filter for events lbox.installEventFilter(this); // set up the widget to have 4 columns (one hidden), and // only a vertical scrollbar clearTableFlags(Tbl_hScrollBar); clearTableFlags(Tbl_autoHScrollBar); // BL: autoscrollbar in not working... setTableFlags(Tbl_hScrollBar); setAutoUpdate(TRUE); adjustColumns(); // insert pictures for use to show a checked/not checked todo dict().insert("CHECKED", new QPixmap(Icon("checkedbox.xpm"))); dict().insert("EMPTY", new QPixmap(Icon("emptybox.xpm"))); dict().insert("CHECKEDMASK", new QPixmap(Icon("checkedbox-mask.xpm"))); dict().insert("EMPTYMASK", new QPixmap(Icon("emptybox-mask.xpm"))); // this is the thing that lets you edit the todo text. editor = new QLineEdit(this); editor->hide(); connect(editor, SIGNAL(returnPressed()), this, SLOT(updateSummary())); connect(editor, SIGNAL(returnPressed()), editor, SLOT(hide())); connect(editor, SIGNAL(textChanged(const char *)), this, SLOT(changeSummary(const char *))); connect(this, SIGNAL(selected(int, int)), this, SLOT(updateItem(int, int))); connect(this, SIGNAL(highlighted(int, int)), this, SLOT(hiliteAction(int, int))); priList = new QListBox(this); priList->hide(); priList->insertItem("1"); priList->insertItem("2"); priList->insertItem("3"); priList->insertItem("4"); priList->insertItem("5"); priList->setFixedHeight(priList->itemHeight()*5+5); priList->setFixedWidth(priList->maxItemWidth()+5); connect(priList, SIGNAL(highlighted(int)), priList, SLOT(hide())); connect(priList, SIGNAL(highlighted(int)), this, SLOT(changePriority(int))); QPixmap pixmap; rmbMenu1 = new QPopupMenu; pixmap = Icon("checkedbox.xpm"); rmbMenu1->insertItem(pixmap, i18n("New Todo"), this, SLOT(newTodo())); pixmap = Icon("delete.xpm"); rmbMenu1->insertItem(pixmap, i18n("Purge Completed "), this, SLOT(purgeCompleted())); rmbMenu2 = new QPopupMenu; pixmap = Icon("checkedbox.xpm"); rmbMenu2->insertItem(pixmap, i18n("New Todo"), this, SLOT (newTodo())); rmbMenu2->insertItem(i18n("Edit Todo"), this, SLOT (editTodo())); pixmap = Icon("delete.xpm"); rmbMenu2->insertItem(pixmap, i18n("Delete Todo"), this, SLOT (deleteTodo())); rmbMenu2->insertItem(i18n("Purge Completed "), this, SLOT(purgeCompleted())); editingFlag = FALSE; connect(this, SIGNAL(headerClicked(int)), this, SLOT(headerAction(int))); updateConfig(); prevRow = updatingRow = -1; }
void AutoUpdateCheckDialog::onCheckOnStartupClicked() { emit setAutoUpdate(ui->qcb_checkOnStartup->checkState() == Qt::Checked); }
void FingerList::beginSession() { #if QT_VERSION < 300 setAutoUpdate(FALSE); #endif clear(); }
void KEdit::replace_all_slot(){ if (!replace_dialog) return; QString to_find_string = replace_dialog->getText(); int lineFrom, lineTo, colFrom, colTo; getSelection(&lineFrom, &colFrom, &lineTo, &colTo); // replace_dialog->get_direction() is true if searching backward if (replace_dialog->get_direction()) { if (colTo != -1) { replace_all_col = colTo - to_find_string.length(); replace_all_line = lineTo; } else { getCursorPosition(&replace_all_line,&replace_all_col); replace_all_col--; } } else { if (colFrom != -1) { replace_all_col = colFrom; replace_all_line = lineFrom; } else { getCursorPosition(&replace_all_line,&replace_all_col); } } deselect(); again: setAutoUpdate(false); int result = 1; while(result){ result = doReplace(to_find_string, replace_dialog->case_sensitive(), false, (!replace_dialog->get_direction()), replace_all_line,replace_all_col,true); } setAutoUpdate(true); update(); if(!replace_dialog->get_direction()){ // forward search int query = KMessageBox::questionYesNo( srchdialog, i18n("End of document reached.\n"\ "Continue from the beginning?"), i18n("Find"),KStdGuiItem::cont(),i18n("Stop")); if (query == KMessageBox::Yes){ replace_all_line = 0; replace_all_col = 0; goto again; } } else{ //backward search int query = KMessageBox::questionYesNo( srchdialog, i18n("Beginning of document reached.\n"\ "Continue from the end?"), i18n("Find"),KStdGuiItem::cont(),i18n("Stop")); if (query == KMessageBox::Yes){ QString string = textLine( numLines() - 1 ); replace_all_line = numLines() - 1; replace_all_col = string.length(); last_replace = BACKWARD; goto again; } } emit CursorPositionChanged(); }