本文整理汇总了C++中QTreeWidget::columnAt方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeWidget::columnAt方法的具体用法?C++ QTreeWidget::columnAt怎么用?C++ QTreeWidget::columnAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTreeWidget
的用法示例。
在下文中一共展示了QTreeWidget::columnAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: imageSearch
//.........这里部分代码省略.........
connect(mSearchClearButton, SIGNAL(clicked()), this, SLOT(clearSearchLine()));
// Misc
mVisibilityIconVisibleForGroups = true;
mVisibilityIconVisibleForAssets = true;
mDeletionIconVisibleForGroups = true;
mDeletionIconVisibleForAssets = true;
// Layout
mSearchLayout->addWidget(mSearchLabel, 1);
mSearchLayout->addWidget(mSearchLine, 2000);
mSearchLayout->addWidget(mSearchClearButton, 1);
setVisibilitySearchWidgets(false);
mainLayout->addLayout(mSearchLayout, 1);
mainLayout->addLayout(mTreeLayout, 2000);
setLayout(mainLayout);
}
//****************************************************************************/
QtSceneViewWidget::~QtSceneViewWidget(void)
{
// Delete all QtAssetGroups in mAssetGroupMap
foreach (QtAssetGroup* group, mAssetGroupMap)
delete group;
mAssetGroupMap.clear();
}
//****************************************************************************/
bool QtSceneViewWidget::eventFilter(QObject* object, QEvent* event)
{
QMouseEvent* mouseEvent = (QMouseEvent*) event;
switch ((int) event->type())
{
case QEvent::MouseButtonPress:
mouseClickHandler(mouseEvent);
break;
}
return QObject::eventFilter(object, event);
}
//****************************************************************************/
void QtSceneViewWidget::mouseClickHandler(QMouseEvent* event)
{
switch ((int) event->button())
{
case Qt::LeftButton:
{
// Get the selected item of the visible sceneview
QTreeWidget* sceneView = getCurrentVisibleScene();
if (sceneView)
{
QTreeWidgetItem* item = sceneView->itemAt(event->pos());
int col = sceneView->columnAt(event->pos().x());
if (itemIsGroup(item))
{
if (col == TOOL_SCENEVIEW_COLUMN_GROUP_CLOSE)
{
handleDeletionOfGroup(sceneView, item);
return;
}
else if (col == TOOL_SCENEVIEW_COLUMN_GROUP_VISIBILITY)
{
// Toggle visibility
toggleVisibilityOfGroup(item);
}
int groupId = getGroupIdOfGroupItem(item);
emit groupSelected(sceneView, groupId);
}
else if (itemIsAsset(item))
{
if (col == TOOL_SCENEVIEW_COLUMN_ASSET_CLOSE)
{
handleDeletionOfAsset(sceneView, item);
return;
}
else if (col == TOOL_SCENEVIEW_COLUMN_ASSET_VISIBILITY)
{
// Toggle visibility
toggleVisibilityOfAsset(item);
}
int groupId = getGroupIdOfAssetItem(item);
int assetId = getAssetIdOfAssetItem(item);
emit assetSelected(sceneView, groupId, assetId);
}
}
}
break;
case Qt::RightButton:
{
// TODO
}
break;
}
}