• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setToolTip函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setToolTip函数的典型用法代码示例。如果您正苦于以下问题:C++ setToolTip函数的具体用法?C++ setToolTip怎么用?C++ setToolTip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setToolTip函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: QToolButton

MountButton::MountButton(QWidget * parent, RazorPanel *panel) :
    QToolButton(parent),
    mPopup(this),
    m_panel(panel),
    mDevAction(DevActionInfo),
    mPopupHideDelay(5000)
{
    if (!QDBusConnection::systemBus().isConnected())
    {
        qWarning() << "Can't connect to dbus daemon. Some functions will be omited";
    }

    setIcon(XdgIcon::fromTheme(QStringList() << "device-notifier" << "drive-removable-media-usb"));
    setToolTip(tr("Removable media/devices manager"));

    initialScanDevices();

    QDBusConnection conn = QDBusConnection::systemBus();
    // TODO: Check for connection, timer for reconect
    /*bool connected =*/ conn.connect("org.freedesktop.UDisks",
                                  "/org/freedesktop/UDisks",
                                  "org.freedesktop.UDisks",
                                  "DeviceChanged",
                                  this,
                                  SLOT(onDbusDeviceChangesMessage(QDBusObjectPath)));


    connect(&mPopup, SIGNAL(visibilityChanged(bool)), this, SLOT(setDown(bool)));

    connect(m_panel, SIGNAL(positionChanged()), &mPopup, SLOT(hide()));

    connect(this, SIGNAL(clicked()), this, SLOT(showHidePopup()));

    connect(&_dm, SIGNAL(deviceConnected(DiskInfo)),
            this, SLOT(onDiskAdded(DiskInfo)));

    connect(&_dm, SIGNAL(deviceDisconnected(DiskInfo)),
            this, SLOT(onDiskRemoved(DiskInfo)));

    _dm.start();
}
开发者ID:Alexandr-Galko,项目名称:razor-qt,代码行数:41,代码来源:mountbutton.cpp


示例17: qDebug

//闪动图标
//Flash the icon
void SystemTrayIconBase::showFlash(const QIcon &icon, const QString &toolTip, QMenu *menu,
                                   int millisecondsTimeoutHint) {
    
    qDebug()<<"----SystemTrayIconBase::showFlash(const QIcon &icon, ...)";
    
    
        
    this->m_currentData.setToolTip(toolTip);
    this->m_currentData.setMenu(menu);
    this->m_currentData.settrayIconType(TrayIconData::TRAYICON_Flash);
    this->m_currentData.setFirstIcon(icon);
    
    
    disconnect(timer, SIGNAL(timeout()), 0, 0);
    timer->stop();
    
    iconQueue.append(icon);
    setIcon(icon);
    setToolTip(toolTip);
    
    
    
    connect(timer, SIGNAL(timeout()), this, SLOT(slotShowFlash()));
    timer->setInterval(millisecondsTimeoutHint);
    timer->start();
    
    if (menu) {
        QMenu *trayMenu = contextMenu();
        if (!trayMenu) {
            setContextMenu(menu);
        } else {
            trayMenu->addMenu(menu);
        }
    }
    
    
    
    
    qDebug()<<"~~ timer->isActive():"<<timer->isActive();
    
}
开发者ID:RallyWRT,项目名称:qtapplications,代码行数:43,代码来源:systemtrayiconbase.cpp


示例18: AbstractContent

