当前位置: 首页>>代码示例>>C++>>正文


C++ setToolTip函数代码示例

本文整理汇总了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()));  
}
开发者ID:FXIhub,项目名称:hawk,代码行数:20,代码来源:mapeditordialog.cpp

示例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();
}
开发者ID:dschmidt,项目名称:lastfm-desktop,代码行数:20,代码来源:PlayableItemWidget.cpp

示例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();
}
开发者ID:banduladh,项目名称:levelfour,代码行数:23,代码来源:ConnectionGraphicsItem.cpp

示例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);
}
开发者ID:AdmiralCurtiss,项目名称:dolphin,代码行数:20,代码来源:MappingNumeric.cpp

示例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);
}
开发者ID:A1kmm,项目名称:opencor,代码行数:20,代码来源:fileorganiserwidget.cpp

示例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>");
}
开发者ID:Daniel1892,项目名称:tora,代码行数:25,代码来源:pannerview.cpp

示例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;
}
开发者ID:buptUnixGuys,项目名称:QSanguosha,代码行数:20,代码来源:carditem.cpp

示例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
}
开发者ID:Greyhatno,项目名称:seafile-client,代码行数:20,代码来源:tray-icon.cpp

示例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))
	);
}
开发者ID:pilhoo,项目名称:Ursus,代码行数:20,代码来源:trayicon.cpp

示例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);
    }
开发者ID:eugenkr,项目名称:robomongo,代码行数:20,代码来源:ExplorerFunctionTreeItem.cpp

示例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);
    }
}
开发者ID:chinhtrandn,项目名称:starviewer,代码行数:20,代码来源:qcolortransferfunctiongraphicalviewnode.cpp

示例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()));
}
开发者ID:BGCX262,项目名称:zyphp-svn-to-git,代码行数:20,代码来源:deskfolder.cpp

示例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);
}
开发者ID:Mesagoppinmypants,项目名称:Tools,代码行数:20,代码来源:clientregion.cpp

示例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)));
}
开发者ID:metrodango,项目名称:pip3line,代码行数:20,代码来源:orchestratorchooser.cpp

示例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 );
}
开发者ID:Anne081031,项目名称:ParkSolution,代码行数:20,代码来源:shapedclock.cpp


注:本文中的setToolTip函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。