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


C++ QtProperty::setToolTip方法代码示例

本文整理汇总了C++中QtProperty::setToolTip方法的典型用法代码示例。如果您正苦于以下问题:C++ QtProperty::setToolTip方法的具体用法?C++ QtProperty::setToolTip怎么用?C++ QtProperty::setToolTip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QtProperty的用法示例。


在下文中一共展示了QtProperty::setToolTip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

QtProperty *ShapePropertyString::getQtProperty()
{
    QtProperty *pProp = m_stringManager->addProperty( m_sName );
    pProp->setToolTip( m_sDescription );
    pProp->setWhatsThis( m_sDescription );
    pProp->setEnabled( m_bEnabled );
    return pProp;
}
开发者ID:neomilium,项目名称:GenericHID,代码行数:8,代码来源:shapepropertystring.cpp

示例2:

QtProperty *ShapePropertyRCNames::getQtProperty()
{
    QtProperty *pProp = m_keyMatrixNameManager->addProperty( m_sName );
    pProp->setToolTip( m_sDescription );
    pProp->setWhatsThis( m_sDescription );
    pProp->setEnabled( m_bEnabled );
    return pProp;
}
开发者ID:neomilium,项目名称:GenericHID,代码行数:8,代码来源:shapepropertyrcnames.cpp

示例3: QMainWindow

QNEMainWindow::QNEMainWindow(QWidget *parent) :  QMainWindow(parent)
{
	// -------------------------------------
	// central widget
	// -------------------------------------
	QWidget *window = new QWidget();
	setCentralWidget(window);
	QHBoxLayout *layout = new QHBoxLayout;
	window->setLayout(layout);	
	// -------------------------------------
	// Main menu
	// ------------------------------------
	createMenuBar();
	layout->setMenuBar(menuBar);


	// -------------------------------------
	// Tools
	// ------------------------------------

	QVBoxLayout *Tools_Layout = new QVBoxLayout;
    layout->addLayout(Tools_Layout);
	// -------------------------------------
	// Tree
	// ------------------------------------
	QTreeWidget *treeWidget = new QTreeWidget();
	treeWidget->setColumnCount(1);
	treeWidget->setHeaderHidden(true);
	treeWidget->setFixedWidth(250);
	// создаем новый итем (пусть сначала базовый)
	QTreeWidgetItem *topLevelItem=new QTreeWidgetItem(treeWidget);
	// вешаем его на наше дерево в качестве топ узла.
	treeWidget->addTopLevelItem(topLevelItem);
	// укажем текст итема
	topLevelItem->setText(0,"Item");
	// создаем новый итем и сразу вешаем его на наш базовый
	QTreeWidgetItem *item=new QTreeWidgetItem(topLevelItem);
	// укажем текст итема
	item->setText(0,"SubItem");
	Tools_Layout->addWidget(treeWidget);

	// -------------------------------------
	// Property Browser
	// ------------------------------------	
 
	QtIntPropertyManager *intManager;
    QtProperty *priority;
    
    intManager = new QtIntPropertyManager;
    priority = intManager->addProperty("Priority");   
    priority->setToolTip("Task Priority");
    intManager->setRange(priority, 1, 5);
    intManager->setValue(priority, 3);

    QtEnumPropertyManager *enumManager=new QtEnumPropertyManager();
    QtProperty *reportType;
	reportType = enumManager->addProperty("Report Type");  
    QStringList types;   
    types << "Bug" << "Suggestion" << "To Do";
    enumManager->setEnumNames(reportType, types);
    enumManager->setValue(reportType, 1); // "Suggestion"

    QtGroupPropertyManager *groupManager;
    QtProperty *task1;

    groupManager = new QtGroupPropertyManager;
    task1 = groupManager->addProperty("Task 1");
    
    task1->addSubProperty(priority);
    task1->addSubProperty(reportType);

    QtSpinBoxFactory *spinBoxFactory;
    QtEnumEditorFactory *enumFactory;
    
    spinBoxFactory = new QtSpinBoxFactory;
    enumFactory = new QtEnumEditorFactory;
    
    QtTreePropertyBrowser *browser;
    browser = new QtTreePropertyBrowser;
    browser->setFactoryForManager(intManager, spinBoxFactory);
    browser->setFactoryForManager(enumManager, enumFactory);
	browser->setFixedWidth(250);

    browser->addProperty(task1);
   // browser->show();

	Tools_Layout->addWidget(browser);

	// -------------------------------------
	// Graphic view
	// ------------------------------------
	view = new QGraphicsView(this);
	view->setInteractive(true);
	view->setBackgroundBrush(QBrush(QColor(60,60,60), Qt::SolidPattern));
	scene = new QGraphicsScene();
	view->setScene(scene);
	view->setRenderHint(QPainter::Antialiasing, true);
	layout->addWidget(view);

	// -------------------------------------
//.........这里部分代码省略.........
开发者ID:V-Italy,项目名称:CaffeGui,代码行数:101,代码来源:qnemainwindow.cpp


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