TextBoxContent::TextBoxContent(QGraphicsScene * scene, QGraphicsItem * parent)
    : AbstractContent(scene, parent, false)
    , m_text(0)
    , m_shadowText(0)
    , m_textRect(0, 0, 0, 0)
    , m_textMargin(4)
    , m_lastModelRev(0)
{
	DEBUG_TSTART();
	m_dontSyncToModel = true;

	setFrame(0);
	setFrameTextEnabled(false);
	setToolTip(tr("Right click to Edit the text"));
	// create a text document
	m_text = new QTextDocument(this);
	// for drawing the shadow
	m_shadowText = new QTextDocument(this);

	#if QT_VERSION >= 0x040500
		m_textMargin = (int)m_text->documentMargin();
	#endif
	// template text
	QFont font;
	#ifdef Q_OS_WIN
		font.setFamily("Arial");
	#endif
	font.setPointSize(16);
	m_text->setDefaultFont(font);

	//connect(this, SIGNAL(resized()), this, SLOT(delayContentsResized()));
	for(int i=0;i<m_cornerItems.size();i++)
		m_cornerItems.at(i)->setDefaultLeftOp(CornerItem::Scale);

	m_zoomAnimationTimer = new QTimer(this);
	connect(m_zoomAnimationTimer, SIGNAL(timeout()), this, SLOT(animateZoom()));
	
	m_dontSyncToModel = false;
	
	//qDebug() << "TextBoxContent(): \t \t Elapsed:"<<(((double)total.elapsed())/1000.0)<<" sec";
}
开发者ID:dtbinh,项目名称:dviz,代码行数:41,代码来源:TextBoxContent.cpp


示例19: QWidget

InfoIndicator::InfoIndicator(int widgetWidth, int widgetHeight, QWidget *parent)
    : QWidget(parent), indWidth(widgetWidth), indHeight(widgetHeight), showAll(false)
{
    setContextMenuPolicy(Qt::ActionsContextMenu);
    setToolTip(tr("Drag the info indicator with the left mouse button.\n"
        "Use the right mouse button to open the Settings and Profile Widgets."));
    setWindowTitle(tr("Info Indicator"));

    setWindowOpacity(GUI_OPACITY);
    QPalette pal;
    pal.setColor(QPalette::Background, MIDAS_GREY);
    setAutoFillBackground(true);
    setPalette(pal);
    setWindowFlags(Qt::WindowStaysOnTopHint  | Qt::X11BypassWindowManagerHint);

    layout = new QHBoxLayout;
    //layout->setSpacing(WIDGET_BUFFER);
    layout->setMargin(0);
    
    setLayout(layout);

    QFont timesFont("Times", 9, QFont::Bold);
    stateLabel = new QLabel();
    stateLabel->setFont(timesFont);

    button = new QPushButton("+", this);
    button->setText(getShowAllString());
    button->setFixedWidth(widgetHeight - 4); // Modify this line if getShowAllString has more than just a single character
    button->setFixedHeight(widgetHeight - 4);
    QFont timesSmall("Times", 8, QFont::DemiBold);
    button->setFont(timesSmall);
    connect(button, SIGNAL(released()), this, SLOT(handleButton()));

    layout->addSpacerItem(new QSpacerItem(6, 6));
    layout->addWidget(stateLabel, 1, Qt::AlignLeft);
    layout->addWidget(button, 0, Qt::AlignRight);
    layout->addSpacerItem(new QSpacerItem(2, 2));

	setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    setMinimumSize(indWidth, indHeight);
}
开发者ID:jordenh,项目名称:ProjectMidas,代码行数:41,代码来源:InfoIndicator.cpp


示例20: KSystemTrayIcon

KCheckGmailTray::KCheckGmailTray(QWidget *parent)
    : KSystemTrayIcon(parent),
      mMailCount(0)
{
    mPixGmail = KSystemTrayIcon::loadIcon("kcheckgmail").pixmap(KIconLoader::SizeSmallMedium);
    mLightIconImage = mIconEffect.apply(mPixGmail,
                                        KIconEffect::ToGamma,
                                        0.90,
                                        Qt::red,
                                        false).toImage();
    setIcon(mPixGmail);

    mLoginAnim = new QTimer(this);
    connect(mLoginAnim, SIGNAL(timeout()),
            this, SLOT(slotToggleLoginAnim()));

    setToolTip(i18n("KCheckGMail"));

    connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(slotActivated(QSystemTrayIcon::ActivationReason)));
}
开发者ID:netrunner-debian-kde-extras,项目名称:kcheckgmail,代码行数:21,代码来源:kcheckgmailtray.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setTopLevel函数代码示例发布时间:2022-05-30
下一篇:
C++ setTitle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap