LiteDoc::LiteDoc(LiteApi::IApplication *app, QObject *parent) : LiteApi::ILiteDoc(parent), m_liteApp(app) { m_docBrowser = new DocumentBrowser(app,this); m_docBrowser->urlComboBox()->setEditable(false); m_docBrowser->setName(tr("LiteIDE Document Browser")); QStringList paths; paths << m_liteApp->resourcePath()+"/welcome"; m_docBrowser->setSearchPaths(paths); m_browserAct = m_liteApp->editorManager()->registerBrowser(m_docBrowser); m_liteApp->actionManager()->insertViewMenu(LiteApi::ViewMenuBrowserPos,m_browserAct); connect(m_docBrowser,SIGNAL(requestUrl(QUrl)),this,SLOT(openUrl(QUrl))); connect(m_docBrowser,SIGNAL(highlighted(QUrl)),this,SLOT(highlighted(QUrl))); QString path = m_liteApp->resourcePath()+"/welcome/doc.html"; QFile file(path); if (file.open(QIODevice::ReadOnly)) { m_templateData = file.readAll(); file.close(); } m_liteApp->extension()->addObject("LiteApi.ILiteDoc",this); QUrl url("/readme.html"); openUrl(url); }
//================================================================== void KCharSelectTable::mouseMoveEvent( QMouseEvent *e ) { const int row = rowAt( e->y() ); const int col = columnAt( e->x() ); if ( row >= 0 && row < numRows() && col >= 0 && col < numCols() ) { const QPoint oldPos = vPos; vPos.setX( col ); vPos.setY( row ); vChr = QChar( vTableNum * 256 + numCols() * vPos.y() + vPos.x() ); const QPoint oldFocus = focusPos; focusPos = vPos; focusItem = vChr; repaintCell( oldFocus.y(), oldFocus.x(), true ); repaintCell( oldPos.y(), oldPos.x(), true ); repaintCell( vPos.y(), vPos.x(), true ); emit highlighted( vChr ); emit highlighted(); emit focusItemChanged( focusItem ); emit focusItemChanged(); } }
/*! Activate to emit highlighted(). */ void QTextBrowser::viewportMouseMoveEvent( QMouseEvent* e) { #ifndef QT_NO_DRAGANDDROP if ( (e->state() & LeftButton) == LeftButton && !d->buttonDown.isEmpty() ) { if ( ( e->globalPos() - d->lastClick ).manhattanLength() > QApplication::startDragDistance() ) { QUrl url ( context(), d->buttonDown, TRUE ); QUriDrag* drag = new QUriDrag( this ); drag->setUnicodeUris( url.toString() ); drag->drag(); } return; } #endif if ( e->state() == 0 ) { QString act = anchorAt( e->pos() ); if (d->highlight != act) { if ( !act.isEmpty() ){ emit highlighted( act ); d->highlight = act; } else if ( !d->highlight.isEmpty() ) { emit highlighted( QString::null ); d->highlight = QString::null; } #ifndef QT_NO_CURSOR viewport()->setCursor( d->highlight.isEmpty()?arrowCursor:pointingHandCursor ); #endif } } QTextView::viewportMouseMoveEvent( e ); }
void ContactDetails::init( const QContact &entry ) { // If we redisplay the same entry, don't shift our view around too much bool sameEntry = (entry.uid() == ent.uid()); ent = entry; mLink.clear(); /* Create our members, if we haven't */ if ( !mModel ) { mModel = new QContactModel(this); connect(mModel, SIGNAL(modelReset()), this, SLOT(modelChanged())); mTabs = new QTabWidget(); mQuickTab = new ContactOverview(0); mDetailsTab = new ContactBrowser(0); #if defined(QTOPIA_TELEPHONY) mCallHistoryTab = new ContactCallHistoryList(0); #endif mMessageHistoryTab = new ContactMessageHistoryList(0); mTabs->addTab(mQuickTab, QIcon(":icon/contactdetails"), tr("Overview")); mTabs->addTab(mDetailsTab, QIcon(":icon/details"), tr("Details")); #if defined(QTOPIA_TELEPHONY) mTabs->addTab(mCallHistoryTab, QIcon(":icon/phone/calls"), tr("Calls")); #endif mTabs->addTab(mMessageHistoryTab, QIcon(":icon/email"), tr("Messages")); connect(mQuickTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated())); connect(mQuickTab, SIGNAL(backClicked()), this, SIGNAL(backClicked())); connect(mDetailsTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated())); connect(mDetailsTab, SIGNAL(backClicked()), this, SIGNAL(backClicked())); #if defined(QTOPIA_TELEPHONY) connect(mCallHistoryTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated())); connect(mCallHistoryTab, SIGNAL(backClicked()), this, SIGNAL(backClicked())); #endif connect(mMessageHistoryTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated())); connect(mMessageHistoryTab, SIGNAL(backClicked()), this, SIGNAL(backClicked())); connect(mQuickTab, SIGNAL(callContact()), this, SIGNAL(callContact())); connect(mQuickTab, SIGNAL(textContact()), this, SIGNAL(textContact())); connect(mQuickTab, SIGNAL(emailContact()), this, SIGNAL(emailContact())); connect(mQuickTab, SIGNAL(editContact()), this, SIGNAL(editContact())); connect(mDetailsTab, SIGNAL(highlighted(QString)), this, SIGNAL(highlighted(QString))); QVBoxLayout *v = new QVBoxLayout(); v->addWidget(mTabs); v->setMargin(0); setLayout(v); } modelChanged(); if (!sameEntry) mTabs->setCurrentIndex(0); mTabs->currentWidget()->setFocus(); }
bool MenuView::set_highlighted(const size_t new_value) { if( new_value >= children_.size() ) { return false; } item_view(highlighted())->unhighlight(); highlighted_ = new_value; item_view(highlighted())->highlight(); return true; }
void hrTreeView::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Down) { QModelIndex index = indexBelow(currentIndex()); emit highlighted(index.isValid() ? index : currentIndex()); } else if (event->key() == Qt::Key_Up) { QModelIndex index = indexAbove(currentIndex()); emit highlighted(index.isValid() ? index : currentIndex()); } QTreeView::keyPressEvent(event); }
void function() { if(left_clicked()==true && cursor1.left_click==true)//clicked this object { cursor1.objects_selected=1; cursor1.selected_object=number; cursor1.highlighted_objects[number]=true; } if(cursor1.left_click==true && cursor1.objects_selected>0 && cursor1.highlighted_objects[number]==false)//clicked another object { cursor1.highlighted_objects[number]=false; } if(cursor1.left_click==true && left_clicked()==false ) { cursor1.highlighted_objects[number]=false; cursor1.objects_selected=0; } if(highlighted()==true) { cursor1.highlighted_objects[number]=true; } if(highlighted()==false && cursor1.highlighted_objects[number]==true) { if(left_clicked()==false && selected==false) cursor1.objects_selected++; cursor1.highlighted_objects[number]=true; } selected=cursor1.highlighted_objects[number]; if(selected==true) { set_color(0.0,1.0,0.0);//color green } else undo_color(); }
void KUserTable::setCurrentItem(int item) { int old = current; current = item; updateCell(old, 0); updateCell(current, 0, FALSE); emit highlighted(current, 0); }
BioWidget::BioWidget( QWidget* p ) :QTextBrowser( p ), m_currentHoverWidget(0) { setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); connect(document()->documentLayout(), SIGNAL( documentSizeChanged(QSizeF)), SLOT( onBioChanged(QSizeF))); connect(this, SIGNAL(anchorClicked(QUrl)), SLOT(onAnchorClicked(QUrl))); m_widgetTextObject = new WidgetTextObject; viewport()->installEventFilter( this ); document()->documentLayout()->registerHandler( WidgetImageFormat, m_widgetTextObject ); ui.image = new HttpImageWidget(this); ui.image->setFixedWidth( 160 ); ui.image->setAlignment( Qt::AlignTop ); ui.onTour = new BannerWidget( tr("On Tour" ) ); ui.onTour->setBannerVisible( false ); ui.onTour->setWidget( ui.image ); ui.onTour->setFixedWidth( 170 ); ui.onTour->setObjectName( "onTour" ); connect( ui.image, SIGNAL(loaded()), SLOT(onImageLoaded())); connect( ui.image, SIGNAL(loaded()), SLOT(update())); connect( this, SIGNAL(highlighted(QString)), SLOT(onHighlighted(QString)) ); qDebug() << fontInfo().pixelSize(); }
void dtkColorGrid::mouseMoveEvent ( QMouseEvent * event ) { //if (!hasFocus()) setFocus(); QWidget::mouseMoveEvent(event); d->pos = event->pos(); int c = d->cellSize+1; d->row = d->pos.y() / c; d->col = d->pos.x() / c; int i = index(); if (i != d->idx) { d->idx = i; repaint(); QToolTip::hideText(); if (d->idx != -1) { emit highlighted(d->hlColor); QToolTip::showText(event->globalPos(), d->hlColor.name(), this); if (d->pickDrag && event->buttons() & Qt::LeftButton) { d->selColor = d->hlColor; emit picked(d->selColor); //emit accepted(); } } } }
GenericViewer::GenericViewer( QWidget* parent ) : QMailViewerInterface( parent ), browser( new Browser(parent) ), message( 0 ), plainTextMode( false ), containsNumbers( false ) { connect(browser, SIGNAL(anchorClicked(QUrl)), this, SLOT(linkClicked(QUrl))); connect(browser, SIGNAL(highlighted(QUrl)), this, SLOT(linkHighlighted(QUrl))); connect(browser, SIGNAL(finished()), this, SIGNAL(finished())); plainTextModeAction = new QAction(QIcon(":icon/txt"), tr("Plain text"), this); plainTextModeAction->setVisible(!plainTextMode); plainTextModeAction->setWhatsThis(tr("Display the message contents in Plain text format.")); richTextModeAction = new QAction(QIcon(":icon/txt"), tr("Rich text"), this); richTextModeAction->setVisible(plainTextMode); richTextModeAction->setWhatsThis(tr("Display the message contents in Rich text format.")); printAction = new QAction(QIcon(":icon/print"), tr("Print"), this); printAction->setVisible(false); printAction->setWhatsThis(tr("Print the message contents.")); dialAction = new QAction(this); dialAction->setVisible(false); }
void TagWidget::setCompleter(QCompleter *completer) { m_completer = completer; m_completer->setWidget(this); connect(m_completer, SIGNAL(activated(QString)), this, SLOT(completionSelected(QString))); connect(m_completer, SIGNAL(highlighted(QString)), this, SLOT(completionHighlighted(QString))); }
HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) : QWebView(parent) , helpEngine(engine) , parentWidget(parent) , loadFinished(false) { setAcceptDrops(false); setPage(new HelpPage(parent, helpEngine, this)); page()->setNetworkAccessManager(new HelpNetworkAccessManager(engine, this)); QAction* action = pageAction(QWebPage::OpenLinkInNewWindow); action->setText(tr("Open Link in New Tab")); if (!parent) action->setVisible(false); pageAction(QWebPage::DownloadLinkToDisk)->setVisible(false); pageAction(QWebPage::DownloadImageToDisk)->setVisible(false); pageAction(QWebPage::OpenImageInNewWindow)->setVisible(false); connect(pageAction(QWebPage::Copy), SIGNAL(changed()), this, SLOT(actionChanged())); connect(pageAction(QWebPage::Back), SIGNAL(changed()), this, SLOT(actionChanged())); connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this, SLOT(actionChanged())); connect(page(), SIGNAL(linkHovered(QString,QString,QString)), this, SIGNAL(highlighted(QString))); connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl))); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool))); }
void function() { if(clicked()==true)//object clicked on { if(color[1]==1 && color[2]==0 && color[3]==0)//color red set_color(0.0,1.0,0.0);//color green resting.x=current.x; resting.y=current.y; } else set_color(1.0,0.0,0.0);//color red if(highlighted()==true)//objects highlighted by selection box { set_prev_color(); set_color(0.0,0.0,1.0);//color blue active=true; } else undo_color(); }
QWidget* ComboBoxDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const { QComboBox *comboDelegate = new QComboBox(parent); comboDelegate->setModel(model); comboDelegate->setEditable(true); comboDelegate->setAutoCompletion(true); comboDelegate->setAutoCompletionCaseSensitivity(Qt::CaseInsensitive); comboDelegate->completer()->setCompletionMode(QCompleter::PopupCompletion); comboDelegate->view()->setEditTriggers(QAbstractItemView::AllEditTriggers); comboDelegate->lineEdit()->installEventFilter( const_cast<QObject*>(qobject_cast<const QObject*>(this))); comboDelegate->view()->installEventFilter( const_cast<QObject*>(qobject_cast<const QObject*>(this))); connect(comboDelegate, SIGNAL(highlighted(QString)), this, SLOT(testActivation(QString))); connect(comboDelegate->lineEdit(), SIGNAL(editingFinished()), this, SLOT(testActivation())); connect(comboDelegate, SIGNAL(activated(QString)), this, SLOT(fakeActivation())); currCombo.comboEditor = comboDelegate; currCombo.currRow = index.row(); currCombo.model = const_cast<QAbstractItemModel*>(index.model()); // Current display of things on Gnome3 looks like shit, so // let`s fix that. if (isGnome3Session()) { QPalette p; p.setColor(QPalette::Window, QColor(Qt::white)); p.setColor(QPalette::Base, QColor(Qt::white)); comboDelegate->lineEdit()->setPalette(p); comboDelegate->setPalette(p); } return comboDelegate; }
/*! \internal \fn void PhoneLauncherView::selectionChangedHandler(GridItem *item) Called in response to the current item changing (i.e. SelectedItem has shifted position, highlight a different GridItem object). Updates the window title, and emits the signal highlighted(...). Signals emitted: \l{function}{highlighted(QContent)}. */ void PhoneLauncherView::selectionChangedHandler(GridItem *item) { if ( !item ) { qWarning("PhoneLauncherView::selectionChangedHandler(...): Error - item parameter is null."); // Set the title to a space rather than an empty string. This causes the title bar to // remain the same, but just without a title. An empty string will cause a different kind of // title bar to appear. if (!Qtopia::mousePreferred()) topLevelWidget()->setWindowTitle(" "); return; } if ( !(item->content()) ) { // Set the title to a space rather than an empty string. This causes the title bar to // remain the same, but just without a title. An empty string will cause a different kind of // title bar to appear. if (!Qtopia::mousePreferred()) topLevelWidget()->setWindowTitle(" "); return; } emit highlighted(*(item->content())); if (!Qtopia::mousePreferred()) topLevelWidget()->setWindowTitle(item->content()->name()); }
void HbComboBoxPrivate::setCompletion( bool completion ) { Q_Q( HbComboBox ); if ( completion ) { if ( mCompleter ) { mProxyModel->setSourceModel( mModel ); mProxyModel->sort( Qt::AscendingOrder ); mCompleter->setModel( mProxyModel ); } else { mProxyModel = new QSortFilterProxyModel( q ); mProxyModel->setDynamicSortFilter( true ); mProxyModel->setSortCaseSensitivity( Qt::CaseInsensitive ); mProxyModel->setSourceModel( mModel ); mProxyModel->sort( Qt::AscendingOrder ); mCompleter = new QCompleter( mProxyModel, q ); mCompleter->setCaseSensitivity( Qt::CaseInsensitive ); mCompleter->setCompletionRole( Qt::DisplayRole ); mCompleter->setCompletionMode( QCompleter::InlineCompletion ); q->connect( mCompleter, SIGNAL( highlighted( QModelIndex ) ), q, SLOT( _q_textCompleted( QModelIndex ) ) ); } } else { if ( mCompleter ) { delete mCompleter; mCompleter = 0; } if ( mProxyModel ) { delete mProxyModel; mProxyModel = 0; } } }
void TrainerMenu::setTiers(const QStringList &tiers) { QCompleter *m_completer = new QCompleter(tiers); m_completer->setCaseSensitivity(Qt::CaseInsensitive); m_completer->setCompletionMode(QCompleter::PopupCompletion); ui->teamTier->setCompleter(m_completer); connect(m_completer, SIGNAL(highlighted(QString)), this, SLOT(setTier(QString))); }
void Queen::showValidMoves(sf::RenderWindow &wind, Box board[][8], int x, int y) { int size = board[0][0].getHeight(); sf::RectangleShape highlighted(sf::Vector2f(size, size)); sf::Color colorHighlighted(255, 215, 0, 125); for (int i = 1; i < 8; i++) { if (this->isValidMove(board, x, y, x + i, y - i)) // Upp-höger { highlighted.setFillColor(colorHighlighted); highlighted.setPosition((x + i) * size, (y - i) * size); wind.draw(highlighted); } if (this->isValidMove(board, x, y, x + i, y + i)) // Ner-höger { highlighted.setFillColor(colorHighlighted); highlighted.setPosition((x + i) * size, (y + i) * size); wind.draw(highlighted); } if (this->isValidMove(board, x, y, x - i, y + i)) // Ner-vänster { highlighted.setFillColor(colorHighlighted); highlighted.setPosition((x - i) * size, (y + i) * size); wind.draw(highlighted); } if (this->isValidMove(board, x, y, x - i, y - i)) // Upp-vänster { highlighted.setFillColor(colorHighlighted); highlighted.setPosition((x - i) * size, (y - i) * size); wind.draw(highlighted); } if (this->isValidMove(board, x, y, x + i, y)) // Höger { highlighted.setFillColor(colorHighlighted); highlighted.setPosition((x + i) * size, y * size); wind.draw(highlighted); } if (this->isValidMove(board, x, y, x - i, y)) // Vänster { highlighted.setFillColor(colorHighlighted); highlighted.setPosition((x - i) * size, y * size); wind.draw(highlighted); } if (this->isValidMove(board, x, y, x, y - i)) // Upp { highlighted.setFillColor(colorHighlighted); highlighted.setPosition(x * size, (y - i) * size); wind.draw(highlighted); } if (this->isValidMove(board, x, y, x, y + i)) // Ner { highlighted.setFillColor(colorHighlighted); highlighted.setPosition(x * size, (y + i) * size); wind.draw(highlighted); } } }
void function() { if(clicked()==true)//clicked this object { if(selected==true) { cursor1.highlighted_objects[number]=false; } cursor1.objects_selected=1; cursor1.selected_object=number; selected=true; } if(cursor1.objects_selected=1 && clicked()==false)//clicked another object or outside of object { selected=false; cursor1.highlighted_objects[number]=false; } if(highlighted()==true) { selected=true; cursor1.highlighted_objects[number]=true; } if(highlighted()==false && cursor1.highlighted_objects[number]==true) { if(clicked()==false && selected==false) cursor1.objects_selected++; selected=true; } if(selected==true) { set_color(0.0,1.0,0.0);//color green } else undo_color(); }
void ColorCombo::slotHighlighted( int index ) { if ( index < 2 ) internalcolor = customColor; else internalcolor = standardPalette[ index - 2 ]; emit highlighted( internalcolor ); }
TextBrowserHtmlWidget::TextBrowserHtmlWidget(QObject *parent) : IHtmlWidget(parent) { m_widget = new QTextBrowser; m_widget->setOpenLinks(false); m_widget->setOpenExternalLinks(false); connect(m_widget,SIGNAL(anchorClicked(QUrl)),this,SIGNAL(linkClicked(QUrl))); connect(m_widget,SIGNAL(highlighted(QUrl)),this,SIGNAL(linkHovered(QUrl))); }
Completer::Completer(QObject* parent) : QCompleter(parent) { d.lineEdit = 0; d.defaultModel = 0; d.slashModel = 0; setCaseSensitivity(Qt::CaseInsensitive); setCompletionMode(InlineCompletion); connect(this, SIGNAL(highlighted(QString)), this, SLOT(insertCompletion(QString))); }
void ToolbarSearch::focusInEvent(QFocusEvent *event) { SearchLineEdit::focusInEvent(event); // Every time we get a focus in event QLineEdit re-connects... disconnect(completer(), SIGNAL(activated(QString)), this, SLOT(setText(QString))); disconnect(completer(), SIGNAL(highlighted(QString)), this, SLOT(_q_completionHighlighted(QString))); }
void ColorCombo::slotHighlighted( int index ) { if ( index == 0 ) internalColor = customColor; else internalColor = palette[ m_colorScheme ][ index - 1 ]; emit highlighted( internalColor ); }
//================================================================== void KCharSelectTable::keyPressEvent( QKeyEvent *e ) { switch ( e->key() ) { case Key_Left: gotoLeft(); break; case Key_Right: gotoRight(); break; case Key_Up: gotoUp(); break; case Key_Down: gotoDown(); break; case Key_Next: emit tableDown(); break; case Key_Prior: emit tableUp(); break; case Key_Space: emit activated( ' ' ); emit activated(); emit highlighted( ' ' ); emit highlighted(); break; case Key_Enter: case Key_Return: { const QPoint oldPos = vPos; vPos = focusPos; vChr = focusItem; repaintCell( oldPos.y(), oldPos.x(), true ); repaintCell( vPos.y(), vPos.x(), true ); emit activated( vChr ); emit activated(); emit highlighted( vChr ); emit highlighted(); } break; } }
void RunBar::_renewCompleter() { if(_completer) { _completer->disconnect(this); _completer->deleteLater(); } _completer = new QCompleter(_hinter->availableCommands()); _completer->setWidget(this); connect(_completer, SIGNAL(highlighted(QString)), this, SLOT(_completer_highlighted(QString))); }
void ExLineEdit::focusOutEvent(QFocusEvent *event) { m_lineEdit->event(event); if (m_lineEdit->completer()) { connect(m_lineEdit->completer(), SIGNAL(activated(QString)), m_lineEdit, SLOT(setText(QString))); connect(m_lineEdit->completer(), SIGNAL(highlighted(QString)), m_lineEdit, SLOT(_q_completionHighlighted(QString))); } QWidget::focusOutEvent(event); }
void KApplicationTree::highlighted(int index) { KAppTreeListItem *item = (KAppTreeListItem *)tree->itemAt( index ); if( ( !item->directory ) && !( item->exec.isEmpty() ) && !( item->appname.isEmpty() ) ) emit highlighted( item->appname.data(), item->exec.data() ); }
void Image::paint(Painter& painter) { if( bitmap_ ) { // Code also handles ImageButton behavior. const bool selected = (has_focus() || highlighted()); painter.draw_bitmap( screen_pos(), *bitmap_, selected ? background_ : foreground_, selected ? foreground_ : background_ ); } }