本文整理汇总了C++中setContextMenuPolicy函数的典型用法代码示例。如果您正苦于以下问题:C++ setContextMenuPolicy函数的具体用法?C++ setContextMenuPolicy怎么用?C++ setContextMenuPolicy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setContextMenuPolicy函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QTreeWidget
QueueListView::QueueListView(QWidget* parent)
: QTreeWidget(parent), d(new QueueListViewPriv)
{
setIconSize(QSize(d->iconSize, d->iconSize));
setSelectionMode(QAbstractItemView::ExtendedSelection);
setWhatsThis(i18n("This is the list of images to batch process."));
setAcceptDrops(true);
viewport()->setAcceptDrops(true);
setDropIndicatorShown(true);
setDragEnabled(true);
viewport()->setMouseTracking(true);
setSortingEnabled(false);
setAllColumnsShowFocus(true);
setRootIsDecorated(false);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setColumnCount(3);
setContextMenuPolicy(Qt::CustomContextMenu);
QStringList titles;
titles.append(i18n("Thumbnail"));
titles.append(i18n("File Name"));
titles.append(i18n("Target"));
setHeaderLabels(titles);
header()->setResizeMode(0, QHeaderView::ResizeToContents);
header()->setResizeMode(1, QHeaderView::Stretch);
header()->setResizeMode(2, QHeaderView::Stretch);
d->toolTip = new QueueToolTip(this);
d->toolTipTimer = new QTimer(this);
// -----------------------------------------------------------
connect(DatabaseAccess::databaseWatch(), SIGNAL(collectionImageChange(const CollectionImageChangeset&)),
this, SLOT(slotCollectionImageChange(const CollectionImageChangeset&)),
Qt::QueuedConnection);
connect(d->thumbLoadThread, SIGNAL(signalThumbnailLoaded(const LoadingDescription&, const QPixmap&)),
this, SLOT(slotThumbnailLoaded(const LoadingDescription&, const QPixmap&)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
this, SLOT(slotContextMenu()));
connect(d->toolTipTimer, SIGNAL(timeout()),
this, SLOT(slotToolTip()));
}
开发者ID:UIKit0,项目名称:digikam,代码行数:47,代码来源:queuelist.cpp
示例2: m_machineState
/* Constructor: */
UIVMPreviewWindow::UIVMPreviewWindow(QWidget *pParent)
: QIWithRetranslateUI<QWidget>(pParent)
, m_machineState(KMachineState_Null)
, m_pUpdateTimer(new QTimer(this))
, m_vMargin(10)
, m_pbgImage(0)
, m_pPreviewImg(0)
, m_pGlossyImg(0)
{
/* Setup contents: */
setContentsMargins(0, 5, 0, 5);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
/* Create session instance: */
m_session.createInstance(CLSID_Session);
/* Create the context menu: */
setContextMenuPolicy(Qt::DefaultContextMenu);
m_pUpdateTimerMenu = new QMenu(this);
QActionGroup *pUpdateTimeG = new QActionGroup(this);
pUpdateTimeG->setExclusive(true);
for(int i = 0; i < UpdateInterval_Max; ++i)
{
QAction *pUpdateTime = new QAction(pUpdateTimeG);
pUpdateTime->setData(i);
pUpdateTime->setCheckable(true);
pUpdateTimeG->addAction(pUpdateTime);
m_pUpdateTimerMenu->addAction(pUpdateTime);
m_actions[static_cast<UpdateInterval>(i)] = pUpdateTime;
}
m_pUpdateTimerMenu->insertSeparator(m_actions[static_cast<UpdateInterval>(UpdateInterval_500ms)]);
/* Load preview update interval: */
QString strInterval = vboxGlobal().virtualBox().GetExtraData(GUI_PreviewUpdate);
/* Parse loaded value: */
UpdateInterval interval = m_intervals.key(strInterval, UpdateInterval_1000ms);
/* Initialize with the new update interval: */
setUpdateInterval(interval, false);
/* Setup connections: */
connect(m_pUpdateTimer, SIGNAL(timeout()), this, SLOT(sltRecreatePreview()));
connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
this, SLOT(sltMachineStateChange(QString, KMachineState)));
/* Retranslate the UI */
retranslateUi();
}
开发者ID:ryenus,项目名称:vbox,代码行数:48,代码来源:UIVMPreviewWindow.cpp
示例3: DragWidget
ContextPaneWidget::ContextPaneWidget(QWidget *parent) : DragWidget(parent), m_currentWidget(0)
{
QGridLayout *layout = new QGridLayout(this);
layout->setMargin(0);
layout->setContentsMargins(1, 1, 1, 1);
layout->setSpacing(0);
m_toolButton = new QToolButton(this);
m_toolButton->setAutoRaise(false);
m_toolButton->setIcon(style()->standardIcon(QStyle::SP_DockWidgetCloseButton));
m_toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_toolButton->setFixedSize(16, 16);
m_toolButton->setToolTip(tr("Hides this toolbar."));
connect(m_toolButton, SIGNAL(clicked()), this, SLOT(onTogglePane()));
layout->addWidget(m_toolButton, 0, 0, 1, 1);
colorDialog();
QWidget *fontWidget = createFontWidget();
m_currentWidget = fontWidget;
QWidget *imageWidget = createImageWidget();
QWidget *borderImageWidget = createBorderImageWidget();
QWidget *rectangleWidget = createRectangleWidget();
QWidget *easingWidget = createEasingWidget();
layout->addWidget(fontWidget, 0, 1, 2, 1);
layout->addWidget(easingWidget, 0, 1, 2, 1);
layout->addWidget(imageWidget, 0, 1, 2, 1);
layout->addWidget(borderImageWidget, 0, 1, 2, 1);
layout->addWidget(rectangleWidget, 0, 1, 2, 1);
setAutoFillBackground(true);
setContextMenuPolicy(Qt::ActionsContextMenu);
m_resetAction = new QAction(tr("Pin Toolbar"), this);
m_resetAction->setCheckable(true);
addAction(m_resetAction.data());
connect(m_resetAction.data(), SIGNAL(triggered(bool)), this, SLOT(onResetPosition(bool)));
m_disableAction = new QAction(tr("Show Always"), this);
addAction(m_disableAction.data());
m_disableAction->setCheckable(true);
connect(m_disableAction.data(), SIGNAL(toggled(bool)), this, SLOT(onDisable(bool)));
m_pinned = false;
#ifdef Q_WS_MAC
setCursor(Qt::ArrowCursor);
#endif
}
开发者ID:pcacjr,项目名称:qt-creator,代码行数:47,代码来源:contextpanewidget.cpp
示例4: QMainWindow
MainWindow::MainWindow(const QString &defaultDisplay, QSplashScreen *splash, QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
_qpd(NULL), _kcpos(0), _defaultDisplay(defaultDisplay),
_silent(false), _allowSilent(false), _splash(splash), _settings(NULL),
_activatedEth(false), _numInstalledOS(0), _netaccess(NULL), _displayModeBox(NULL)
{
ui->setupUi(this);
setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
setContextMenuPolicy(Qt::NoContextMenu);
update_window_title();
_kc << 0x01000013 << 0x01000013 << 0x01000015 << 0x01000015 << 0x01000012
<< 0x01000014 << 0x01000012 << 0x01000014 << 0x42 << 0x41;
ui->list->setItemDelegate(new TwoIconsDelegate(this));
ui->list->installEventFilter(this);
ui->advToolBar->setVisible(false);
QRect s = QApplication::desktop()->screenGeometry();
if (s.height() < 500)
resize(s.width()-10, s.height()-100);
if (qApp->arguments().contains("-runinstaller") && !_partInited)
{
QMessageBox::warning(this,
tr("Confirm"),
tr("Warning: setting up SD card."),
QMessageBox::Yes, QMessageBox::No);
/* Repartition SD card first */
_partInited = true;
setEnabled(false);
_qpd = new QProgressDialog( tr("Setting up SD card"), QString(), 0, 0, this);
_qpd->setWindowModality(Qt::WindowModal);
_qpd->setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
InitDriveThread *idt = new InitDriveThread(this);
connect(idt, SIGNAL(statusUpdate(QString)), _qpd, SLOT(setLabelText(QString)));
connect(idt, SIGNAL(completed()), _qpd, SLOT(deleteLater()));
connect(idt, SIGNAL(error(QString)), this, SLOT(onError(QString)));
connect(idt, SIGNAL(query(QString, QString, QMessageBox::StandardButton*)),
this, SLOT(onQuery(QString, QString, QMessageBox::StandardButton*)),
Qt::BlockingQueuedConnection);
idt->start();
_qpd->exec();
setEnabled(true);
}
开发者ID:HerrickSpencerMSFT,项目名称:noobs,代码行数:47,代码来源:mainwindow.cpp
示例5: QWidget
MainWindow::MainWindow(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint |
Qt::WindowSystemMenuHint |
Qt::WindowStaysOnTopHint),
dragPosition(),
worker_thread_(NULL),
gui_update_thread_(this),
logo_rotation_timer(NULL)
{
setWindowTitle("Loudness Drop");
setMinimumSize(130, 130);
setMaximumSize(0, 0);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QAction *quitAction = new QAction(tr("E&xit"), this);
quitAction->setShortcut(tr("Ctrl+Q"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
addAction(quitAction);
setContextMenuPolicy(Qt::ActionsContextMenu);
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin(0);
layout->setSpacing(0);
render_area_ = new RenderArea;
progress_bar_ = new QProgressBar;
progress_bar_->setFixedHeight(15);
progress_bar_->setMaximum(130);
progress_bar_->setTextVisible(false);
layout->addWidget(render_area_);
layout->addWidget(progress_bar_);
setLayout(layout);
setAcceptDrops(true);
connect(&gui_update_thread_, SIGNAL(setProgressBar(int)),
this, SLOT(setProgressBar(int)));
connect(&gui_update_thread_, SIGNAL(rotateLogo()),
this, SLOT(rotateLogo()));
connect(&gui_update_thread_, SIGNAL(resetLogo()),
this, SLOT(resetLogo()));
connect(this, SIGNAL(stopGUIThread()),
&gui_update_thread_, SLOT(stopThread()));
gui_update_thread_.start();
}
开发者ID:DIT-Tools,项目名称:libebur128,代码行数:47,代码来源:scanner-drop-qt.cpp
示例6: QListView
FileSystemBrowser::FileSystemBrowser(QWidget *parent) :
QListView(parent)
{
fileSysModel = new QFileSystemModel;
fileSysModel->setFilter(QDir::AllEntries);
fileSysModel->setRootPath(QDir::currentPath());
fileSysModel->sort(0,Qt::AscendingOrder);
setModel(fileSysModel);
setRootIndex(fileSysModel->index(QDir::currentPath()));
viewport()->installEventFilter(this);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClickedItem(QModelIndex)));
connect(this,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(customMenu(QPoint)));
}
开发者ID:pussbb,项目名称:QWebDevIde,代码行数:17,代码来源:filesystembrowser.cpp
示例7: QListView
ListView::ListView(QWidget *parent)
: QListView(parent)
, eventFilter(nullptr)
, menu(nullptr)
, zoomLevel(1.0)
{
setDragEnabled(true);
setContextMenuPolicy(Qt::NoContextMenu);
setDragDropMode(QAbstractItemView::DragOnly);
setSelectionMode(QAbstractItemView::ExtendedSelection);
setAlternatingRowColors(false);
setUniformItemSizes(true);
setAttribute(Qt::WA_MouseTracking);
setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(showCustomContextMenu(const QPoint &)));
connect(this, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(checkDoubleClick(const QModelIndex &)));
}
开发者ID:CDrummond,项目名称:cantata,代码行数:17,代码来源:listview.cpp
示例8: QListView
ConditionWidget::ConditionWidget(ComplexCondition* condition, QWidget *parent) :
QListView(parent)
{
mModel = new QStandardItemModel(this);
setModel(mModel);
setEditTriggers(QAbstractItemView::NoEditTriggers);
setItemDelegate(new ConditionWidgetDelegate(this));
setCondition(condition);
setContextMenuPolicy(Qt::ActionsContextMenu);
mSelectedCondition = 0;
QAction* deleteAction = new QAction(QIcon(":/media/delete.png"), tr("Delete"), this);
deleteAction->setShortcut(QKeySequence::Delete);
deleteAction->setShortcutContext(Qt::WidgetShortcut);
addAction(deleteAction);
connect(deleteAction, SIGNAL(triggered()), this, SLOT(onDeleteTriggered()));
}
开发者ID:fr33mind,项目名称:Belle,代码行数:17,代码来源:condition_widget.cpp
示例9: QAbstractConfigurableTileWidget
QIntConfigurableTileWidget::QIntConfigurableTileWidget(Configurable* config, Configurable::paramkey& key, QMap<QGridPos, QAbstractConfigurableTileWidget*>& tileIndexConfigWidgetMap) :
QAbstractConfigurableTileWidget(config, key, tileIndexConfigWidgetMap), origBounds(config->getParamintBounds(key)), origValue(config->getParam(key)), stopSignaling(false) {
int minBound = config->getParamintBounds(key).first;
int maxBound = config->getParamintBounds(key).second;
int value = config->getParam(key);
QString key_name = QString(key.c_str());
QString toolTipName = QString(config->getParamDescr(key).c_str());
QString toolTipVals = "min=" + QString::number(minBound) + ", max=" + QString::number(maxBound);
setLayout(&gridLayoutConfigurableTile);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(sl_execContextMenu(const QPoint &)));
lName.setText(key_name);
lName.setToolTip(toolTipName);
lName.setFont(QFont("Arial Narrow", 10, QFont::Normal));
lName.setWordWrap(true);
//lName.setMaximumWidth(QAbstractConfigurableTileWidget::widgetSize.width() - 150);
spBox.setAcceptDrops(false);
spBox.setFixedWidth(80);
spBox.setMinimum(minBound);
spBox.setMaximum(maxBound);
spBox.setToolTip(toolTipVals);
spBox.setValue(value);
spBox.setSingleStep(1);
spBox.setFont(QFont("Courier", 11, QFont::Normal));
slider.setOrientation(Qt::Horizontal);
slider.setMinimum(minBound);
slider.setMaximum(maxBound);
slider.setValue(value);
slider.setToolTip(toolTipVals);
gridLayoutConfigurableTile.addWidget(&lName, 0, 0, 1, 2, Qt::AlignLeft);
gridLayoutConfigurableTile.addWidget(&spBox, 0, 2);
gridLayoutConfigurableTile.addWidget(&slider, 1, 0, 1, 3);
connect(&slider, SIGNAL(valueChanged(int)), this, SLOT(sl_sliderValueChanged(int)));
connect(&spBox, SIGNAL(valueChanged(int)), this, SLOT(sl_spinBoxValueChanged(int)));
setBackgroundRole(QPalette::Background);
setAutoFillBackground(true);
}
开发者ID:CentreForBioRobotics,项目名称:lpzrobots,代码行数:46,代码来源:QIntConfigurableTileWidget.cpp
示例10: QWidget
//! [0]
ShapedClock::ShapedClock(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint)
{
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(1000);
QAction *quitAction = new QAction(tr("E&xit"), this);
quitAction->setShortcut(tr("Ctrl+Q"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
addAction(quitAction);
setContextMenuPolicy(Qt::ActionsContextMenu);
setToolTip(tr("Drag the clock with the left mouse button.\n"
"Use the right mouse button to open a context menu."));
setWindowTitle(tr("Shaped Analog Clock"));
}
开发者ID:RSATom,项目名称:Qt,代码行数:18,代码来源:shapedclock.cpp
示例11: QTabBar
TabBar::TabBar(QWidget *parent)
: QTabBar(parent)
{
TRACE_OBJ
#ifdef Q_OS_MAC
setDocumentMode(true);
#endif
setMovable(true);
setShape(QTabBar::RoundedNorth);
setContextMenuPolicy(Qt::CustomContextMenu);
setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred,
QSizePolicy::TabWidget));
connect(this, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int)));
connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(slotTabCloseRequested(int)));
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this,
SLOT(slotCustomContextMenuRequested(QPoint)));
}
开发者ID:KDE,项目名称:android-qt,代码行数:17,代码来源:centralwidget.cpp
示例12: QScrollArea
PreviewWidget::PreviewWidget(QWidget * parent): QScrollArea(parent){
setBackgroundRole(QPalette::Base);
mCenter = ConfigManagerInterface::getInstance()->getOption("Preview/PreviewPanelCenter", true).toBool();
mFit = ConfigManagerInterface::getInstance()->getOption("Preview/PreviewPanelFit", false).toBool();
preViewer = new QLabel(this);
preViewer->setBackgroundRole(QPalette::Base);
preViewer->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
preViewer->setScaledContents(true);
preViewer->setContextMenuPolicy(Qt::CustomContextMenu);
connect(preViewer,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(contextMenu(QPoint)));
connect(this,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(contextMenu(QPoint)));
setContextMenuPolicy(Qt::CustomContextMenu);
setWidget(preViewer);
}
开发者ID:Axure,项目名称:TeXstudio,代码行数:17,代码来源:toolwidgets.cpp
示例13: QMenu
void QQuestionsTableWidget::initMenu()
{
QAction * action;
menu = new QMenu(this);
action = menu -> addAction(QIcon(":/images/plus.png"),tr("Добавить вопрос"));
action -> setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));
action -> setShortcutContext(Qt::WidgetShortcut);
connect(action,SIGNAL(triggered()),this,SLOT(addQuestionRow()));
action = menu -> addAction(QIcon(":/images/minus.png"),tr("Удалить вопрос"));
action -> setShortcut(QKeySequence(Qt::Key_Delete));
action -> setShortcutContext(Qt::WidgetShortcut);
connect(action,SIGNAL(triggered()),this,SLOT(deleteQuestionRow()));
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(menuPopUp()));
}
开发者ID:ed-soiam,项目名称:Quiz,代码行数:17,代码来源:qquestionstablewidget.cpp
示例14: QTabWidget
ReferenceManager::ReferenceManager(QWidget* parent) : QTabWidget(parent)
{
setMovable(true);
setTabsClosable(true);
mCurrentReferenceView = 0;
//Close All Tabs
mCloseAllTabs = new QPushButton(this);
mCloseAllTabs->setIcon(DIcon("close-all-tabs.png"));
mCloseAllTabs->setToolTip(tr("Close All Tabs"));
connect(mCloseAllTabs, SIGNAL(clicked()), this, SLOT(closeAllTabs()));
setCornerWidget(mCloseAllTabs, Qt::TopLeftCorner);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(Bridge::getBridge(), SIGNAL(referenceInitialize(QString)), this, SLOT(newReferenceView(QString)));
connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
}
开发者ID:bloodwrath,项目名称:x64dbg,代码行数:17,代码来源:ReferenceManager.cpp
示例15: QWebView
EmbeddedWebView::EmbeddedWebView(QWidget *parent, QNetworkAccessManager *networkManager):
QWebView(parent), m_scrollParent(0L), m_resizeInProgress(0)
{
// set to expanding, ie. "freely" - this is important so the widget will attempt to shrink below the sizehint!
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setFocusPolicy(Qt::StrongFocus); // not by the wheel
setPage(new ErrorCheckingPage(this));
page()->setNetworkAccessManager(networkManager);
QWebSettings *s = settings();
s->setAttribute(QWebSettings::JavascriptEnabled, false);
s->setAttribute(QWebSettings::JavaEnabled, false);
s->setAttribute(QWebSettings::PluginsEnabled, false);
s->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);
s->setAttribute(QWebSettings::JavaEnabled, false);
s->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, false);
s->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, false);
s->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, false);
s->clearMemoryCaches();
page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
connect(this, SIGNAL(linkClicked(QUrl)), this, SLOT(slotLinkClicked(QUrl)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(handlePageLoadFinished()));
connect(page()->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SLOT(handlePageLoadFinished()));
// Scrolling is implemented on upper layers
page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
// Setup shortcuts for standard actions
QAction *copyAction = page()->action(QWebPage::Copy);
copyAction->setShortcut(tr("Ctrl+C"));
addAction(copyAction);
// Redmine#3, the QWebView uses black text color when rendering stuff on dark background
QPalette palette = QApplication::palette();
if (palette.background().color().lightness() < 50) {
QStyle *style = QStyleFactory::create(QLatin1String("windows"));
Q_ASSERT(style);
palette = style->standardPalette();
setPalette(palette);
}
setContextMenuPolicy(Qt::NoContextMenu);
findScrollParent();
}
开发者ID:SpOOnman,项目名称:trojita,代码行数:46,代码来源:EmbeddedWebView.cpp
示例16: 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
示例17: QWidget
AudioSignal::AudioSignal(QWidget *parent): QWidget(parent)
{
const QFont& font = QWidget::font();
const int fontSize = font.pointSize() - (font.pointSize() > 10? 2 : (font.pointSize() > 8? 1 : 0));
QWidget::setFont(QFont(font.family(), fontSize));
setMinimumHeight(300);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
setMinimumWidth(fontMetrics().width("-60") + 20);
dbscale << 5 << 0 << -5 << -10 << -15 << -20 << -25 << -30 << -35 << -40 << -50 << -60;
setContextMenuPolicy(Qt::ActionsContextMenu);
m_aMonitoringEnabled = new QAction(tr("Monitor Audio Signal"), this);
m_aMonitoringEnabled->setCheckable(true);
m_aMonitoringEnabled->setChecked(true);
connect(m_aMonitoringEnabled, SIGNAL(toggled(bool)), this, SLOT(slotSwitchAudioMonitoring(bool)));
connect(&m_timer,SIGNAL(timeout()),this,SLOT(slotNoAudioTimeout()));
addAction(m_aMonitoringEnabled);
}
开发者ID:deedos,项目名称:shotcut,代码行数:17,代码来源:audiosignal.cpp
示例18: QTableView
EventGoersView::EventGoersView(DataStore *dataStore, QWidget *parent):
QTableView(parent),
dataStore(dataStore)
{
setEditTriggers(QAbstractItemView::NoEditTriggers);
eventGoersModel = new QSqlQueryModel(this);
setModel(eventGoersModel);
verticalHeader()->hide();
horizontalHeader()->setStretchLastSection(true);
setSelectionBehavior(QAbstractItemView::SelectRows);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(dataStore, SIGNAL(eventGoersModified()), this, SLOT(refresh()));
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
this, SLOT(handleContextMenuRequest(const QPoint&)));
refresh();
configHeaders();
}
开发者ID:houdekk,项目名称:UDJ,代码行数:17,代码来源:EventGoersView.cpp
示例19: QMainWindow
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, m_tabWidget(0)
, m_updater(0)
, m_fileBrowser(0)
, m_resultView(0)
, m_chartView(0)
{
setObjectName("MainWindow");
setWindowIcon(QIcon(":/Icon/Logo32x32.png"));
setMinimumSize(MIMNUM_WIDTH, MIMNUM_HEIGHT);
setContextMenuPolicy(Qt::NoContextMenu);
loadStatus();
init();
}
开发者ID:joonhwan,项目名称:monkeylogviewer,代码行数:17,代码来源:MainWindow.cpp
示例20: TreeWidget
AdBlockTreeWidget::AdBlockTreeWidget(AdBlockSubscription* subscription, QWidget* parent)
: TreeWidget(parent)
, m_subscription(subscription)
, m_topItem(0)
, m_itemChangingBlock(false)
{
setContextMenuPolicy(Qt::CustomContextMenu);
setDefaultItemShowMode(TreeWidget::ItemsExpanded);
setHeaderHidden(true);
setAlternatingRowColors(true);
setLayoutDirection(Qt::LeftToRight);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));
connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(itemChanged(QTreeWidgetItem*)));
connect(m_subscription, SIGNAL(subscriptionUpdated()), this, SLOT(subscriptionUpdated()));
connect(m_subscription, SIGNAL(subscriptionError(QString)), this, SLOT(subscriptionError(QString)));
}
开发者ID:Martii,项目名称:qupzilla,代码行数:17,代码来源:adblocktreewidget.cpp
注:本文中的setContextMenuPolicy函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论