本文整理汇总了C++中showContextMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ showContextMenu函数的具体用法?C++ showContextMenu怎么用?C++ showContextMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showContextMenu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)));
}
示例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);
}
}
示例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();
}
示例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()));
}
示例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);
}
示例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()));
}
示例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)));
}
示例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;
}
示例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)));
}
示例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;
}
示例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()));
}
示例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();
}
示例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)));
}
示例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)));
}
示例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)));
}