本文整理汇总了C++中showContextMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ showContextMenu函数的具体用法?C++ showContextMenu怎么用?C++ showContextMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showContextMenu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QTreeView
/*!
\param pBreakPointsWidget - pointer to BreakpointsWidget
*/
BreakpointsTreeView::BreakpointsTreeView(BreakpointsWidget *pBreakPointsWidget)
: QTreeView(pBreakPointsWidget)
{
mpBreakpointsWidget = pBreakPointsWidget;
setItemDelegate(new ItemDelegate(this));
setTextElideMode(Qt::ElideMiddle);
setIndentation(0);
setIconSize(QSize(15, 15));
setExpandsOnDoubleClick(false);
setContextMenuPolicy(Qt::CustomContextMenu);
createActions();
connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showContextMenu(QPoint)));
connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(breakPointDoubleClicked(QModelIndex)));
}
开发者ID:acracan,项目名称:OMEdit,代码行数:17,代码来源:BreakpointsWidget.cpp
示例2: D_MOUSE
void MediaRoutingView::mouseDown(
BPoint point,
uint32 buttons,
uint32 clicks)
{
D_MOUSE(("MediaRoutingView::mouseDown()\n"));
if ((buttons == B_SECONDARY_MOUSE_BUTTON)
|| (modifiers() & B_CONTROL_KEY))
{
EndRectTracking();
showContextMenu(point);
}
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:14,代码来源:MediaRoutingView.cpp
示例3: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
_ui(new Ui::MainWindow),
_clipboard(QApplication::clipboard()),
_proxyModel(new QSortFilterProxyModel),
_storageModel(),
_objectModel(new MtpObjectsModel()),
_uploader(new FileUploader(_objectModel, this))
{
_ui->setupUi(this);
setWindowIcon(QIcon(":/android-file-transfer.png"));
_ui->listView->setModel(_proxyModel);
_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
_proxyModel->sort(0);
_proxyModel->setDynamicSortFilter(true);
_objectModel->moveToThread(QApplication::instance()->thread());
connect(_ui->listView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), SLOT(updateActionsState()));
connect(_ui->listView, SIGNAL(doubleClicked(QModelIndex)), SLOT(onActivated(QModelIndex)));
connect(_ui->listView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showContextMenu(QPoint)));
connect(_ui->actionBack, SIGNAL(triggered()), SLOT(back()));
connect(_ui->actionGo_Down, SIGNAL(triggered()), SLOT(down()));
connect(_ui->actionCreateDirectory, SIGNAL(triggered()), SLOT(createDirectory()));
connect(_ui->actionUploadDirectory, SIGNAL(triggered()), SLOT(uploadDirectories()));
connect(_ui->actionUpload_Album, SIGNAL(triggered()), SLOT(uploadAlbum()));
connect(_ui->actionUpload, SIGNAL(triggered()), SLOT(uploadFiles()));
connect(_ui->actionRename, SIGNAL(triggered()), SLOT(renameFile()));
connect(_ui->actionDownload, SIGNAL(triggered()), SLOT(downloadFiles()));
connect(_ui->actionDelete, SIGNAL(triggered()), SLOT(deleteFiles()));
connect(_ui->storageList, SIGNAL(activated(int)), SLOT(onStorageChanged(int)));
connect(_ui->actionRefresh, SIGNAL(triggered()), SLOT(refresh()));
connect(_ui->actionPaste, SIGNAL(triggered()), SLOT(pasteFromClipboard()));
connect(_objectModel, SIGNAL(onFilesDropped(QStringList)), SLOT(uploadFiles(QStringList)));
connect(_objectModel, SIGNAL(existingFileOverwrite(QString)), SLOT(confirmOverwrite(QString)), Qt::BlockingQueuedConnection);
connect(_clipboard, SIGNAL(dataChanged()), SLOT(validateClipboard()));
validateClipboard();
//fixme: find out how to specify alternative in designer
_ui->actionBack->setShortcuts(_ui->actionBack->shortcuts() << QKeySequence("Alt+Up") << QKeySequence("Esc"));
_ui->actionGo_Down->setShortcuts(_ui->actionGo_Down->shortcuts() << QKeySequence("Alt+Down") << QKeySequence("Enter"));
_ui->actionCreateDirectory->setShortcuts(_ui->actionCreateDirectory->shortcuts() << QKeySequence("F7"));
_ui->actionRefresh->setShortcuts(_ui->actionRefresh->shortcuts() << QKeySequence("Ctrl+R"));
_ui->listView->setFocus();
}
开发者ID:dsimakov,项目名称:android-file-transfer-linux,代码行数:49,代码来源:mainwindow.cpp
示例4: ContentsWidget
CacheContentsWidget::CacheContentsWidget(Window *window) : ContentsWidget(window),
m_model(new QStandardItemModel(this)),
m_isLoading(true),
m_ui(new Ui::CacheContentsWidget)
{
m_ui->setupUi(this);
m_ui->previewLabel->hide();
QTimer::singleShot(100, this, SLOT(populateCache()));
connect(m_ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterCache(QString)));
connect(m_ui->cacheView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(openEntry(QModelIndex)));
connect(m_ui->cacheView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
connect(m_ui->deleteButton, SIGNAL(clicked()), this, SLOT(removeDomainEntriesOrEntry()));
}
开发者ID:B-Rich,项目名称:otter,代码行数:15,代码来源:CacheContentsWidget.cpp
示例5: kDebug
LogFile::LogFile(QWidget *parent, const QString& title, SharedSettings *workSheetSettings)
: KSGRD::SensorDisplay(parent, title, workSheetSettings)
{
kDebug() << "Making sensor logger";
logFileID= 0;
lfs = NULL;
QLayout *layout = new QHBoxLayout(this);
monitor = new QListWidget(this);
layout->addWidget(monitor);
setLayout(layout);
setMinimumSize(50, 25);
monitor->setContextMenuPolicy( Qt::CustomContextMenu );
connect(monitor, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showContextMenu(QPoint)));
setPlotterWidget(monitor);
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:16,代码来源:LogFile.cpp
示例6: QDialog
TitleIdFinderDialog::TitleIdFinderDialog(QStatusBar *statusBar, QWidget *parent) :
QDialog(parent), ui(new Ui::TitleIdFinderDialog), statusBar(statusBar)
{
ui->setupUi(this);
finder = new TitleIdFinder("", this);
connect(finder, SIGNAL(SearchFinished(QList<TitleData>)), this,
SLOT(onRequestFinished(QList<TitleData>)));
ui->treeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
ui->treeWidget->header()->resizeSection(0, 300);
connect(ui->treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this,
SLOT(showContextMenu(QPoint)));
connect(ui->lineEdit, SIGNAL(returnPressed()), this, SLOT(on_pushButton_clicked()));
}
开发者ID:Overx,项目名称:Velocity,代码行数:16,代码来源:titleidfinderdialog.cpp
示例7: QTreeView
ResourceView::ResourceView(QUndoStack *history, QWidget *parent) :
QTreeView(parent),
m_qrcModel(new Internal::RelativeResourceModel(m_qrcFile, this)),
m_history(history),
m_mergeId(-1)
{
advanceMergeId();
setModel(m_qrcModel);
setContextMenuPolicy(Qt::CustomContextMenu);
header()->hide();
connect(m_qrcModel, SIGNAL(dirtyChanged(bool)),
this, SIGNAL(dirtyChanged(bool)));
connect(this, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(showContextMenu(QPoint)));
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:17,代码来源:resourceview.cpp
示例8: LayerButton
LayerButton *MultiLayer::addLayerButton() {
for (int i = 0; i < buttonsList.count(); i++) {
LayerButton *btn = (LayerButton *)buttonsList.at(i);
btn->setOn(false);
}
LayerButton *button = new LayerButton(QString::number(++graphs));
connect(button, SIGNAL(clicked(LayerButton *)), this,
SLOT(activateGraph(LayerButton *)));
connect(button, SIGNAL(showContextMenu()), this,
SIGNAL(showLayerButtonContextMenu()));
connect(button, SIGNAL(showCurvesDialog()), this, SIGNAL(showCurvesDialog()));
buttonsList.append(button);
layerButtonsBox->addWidget(button);
return button;
}
开发者ID:narunlifescience,项目名称:AlphaPlot,代码行数:17,代码来源:MultiLayer.cpp
示例9: SpecificEnemiesModel
/**
* init должен вызываться для каждого переключения аккаунта, так что старые данные нужно обновлять
*/
void SpecificEnemiesView::init()
{
// Прописываем модель
SpecificEnemiesModel *oldModel = model_;
model_ = new SpecificEnemiesModel(this);
setModel(model_);
if (oldModel != NULL)
delete oldModel;
// Настройки поведения таблицы
resizeColumnsToContents();
horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
horizontalHeader()->setResizeMode(2, QHeaderView::ResizeToContents);
verticalHeader()->setDefaultAlignment( Qt::AlignHCenter );
verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
}
开发者ID:sofgame-plugin,项目名称:psiplus-plugin,代码行数:20,代码来源:specificenemiesview.cpp
示例10: QStackedLayout
bool ProcessController::addSensor(const QString& hostName,
const QString& sensorName,
const QString& sensorType,
const QString& title)
{
if (sensorType != "table")
return false;
QStackedLayout *layout = new QStackedLayout(this);
mProcessList = new KSysGuardProcessList(this, hostName);
mProcessList->setUpdateIntervalMSecs(0); //we will call updateList() manually
mProcessList->setContentsMargins(0,0,0,0);
addActions(mProcessList->actions());
connect(mProcessList, SIGNAL(updated()), this, SIGNAL(updated()));
connect(mProcessList, SIGNAL(processListChanged()), this, SIGNAL(processListChanged()));
mProcessList->setContextMenuPolicy( Qt::CustomContextMenu );
connect(mProcessList, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showContextMenu(QPoint)));
layout->addWidget(mProcessList);
/** To use a remote sensor, we need to drill down through the layers, to connect to the remote processes. Then connect to its signals and slots.
* It's horrible I know :( */
if(!hostName.isEmpty() && hostName != "localhost") {
KSysGuard::Processes *processes = mProcessList->processModel()->processController();
mProcesses = processes;
if(processes) {
connect( processes, SIGNAL(runCommand(QString,int)), SLOT(runCommand(QString,int)));
}
}
setPlotterWidget(mProcessList);
QTimer::singleShot(0, mProcessList->filterLineEdit(), SLOT(setFocus()));
registerSensor(new KSGRD::SensorProperties(hostName, sensorName, sensorType, title));
/* This just triggers the first communication. The full set of
* requests are send whenever the sensor reconnects (detected in
* sensorError(). */
sensors().at(0)->setIsOk(true); //Assume it is okay from the start
setSensorOk(sensors().at(0)->isOk());
emit processListChanged();
return true;
}
开发者ID:fluxer,项目名称:kde-workspace,代码行数:45,代码来源:ProcessController.cpp
示例11: ContentsWidget
CookiesContentsWidget::CookiesContentsWidget(Window *window) : ContentsWidget(window),
m_model(new QStandardItemModel(this)),
m_isLoading(true),
m_ui(new Ui::CookiesContentsWidget)
{
m_ui->setupUi(this);
if (!window)
{
m_ui->detailsWidget->hide();
}
QTimer::singleShot(100, this, SLOT(populateCookies()));
connect(m_ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterCookies(QString)));
connect(m_ui->cookiesView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
connect(m_ui->deleteButton, SIGNAL(clicked()), this, SLOT(removeCookies()));
}
开发者ID:krytarowski,项目名称:otter-browser,代码行数:18,代码来源:CookiesContentsWidget.cpp
示例12: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setActionGroups(parent);
setStretchFatrors();
ui->treeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->treeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
connect(ui->actionCreateDVS, SIGNAL(triggered()), this, SLOT(createNewProject()));
connect(ui->actionLoadDVS, SIGNAL(triggered()), this, SLOT(loadProject()));
connect(ui->actionSaveDVS, SIGNAL(triggered()), this, SLOT(saveDVS()));
createNetRedactor();
}
开发者ID:goto1134,项目名称:dynamic-computational-nets,代码行数:18,代码来源:MainWindow.cpp
示例13: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
plan = new Planner();
nav = plan->createNavigator();
nav->displayList(ui->wgtNav);
// createWindow = new createModule(nav);
ui->lblName->hide();
ui->lblMark->hide();
ui->sedMark->hide();
ui->lblTotal->hide();
ui->lwgtAssess->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->lwgtAssess, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
}
开发者ID:RavenBlood7,项目名称:Module-Planner,代码行数:18,代码来源:mainwindow.cpp
示例14: QWebView
//! Constructor
//! @param pParent is the pointer to DocumentationWidget.
DocumentationViewer::DocumentationViewer(DocumentationWidget *pParent)
: QWebView(pParent)
{
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showContextMenu(QPoint)));
mpDocumentationWidget = pParent;
zoomFact = 1.;
setZoomFactor(zoomFact);
// set DocumentationViewer settings
settings()->setFontFamily(QWebSettings::StandardFont, "Verdana");
settings()->setFontSize(QWebSettings::DefaultFontSize, 10);
settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
settings()->setDefaultTextEncoding(Helper::utf8.toStdString().data());
// set DocumentationViewer web page policy
page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
connect(page(), SIGNAL(linkClicked(QUrl)), SLOT(processLinkClick(QUrl)));
connect(page(), SIGNAL(linkHovered(QString,QString,QString)), SLOT(processLinkHover(QString,QString,QString)));
}
开发者ID:wibraun,项目名称:OMEdit,代码行数:20,代码来源:DocumentationWidget.cpp
示例15: QDialog
DecaptchaDialog::DecaptchaDialog(QWidget *parent) :
QDialog(parent),
m_model(new DecaptchaPluginConfigModel(this)),
m_view(new QListView(this)),
m_layout(new QHBoxLayout(this))
{
setWindowTitle(tr("Decaptcha"));
setMinimumHeight(360);
m_view->setModel(m_model);
m_view->setUniformItemSizes(true);
m_view->setContextMenuPolicy(Qt::CustomContextMenu);
m_layout->addWidget(m_view);
connect(m_view, SIGNAL(clicked(QModelIndex)), this, SLOT(showPluginDialog(QModelIndex)));
connect(m_view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
}
开发者ID:wulinfa,项目名称:qdl2,代码行数:18,代码来源:decaptchadialog.cpp
示例16: LOG_ERROR
void FrameAttachmentPoint::initialize(QString name, QWidget* attachmentPoint, EFrameAttachmentType type, bool defaultPoint)
{
//Called by constructor
mName = name;
if (attachmentPoint == 0)
LOG_ERROR() << "Handed 0-pointer to FrameAttachmentPoint constructor.";
mAttachmentPoint = attachmentPoint;
mType = type;
mDefaultPoint = defaultPoint;
switch(type)
{
case ATTACHMENT_NONE:
mMaxAttachmentCount = 0;
LOG_ERROR() << "Initializing with undefined type ATTACHMENT_NONE.";
break;
case ATTACHMENT_WIDGET: mMaxAttachmentCount = 1; break;
case ATTACHMENT_FRAME: mMaxAttachmentCount = 1; break;
case ATTACHMENT_TABWIDGET: mMaxAttachmentCount = INT_MAX; break;
case ATTACHMENT_DOCKWIDGET: mMaxAttachmentCount = 1; break;
case ATTACHMENT_MAINWINDOW: mMaxAttachmentCount = 1; break;
default:
mMaxAttachmentCount = 0;
LOG_ERROR() << "Initializing with illegal type.";
break;
}
if (mMaxAttachmentCount == INT_MAX)
{
attachmentPoint->setToolTip("Attachment point for Gui plugins.");
attachmentPoint->setWhatsThis("Attachment point for many Gui plugins. You can create a plugin from the plugin dialog or the toolbar.\n" \
"Right clicking opens a context menu to move, copy or delete the plugin.");
}
else
{
attachmentPoint->setToolTip("Attachment point for " + QString::number(mMaxAttachmentCount) + " Gui plugins.");
attachmentPoint->setWhatsThis("Attachment point for " + QString::number(mMaxAttachmentCount) + " Gui plugins. " \
"You can create a plugin from the plugin dialog or the toolbar.\n" \
"Right clicking opens a context menu to move, copy or delete the plugin.");
}
attachmentPoint->setContextMenuPolicy(Qt::CustomContextMenu);
connect(attachmentPoint, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:44,代码来源:frameattachmentpoint.cpp
示例17: ContentsWidget
TransfersContentsWidget::TransfersContentsWidget(Window *window) : ContentsWidget(window),
m_model(new QStandardItemModel(this)),
m_isLoading(false),
m_ui(new Ui::TransfersContentsWidget)
{
m_ui->setupUi(this);
QStringList labels;
labels << QString() << tr("Filename") << tr("Size") << tr("Progress") << tr("Time") << tr("Speed") << tr("Started") << tr("Finished");
m_model->setHorizontalHeaderLabels(labels);
m_ui->transfersView->setModel(m_model);
m_ui->transfersView->horizontalHeader()->setTextElideMode(Qt::ElideRight);
m_ui->transfersView->horizontalHeader()->resizeSection(0, 30);
m_ui->transfersView->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
m_ui->transfersView->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
m_ui->transfersView->setItemDelegate(new ItemDelegate(this));
m_ui->transfersView->setItemDelegateForColumn(3, new ProgressBarDelegate(this));
m_ui->transfersView->installEventFilter(this);
m_ui->stopResumeButton->setIcon(Utils::getIcon(QLatin1String("task-ongoing")));
m_ui->redownloadButton->setIcon(Utils::getIcon(QLatin1String("view-refresh")));
// In order for the sizeHint method to be called, the ResizeToContents needs to be set up
m_ui->transfersView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
const QList<TransferInformation*> transfers = TransfersManager::getTransfers();
for (int i = 0; i < transfers.count(); ++i)
{
addTransfer(transfers.at(i));
}
connect(TransfersManager::getInstance(), SIGNAL(transferStarted(TransferInformation*)), this, SLOT(addTransfer(TransferInformation*)));
connect(TransfersManager::getInstance(), SIGNAL(transferRemoved(TransferInformation*)), this, SLOT(removeTransfer(TransferInformation*)));
connect(TransfersManager::getInstance(), SIGNAL(transferUpdated(TransferInformation*)), this, SLOT(updateTransfer(TransferInformation*)));
connect(m_model, SIGNAL(modelReset()), this, SLOT(updateActions()));
connect(m_ui->transfersView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(updateActions()));
connect(m_ui->transfersView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(openTransfer(QModelIndex)));
connect(m_ui->transfersView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
connect(m_ui->downloadLineEdit, SIGNAL(returnPressed()), this, SLOT(startQuickTransfer()));
connect(m_ui->stopResumeButton, SIGNAL(clicked()), this, SLOT(stopResumeTransfer()));
connect(m_ui->redownloadButton, SIGNAL(clicked()), this, SLOT(redownloadTransfer()));
}
开发者ID:jernejs,项目名称:otter,代码行数:44,代码来源:TransfersContentsWidget.cpp
示例18: QTreeWidget
/*!
\param pStackFramesWidget - pointer to StackFramesWidget
*/
StackFramesTreeWidget::StackFramesTreeWidget(StackFramesWidget *pStackFramesWidget)
: QTreeWidget(pStackFramesWidget)
{
mpStackFramesWidget = pStackFramesWidget;
setItemDelegate(new ItemDelegate(this));
setTextElideMode(Qt::ElideMiddle);
setIconSize(Helper::iconSize);
setColumnCount(3);
QStringList headers;
headers << tr("Function") << Helper::line << Helper::file;
setHeaderLabels(headers);
setIndentation(0);
setExpandsOnDoubleClick(false);
setContextMenuPolicy(Qt::CustomContextMenu);
createActions();
connect(mpStackFramesWidget->getMainWindow()->getGDBAdapter(), SIGNAL(stackListFrames(GDBMIValue*)), SLOT(createStackFrames(GDBMIValue*)));
connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), mpStackFramesWidget, SLOT(stackItemDoubleClicked(QTreeWidgetItem*)));
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
}
开发者ID:hkiel,项目名称:OMEdit,代码行数:22,代码来源:StackFramesWidget.cpp
示例19: pageAction
void lmcMessageLog::createContextMenu(void) {
QAction* action = pageAction(QWebPage::Copy);
action->setShortcut(QKeySequence::Copy);
addAction(action);
action = pageAction(QWebPage::CopyLinkToClipboard);
addAction(action);
action = pageAction(QWebPage::SelectAll);
action->setShortcut(QKeySequence::SelectAll);
addAction(action);
contextMenu = new QMenu(this);
copyAction = contextMenu->addAction("&Copy", this, SLOT(copyAction_triggered()), QKeySequence::Copy);
copyLinkAction = contextMenu->addAction("&Copy Link", this, SLOT(copyLinkAction_triggered()));
contextMenu->addSeparator();
selectAllAction = contextMenu->addAction("Select &All", this,
SLOT(selectAllAction_triggered()), QKeySequence::SelectAll);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
setContextMenuPolicy(Qt::CustomContextMenu);
}
开发者ID:j2doll,项目名称:lmc-clone,代码行数:19,代码来源:messagelog.cpp
示例20: count
void TabBar::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::RightButton) {
const int nTabCount = count();
if (nTabCount == 0)
return;
for (int i{0}; i < nTabCount; ++i) {
if (tabRect(i).contains(event->pos())) {
m_nTabIndex = i;
showContextMenu(event);
break;
}
}
}
QTabBar::mousePressEvent(event);
}
开发者ID:henrikfroehling,项目名称:snipit-deprecated,代码行数:19,代码来源:tabbar.cpp
注:本文中的showContextMenu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论