本文整理汇总了C++中setToolTip函数的典型用法代码示例。如果您正苦于以下问题:C++ setToolTip函数的具体用法?C++ setToolTip怎么用?C++ setToolTip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setToolTip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
MapEditorWidget::MapEditorWidget(QWidget * parent)
: QWidget(parent)
{
int width = 700;
int height = 350;
plotArea = QRectF(70,15,width-85,height-35);
pointSize = QSize(11, 11);
currentIndex = -1;
pointPen = QPen(QColor("#26466D"), 1);
connectionPen = QPen(QColor("#B2DFEE"), 4);
pointBrush = QBrush(QColor(0x1fb2dfee));
setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed));
setMinimumSize(width,height);
popup = NULL;
setToolTip("<p>Drag,left,right and double click to move,insert, delete"
" and change value of a point.</p>");
connect(this, SIGNAL(pointsChanged(const QPolygonF &)),
this, SLOT(update()));
}
示例2: disconnect
void
PlayableItemWidget::setStation(const RadioStation& rs, const QString& title, const QString& description)
{
// disconnect from recieving any previous signals
disconnect( this, 0 );
m_rs = rs;
m_rs.setTitle( title );
setText( title.isEmpty() ? tr( "A Radio Station" ) : title );
setToolTip( tr( "Play %1" ).arg( text() ) );
m_description = description;
connect( &RadioService::instance(), SIGNAL(tuningIn(RadioStation)), SLOT(onRadioChanged(RadioStation)) );
connect( &RadioService::instance(), SIGNAL(trackSpooled(Track)), SLOT(onRadioChanged()));
connect( this, SIGNAL(clicked()), SLOT(play()));
update();
}
示例3: setToolTip
//!
//! Process hover enter events.
//!
void ConnectionGraphicsItem::hoverEnterEvent ( QGraphicsSceneHoverEvent *event )
{
m_hovered = true;
if (m_connection) {
Parameter *sourceParameter = m_connection->getSourceParameter();
Parameter *targetParameter = m_connection->getTargetParameter();
if (sourceParameter && targetParameter) {
Node *sourceNode = sourceParameter->getNode();
Node *targetNode = targetParameter->getNode();
if (sourceNode && targetNode) {
QString sourceNodeName = sourceNode->getName();
QString targetNodeName = targetNode->getName();
QString sourceParameterName = sourceParameter->getName();
QString targetParameterName = targetParameter->getName();
setToolTip(sourceNodeName + "." + sourceParameterName + " --> " + targetNodeName + "." + targetParameterName);
}
}
}
update();
}
示例4: QDoubleSpinBox
MappingDouble::MappingDouble(MappingWidget* parent, ControllerEmu::NumericSetting<double>* setting)
: QDoubleSpinBox(parent), m_setting(*setting)
{
setRange(m_setting.GetMinValue(), m_setting.GetMaxValue());
setDecimals(2);
if (const auto ui_suffix = m_setting.GetUISuffix())
setSuffix(QStringLiteral(" ") + tr(ui_suffix));
if (const auto ui_description = m_setting.GetUIDescription())
setToolTip(tr(ui_description));
connect(this, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
[this, parent](double value) {
m_setting.SetValue(value);
parent->SaveSettings();
});
connect(parent, &MappingWidget::ConfigChanged, this, &MappingDouble::ConfigChanged);
}
示例5: setToolTip
bool FileOrganiserWidget::viewportEvent(QEvent *pEvent)
{
if (pEvent->type() == QEvent::ToolTip) {
// We need to show a tool tip, so make sure that it's up to date by
// setting it to the path of the current file item or to nothing if we
// are dealing with a folder item
QHelpEvent *helpEvent = static_cast<QHelpEvent *>(pEvent);
QStandardItem *crtItem = mModel->itemFromIndex(indexAt(helpEvent->pos()));
if (crtItem)
setToolTip(QDir::toNativeSeparators(crtItem->data(Item::Folder).toBool()?
"":
crtItem->data(Item::Path).toString()));
}
// Default handling of the event
return TreeViewWidget::viewportEvent(pEvent);
}
示例6: QGraphicsView
///namespace KGraphViewer
///{
//
// PannerView
//
PannerView::PannerView(DotGraphView * parent, const char * name)
: QGraphicsView(parent), m_drawContents(true), m_parent(parent)
{
m_movingZoomRect = false;
// why doesn't this avoid flicker ?
// viewport()->setBackgroundMode(Qt::NoBackground);
///setBackgroundMode(Qt::NoBackground);
setAttribute(Qt::WA_NoSystemBackground);
// if there are ever graphic glitches to be found, remove this again
setOptimizationFlags(QGraphicsView::DontAdjustForAntialiasing | QGraphicsView::DontClipPainter |
QGraphicsView::DontSavePainterState);
setToolTip("View of the complete graph. Click and drag to move the visible part.");
setWhatsThis("<h1>View of the Complete Graph</h1>"
"<p>Single clicking somewhere without the red square will move the center of the "
"view to where the mouse was clicked.</p><p>Clicking and dragging within the red square "
"will cause the view to follow the movement.</p>");
}
示例7: card
CardItem::CardItem(const Card *card)
:Pixmap(card->getPixmapPath(), false), card(card), filtered_card(card), auto_back(true),
is_pending(false)
{
Q_ASSERT(card != NULL);
suit_pixmap.load(QString("image/system/suit/%1.png").arg(card->getSuitString()));
icon_pixmap.load(card->getIconPath());
setTransformOriginPoint(pixmap.width()/2, pixmap.height()/2);
setToolTip(card->getDescription());
setAcceptHoverEvents(true);
QPixmap frame_pixmap("image/system/frame/good.png");
frame = new QGraphicsPixmapItem(frame_pixmap, this);
frame->setPos(-6, -6);
frame->hide();
avatar = NULL;
}
示例8: QSystemTrayIcon
SeafileTrayIcon::SeafileTrayIcon(QObject *parent)
: QSystemTrayIcon(parent),
nth_trayicon_(0),
rotate_counter_(0)
{
setToolTip("Seafile");
setState(STATE_DAEMON_DOWN);
rotate_timer_ = new QTimer(this);
connect(rotate_timer_, SIGNAL(timeout()), this, SLOT(rotateTrayIcon()));
createActions();
createContextMenu();
connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(onActivated(QSystemTrayIcon::ActivationReason)));
#if defined(Q_WS_MAC)
tnm = new TrayNotificationManager(this);
#endif
}
示例9: KSystemTrayIcon
UrsusTrayIcon::UrsusTrayIcon(const QString &icon, KXmlGuiWindow *parent, UrsusPlayer *player_) : KSystemTrayIcon(icon, parent){
// qDebug() << this << "constructor()";
player=player_;
QMenu *cm=contextMenu();
cm->addAction(parent->actionCollection()->action("mute"));
cm->addSeparator();
cm->addAction(parent->actionCollection()->action("previous"));
cm->addAction(parent->actionCollection()->action("play"));
cm->addAction(parent->actionCollection()->action("pause"));
cm->addAction(parent->actionCollection()->action("stop"));
cm->addAction(parent->actionCollection()->action("next"));
setToolTip("Ursus Music Player");
connect(
player->Object(), SIGNAL(stateChanged(Phonon::State, Phonon::State)),
this, SLOT(setStateIcon(Phonon::State, Phonon::State))
);
}
示例10: BaseClass
ExplorerFunctionTreeItem::ExplorerFunctionTreeItem(QTreeWidgetItem *parent,MongoDatabase *database, const MongoFunction &function) :
BaseClass(parent),
_function(function),
_database(database)
{
QAction *dropFunction = new QAction("Remove Function", this);
connect(dropFunction, SIGNAL(triggered()), SLOT(ui_dropFunction()));
QAction *editFunction = new QAction("Edit Function", this);
connect(editFunction, SIGNAL(triggered()), SLOT(ui_editFunction()));
BaseClass::_contextMenu->addAction(editFunction);
BaseClass::_contextMenu->addAction(dropFunction);
setText(0, QtUtils::toQString(_function.name()));
setIcon(0, GuiRegistry::instance().functionIcon());
setToolTip(0, buildToolTip(_function));
setExpanded(false);
}
示例11: setToolTip
QVariant QColorTransferFunctionGraphicalViewNode::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (change == ItemPositionChange)
{
// value is the new position
QPointF newPosition = value.toPointF();
newPosition.setY(0.0);
setToolTip(QString("%1").arg(newPosition.x()));
return newPosition;
}
else if (change == ItemPositionHasChanged)
{
m_view->requestBackgroundUpdate();
return value;
}
else
{
return QGraphicsItem::itemChange(change, value);
}
}
示例12: setFixedSize
void Deskfolder::init()
{
setFixedSize(100, 50);
zoom = false;
selected = false;
setToolTip(dir_path);
pix = QPixmap(d_folder_pix); // set default pixmap
main_menu = new QMenu(this);
// show the Category apps list for open the file
open_menu = main_menu->addMenu(QIcon(open_with_pix), tr("Open with"));
QList <QMenu *> menu_list = cat_menu->get_menus();
for (int i = 0; i < menu_list.size(); ++i)
{
open_menu->addMenu(menu_list.at(i));
}
delete_folder = main_menu->addAction(QIcon(delete_link_pix), tr("Delete link"));
connect(delete_folder, SIGNAL(triggered()), this, SLOT(del_folder()));
}
示例13: Region
ClientRegion::ClientRegion(const QString& name) : Region(15) {
this->name = name;
setToolTip(name);
QBrush brush(Qt::FDiagPattern);
brush.setColor(Qt::magenta);
QPen pen;
pen.setColor(Qt::magenta);
pen.setWidthF(1);
setBrush(brush);
setPen(pen);
//setAcceptDrops(true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemIsMovable, false);
setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
}
示例14: QComboBox
OrchestratorChooser::OrchestratorChooser(GuiHelper *guiHelper, SourcesOrchestatorAbstract *orchestrator, QWidget *parent) :
QComboBox(parent),
orchestrator(orchestrator),
guiHelper(guiHelper)
{
addItem(tr("Select IO type"));
QStandardItem * item = qobject_cast<QStandardItemModel *>(model())->item(0); // there is one and only one item right now
item->setEnabled( false );
addItems(SourcesOrchestatorAbstract::OrchestratorsList);
setToolTip(tr("Select a configuration"));
if (orchestrator != nullptr) {
setCurrentIndex(orchestrator->getType());
}
//connect(this, qOverload<int>(&OrchestratorChooser::currentIndexChanged), this, &OrchestratorChooser::onSelection);
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(onSelection(int)));
}
示例15: QWidget
ShapedClock::ShapedClock(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint |
//Qt::WindowStaysOnTopHint |
Qt::Tool )
{
//QAction *quitAction = new QAction(tr("E&xit"), this);
//quitAction->setShortcut(tr("Ctrl+Q"));
//connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
//addAction(quitAction);
//setContextMenuPolicy(Qt::ActionsContextMenu);
setToolTip( "双击显示或隐藏最近未查看客户悬浮窗口。" );
setWindowTitle( "" );
setStyleSheet( "background-color: rgb(255, 0, 0);" );
bVisible = false;
nCaptionButtonWidth = GetSystemMetrics( SM_CXSIZE );
nCaptionButtonHeight = GetSystemMetrics( SM_CYSIZE );
}