本文整理汇总了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;
}
示例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;
}
示例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);
// -------------------------------------
//.........这里部分代码省略.........