QStandardItem *ptImageSpotModel::createSpotItem(const ptImageSpot &ASpot) { QStandardItem* hSpotItem = new QStandardItem(ASpot.name()); hSpotItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); // ListView checkboxes are tristate, so we can’t pass a bool as is. hSpotItem->setCheckState(ASpot.isEnabled() ? Qt::Checked : Qt::Unchecked); hSpotItem->setSizeHint(FSizeHint); hSpotItem->setToolTip(createToolTip(ASpot)); return hSpotItem; }
BOOL ModuleWorldPage::OnInitDialog() { CPropertyPage::OnInitDialog(); // TODO: この位置に初期化の補足処理を追加してください // setFont(); createImageList(); createToolTip(); return TRUE; // コントロールにフォーカスを設定しないとき、戻り値は TRUE となります // 例外: OCX プロパティ ページの戻り値は FALSE となります }
// every frame, determine if current tooltip should be hidden void LLToolTipMgr::updateToolTipVisibility() { // create new tooltip if we have one ready to go if (mNeedsToolTip) { mNeedsToolTip = false; createToolTip(mNextToolTipParams); mLastToolTipParams = mNextToolTipParams; return; } // hide tooltips when mouse cursor is hidden if (LLUI::getWindow()->isCursorHidden()) { blockToolTips(); return; } // hide existing tooltips if they have timed out S32 mouse_x, mouse_y; LLUI::getMousePositionLocal(gToolTipView, &mouse_x, &mouse_y); F32 tooltip_timeout = 0.f; if (toolTipVisible()) { // mouse far away from tooltip tooltip_timeout = mLastToolTipParams.visible_time_far; // mouse near rect will only include the tooltip if the // tooltip is clickable if (mMouseNearRect.pointInRect(mouse_x, mouse_y)) { // mouse "close" to tooltip tooltip_timeout = mLastToolTipParams.visible_time_near; // if tooltip is clickable (has large mMouseNearRect) // than having cursor over tooltip keeps it up indefinitely if (mToolTip->parentPointInView(mouse_x, mouse_y)) { // mouse over tooltip itself, don't time out tooltip_timeout = mLastToolTipParams.visible_time_over; } } if (mToolTip->getVisibleTime() > tooltip_timeout) { hideToolTips(); unblockToolTips(); } } }
Surface::Surface(Grid::DataType const type, int const quality, double const isovalue, QColor const& positive, QColor const& negative, bool const upsample) : m_type(type), m_quality(quality), m_isovalue(isovalue), m_shininess(50.0), m_specular(0.5), m_drawMode(Fill), m_upsample(upsample), m_configurator(this), m_callListPositive(0), m_callListNegative(0), m_areaPositive(0.0), m_areaNegative(0.0) { setFlags(Qt::ItemIsUserCheckable); setCheckState(Qt::Unchecked); setColor(positive, Positive); setColor(negative, Negative); setConfigurator(&m_configurator); setText(m_type.info()); m_configurator.setWindowTitle("Configure Surface: " + m_type.info()); createToolTip(); // This is slightly less than 1 to ensure all surfaces are drawn after the // Primitives (which have alpha = 1.0) when sorted in the ViewerModel, but // because it is > 0.99 it won't tigger the transparency overhead in draw(); setAlpha(0.999); updated(); }
bool MaEditorConsensusArea::event(QEvent* e) { switch (e->type()) { case QEvent::ToolTip : { QHelpEvent* he = static_cast<QHelpEvent *>(e); QString tip = createToolTip(he); if (!tip.isEmpty()) { QToolTip::showText(he->globalPos(), tip); } return true; } case QEvent::FocusIn : ui->getSequenceArea()->setFocus(static_cast<QFocusEvent *>(e)->reason()); break; case QEvent::Wheel : ui->getSequenceArea()->setFocus(Qt::MouseFocusReason); break; default: ; // skip other events } return QWidget::event(e); }
void EventApplet::init() { KConfigGroup cg = config(); disabledResources = cg.readEntry("DisabledResources", QStringList()); QString normalEventFormat = cg.readEntry("NormalEventFormat", QString("%{startDate} %{startTime} %{summary}")); QString todoFormat = cg.readEntry("TodoFormat", QString("%{dueDate} %{summary}")); QString noDueDateFormat = cg.readEntry("NoDueDateFormat", QString("%{summary}")); int dtFormat = cg.readEntry("DateFormat", ShortDateFormat); QString dtString = cg.readEntry("CustomDateFormat", QString("dd.MM.")); m_period = cg.readEntry("Period", 365); m_urgency = cg.readEntry("UrgencyTime", 15); m_birthdayUrgency = cg.readEntry("BirthdayUrgencyTime", 14); m_urgentBg = QColor(cg.readEntry("UrgentColor", QString("#FF0000"))); m_urgentBg.setAlphaF(cg.readEntry("UrgentOpacity", 10)/100.0); m_colors.insert(urgentColorPos, m_urgentBg); m_passedFg = QColor(cg.readEntry("PassedColor", QString("#C3C3C3"))); m_colors.insert(passedColorPos, m_passedFg); m_todoBg = QColor(cg.readEntry("TodoColor", QString("#FFD235"))); m_todoBg.setAlphaF(cg.readEntry("TodoOpacity", 10)/100.0); m_colors.insert(todoColorPos, m_todoBg); m_showFinishedTodos = cg.readEntry("ShowFinishedTodos", FALSE); m_finishedTodoBg = QColor(cg.readEntry("FinishedTodoColor", QString("#6FACE0"))); m_finishedTodoBg.setAlphaF(cg.readEntry("FinishedTodoOpacity", 10)/100.0); m_colors.insert(finishedTodoColorPos, m_finishedTodoBg); int opacity = cg.readEntry("KOOpacity", 10); setupCategoryColors(opacity); QString koConfigPath = KStandardDirs::locateLocal("config", "korganizerrc"); m_categoryColorWatch = new KDirWatch(this); m_categoryColorWatch->addFile(koConfigPath); connect(m_categoryColorWatch, SIGNAL(created(const QString &)), this, SLOT(koConfigChanged())); connect(m_categoryColorWatch, SIGNAL(dirty(const QString &)), this, SLOT(koConfigChanged())); connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(plasmaThemeChanged())); QStringList keys, values; keys << i18n("Birthday") << i18n("Holiday"); values << QString("%{startDate} %{yearsSince}. %{summary}") << QString("%{startDate} %{summary} to %{endDate}"); keys = cg.readEntry("CategoryFormatsKeys", keys); values = cg.readEntry("CategoryFormatsValues", values); for (int i = 0; i < keys.size(); ++i) { m_categoryFormat.insert(keys.at(i), values.at(i)); } QStringList headerList; headerList << i18n("Today") << i18n("Events of today") << QString::number(0); headerList << i18n("Tomorrow") << i18n("Events for tomorrow") << QString::number(1); headerList << i18n("Week") << i18n("Events of the next week") << QString::number(2); headerList << i18n("Next 4 weeks") << i18n("Events for the next 4 weeks") << QString::number(8); headerList << i18n("Later") << i18n("Events later than 4 weeks") << QString::number(29); m_headerItemsList = cg.readEntry("HeaderItems", headerList); m_delegate = new EventItemDelegate(this, normalEventFormat, todoFormat, noDueDateFormat, dtFormat, dtString); m_delegate->setCategoryFormats(m_categoryFormat); graphicsWidget(); Plasma::ToolTipManager::self()->registerWidget(this); createToolTip(); lastCheckTime = QDateTime::currentDateTime(); m_timer = new QTimer(); connect(m_timer, SIGNAL(timeout()), this, SLOT(timerExpired())); QTimer::singleShot(0, this, SLOT(setupModel())); }
void ptImageSpotModel::setSpotPos(const int AIndex, const int Ax, const int Ay) { FSpotList->at(AIndex)->setPos(QPoint(Ax, Ay)); this->setData(this->index(AIndex,0), createToolTip(*FSpotList->at(AIndex)), Qt::ToolTipRole); }