void OutlinePalette::slotRightClick(QPoint point) { if (!m_MainWindow || m_MainWindow->scriptIsRunning()) return; QTreeWidgetItem *ite = reportDisplay->itemAt(point); if (ite == NULL) return; if (!ite->isSelected()) slotMultiSelect(); OutlineTreeItem *item = (OutlineTreeItem*)ite; if (item != NULL) { if ((item->type == 0) || (item->type == 2)) createContextMenu(NULL, point.x(), point.y()); else if ((item->type == 1) || (item->type == 3) || (item->type == 4)) { PageItem *currItem = item->PageItemObject; if (currItem!=NULL) { currentObject = ite; createContextMenu(currItem, point.x(), point.y()); } } } }
BookmarksManager::BookmarksManager(BrowserWindow* window, QWidget* parent) : QWidget(parent) , ui(new Ui::BookmarksManager) , m_window(window) , m_bookmarks(mApp->bookmarks()) , m_selectedBookmark(0) , m_blockDescriptionChangedSignal(false) , m_adjustHeaderSizesOnShow(true) { ui->setupUi(this); ui->tree->setViewType(BookmarksTreeView::BookmarksManagerViewType); connect(ui->tree, SIGNAL(bookmarkActivated(BookmarkItem*)), this, SLOT(bookmarkActivated(BookmarkItem*))); connect(ui->tree, SIGNAL(bookmarkCtrlActivated(BookmarkItem*)), this, SLOT(bookmarkCtrlActivated(BookmarkItem*))); connect(ui->tree, SIGNAL(bookmarkShiftActivated(BookmarkItem*)), this, SLOT(bookmarkShiftActivated(BookmarkItem*))); connect(ui->tree, SIGNAL(bookmarksSelected(QList<BookmarkItem*>)), this, SLOT(bookmarksSelected(QList<BookmarkItem*>))); connect(ui->tree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint))); // Box for editing bookmarks updateEditBox(0); connect(ui->title, SIGNAL(textEdited(QString)), this, SLOT(bookmarkEdited())); connect(ui->address, SIGNAL(textEdited(QString)), this, SLOT(bookmarkEdited())); connect(ui->keyword, SIGNAL(textEdited(QString)), this, SLOT(bookmarkEdited())); connect(ui->description, SIGNAL(textChanged()), this, SLOT(descriptionEdited())); }
void chanFileSystemDockWidget::init() { createWidgets(); createContextMenu(); createFileSystemTree(); createRoot(); }
SyncErrorsTableView::SyncErrorsTableView(QWidget *parent) : QTableView(parent) { verticalHeader()->hide(); verticalHeader()->setDefaultSectionSize(36); horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); horizontalHeader()->setStretchLastSection(true); horizontalHeader()->setCascadingSectionResizes(true); horizontalHeader()->setHighlightSections(false); horizontalHeader()->setDefaultAlignment(Qt::AlignLeft | Qt::AlignVCenter); setGridStyle(Qt::NoPen); setShowGrid(false); setContentsMargins(0, 0, 0, 0); setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); setSelectionBehavior(QAbstractItemView::SelectRows); setSelectionMode(QAbstractItemView::ExtendedSelection); setMouseTracking(true); createContextMenu(); connect(this, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(onItemDoubleClicked(const QModelIndex&))); }
/*" + gaycolor.red() + "," + gaycolor.green() + "," + gaycolor.blue() + "*/ PluginGeneratorGUI::PluginGeneratorGUI(PluginManager& pman,QWidget* parent ) :QDockWidget(parent),plugscriptname(),author(),mail(),init(false),finfo(QApplication::applicationDirPath()),doc(NULL),PM(pman) { QFrame* f = new QFrame(this); QGridLayout* lay = new QGridLayout(); tabs = new QTabWidget(this); tabs->setUsesScrollButtons(true); //setWidget(tabs); int openedtabs = tabs->count(); if (openedtabs == 0) addNewFilter(); else { if (openedtabs > 1) for (int ii = 1;ii < openedtabs;++ii) tabs->removeTab(ii); addNewFilter(); } lay->addWidget(tabs); lay->setAlignment(Qt::AlignVCenter); f->setLayout(lay); setWidget(f); createContextMenu(); this->setVisible(false); //this->setScroll }
ByteViewText::ByteViewText(const QByteArray &data, packet_char_enc encoding, QWidget *parent) : QAbstractScrollArea(parent), layout_(new QTextLayout()), data_(data), encoding_(encoding), hovered_byte_offset_(-1), marked_byte_offset_(-1), proto_start_(0), proto_len_(0), field_start_(0), field_len_(0), field_a_start_(0), field_a_len_(0), show_offset_(true), show_hex_(true), show_ascii_(true), row_width_(recent.gui_bytes_view == BYTES_HEX ? 16 : 8), font_width_(0), line_height_(0) { layout_->setCacheEnabled(true); offset_normal_fg_ = ColorUtils::alphaBlend(palette().windowText(), palette().window(), 0.35); offset_field_fg_ = ColorUtils::alphaBlend(palette().windowText(), palette().window(), 0.65); createContextMenu(); setMouseTracking(true); #ifdef Q_OS_MAC setAttribute(Qt::WA_MacShowFocusRect, true); #endif }
MainWindow::MainWindow() :documents() { tabWidget = new QTabWidget(this); tabWidget -> setTabsClosable(true); tabWidget -> setUsesScrollButtons(true); tabWidget -> setDocumentMode(true); connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int))); connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); setCentralWidget(tabWidget); createActions(); createMenus(); createContextMenu(0); createToolBars(); createStatusBar(); readSettings(); findDialog = 0; setWindowIcon(QIcon(":/images/pics/ss.png")); setCurrentFile(""); //test setWindowModified(true); setCurrentFile(tr("data.sp")); setCurrentFile(tr("money.sp")); setCurrentFile(tr("students.sp")); setCurrentFile(tr("teachers.sp")); setCurrentFile(tr("total.sp")); }
SeafileTrayIcon::SeafileTrayIcon(QObject *parent) : QSystemTrayIcon(parent), nth_trayicon_(0), rotate_counter_(0) { setToolTip(SEAFILE_CLIENT_BRAND); setState(STATE_DAEMON_DOWN); rotate_timer_ = new QTimer(this); connect(rotate_timer_, SIGNAL(timeout()), this, SLOT(rotateTrayIcon())); refresh_timer_ = new QTimer(this); connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIcon())); createActions(); createContextMenu(); connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(onActivated(QSystemTrayIcon::ActivationReason))); hide(); #if defined(Q_WS_MAC) tnm = new TrayNotificationManager(this); #endif }
/** Default Constructor * * The parent parameter is not needed here unlike in the * dialogs because the main window doesn't have a parrent. * how sad... * */ MainWindow::MainWindow() { /* Create a spreadsheet widget which will be implimented * in chapter 4 of the book. It is then set as the central * widget of the main window. * */ spreadsheet = new Spreadsheet; setCentralWidget(spreadsheet); /* These functions set up the rest of the main window */ createActions(); createMenus(); createContextMenu(); createToolBar(); createStatusBar(); /* Read the application's saved settings */ readSettings(); /* Not created as an object yet just as a NULL pointer for now */ findDialog = 0; /* Set the icon at the top of the window. this is platform independent * unfortunately there is no platform independent way of setting the * desktop icon. :( * * to refer to resources define in the pro file we use ':/' as * demonstrated below. More in Ch 12 in book. * */ setWindowIcon(QIcon(":/images/icon.png")); setCurrentFile(""); }
SeafileTrayIcon::SeafileTrayIcon(QObject *parent) : QSystemTrayIcon(parent), nth_trayicon_(0), rotate_counter_(0) { setState(STATE_DAEMON_DOWN); rotate_timer_ = new QTimer(this); connect(rotate_timer_, SIGNAL(timeout()), this, SLOT(rotateTrayIcon())); refresh_timer_ = new QTimer(this); connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIcon())); createActions(); createContextMenu(); connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(onActivated(QSystemTrayIcon::ActivationReason))); connect(SeahubNotificationsMonitor::instance(), SIGNAL(notificationsChanged()), this, SLOT(onSeahubNotificationsChanged())); hide(); #if defined(Q_WS_MAC) tnm = new TrayNotificationManager(this); #endif }
SeafileTrayIcon::SeafileTrayIcon(QObject *parent) : QSystemTrayIcon(parent), nth_trayicon_(0), rotate_counter_(0), state_(STATE_DAEMON_UP) { setState(STATE_DAEMON_DOWN); rotate_timer_ = new QTimer(this); connect(rotate_timer_, SIGNAL(timeout()), this, SLOT(rotateTrayIcon())); refresh_timer_ = new QTimer(this); connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIcon())); connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIconToolTip())); createActions(); createContextMenu(); connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(onActivated(QSystemTrayIcon::ActivationReason))); connect(SeahubNotificationsMonitor::instance(), SIGNAL(notificationsChanged()), this, SLOT(onSeahubNotificationsChanged())); #if defined(Q_OS_WIN32) || (defined(Q_OS_MAC) && (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))) connect(this, SIGNAL(messageClicked()), this, SLOT(onMessageClicked())); #endif hide(); createGlobalMenuBar(); #if defined(Q_OS_MAC) tnm = new TrayNotificationManager(this); #endif }
lmcMessageLog::lmcMessageLog(QWidget *parent) : QWebView(parent) { connect(this, SIGNAL(linkClicked(QUrl)), this, SLOT(log_linkClicked(QUrl))); connect(this->page()->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SLOT(log_contentsSizeChanged(QSize))); connect(this->page(), SIGNAL(linkHovered(QString, QString, QString)), this, SLOT(log_linkHovered(QString, QString, QString))); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); setRenderHints(QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform); createContextMenu(); participantAvatars.clear(); hasData = false; messageTime = false; messageDate = false; allowLinks = false; pathToLink = false; trimMessage = true; fontSizeVal = 0; sendFileMap.clear(); receiveFileMap.clear(); lastId = QString::null; messageLog.clear(); linkHovered = false; outStyle = false; autoScroll = true; }
void WebContextMenuProxyQt::showContextMenu(const IntPoint& position, const Vector<WebContextMenuItemData>& items) { if (QMenu* menu = createContextMenu(items)) { menu->move(position); emit m_page->showContextMenu(menu); } }
void ContextMenuController::handleContextMenuEvent(Event* event) { m_contextMenu = createContextMenu(event); if (!m_contextMenu) return; showContextMenu(event); }
void MusicLrcSearchTableWidget::contextMenuEvent(QContextMenuEvent *event) { MusicQueryTableWidget::contextMenuEvent(event); QMenu rightClickMenu(this); createContextMenu(rightClickMenu); rightClickMenu.exec(QCursor::pos()); }
void BatDown::init() { createActions(); createMenus(); createContextMenu(); createToolBars(); createStatusBar(); createCentralArea(); }
void ContextMenuController::handleContextMenuEvent(Event* event) { m_contextMenu.set(createContextMenu(event)); if (!m_contextMenu) return; m_contextMenu->populate(); showContextMenu(event); }
MapViewContextMenu::MapViewContextMenu(MapView* map_view) { map_view_ = map_view; createContextMenu(); // create publisher for augmentations on the grid map augment_grid_map_pub_ = nh_.advertise<vigir_ocs_msgs::OCSAugmentRegions>( "/flor/worldmodel/ocs_augmented_regions", 1, false ); }
XlLabelDisplay::XlLabelDisplay(QWidget *parent) : QLabel(parent) { this->saveAction = new QAction("&Save", this); this->tempPath = ""; connect(this->saveAction, SIGNAL(triggered()), this, SLOT(saveImageLocally())); createContextMenu(); }
void TreeWidget::contextMenuEvent(QContextMenuEvent* event) { TreeItem* item = static_cast<TreeItem*>(itemAt(event->pos())); if (item) { QMenu* menu = createContextMenu(item); menu->exec(event->globalPos()); delete menu; } }
// --------------------------------------------------------------------------- void init_NowPlaying() { NowPlaying_ShowMenu = 0; menu_now_playing = NULL; NowPlaying_Sel = 0; NowPlaying_ScrollOffset = 0; NowPlaying_ScrollDir = 1; createContextMenu(); }
MainWindow::MainWindow() { createWidgets(); createActions(); createMenus(); createContextMenu(); createToolBars(); createStatusBar(); }
void LocationBar::contextMenuEvent(QContextMenuEvent* event) { QMenu* menu = createContextMenu(); menu->setAttribute(Qt::WA_DeleteOnClose); // Prevent choosing first option with double rightclick QPoint pos = event->globalPos(); pos.setY(pos.y() + 1); menu->popup(pos); }
void SGSelectionTool::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { if (QSGItem *item = inspector()->topVisibleItemAt(event->pos())) inspector()->setSelectedItems(QList<QSGItem*>() << item); } else if (event->button() == Qt::RightButton) { QList<QSGItem*> items = inspector()->itemsAt(event->pos()); createContextMenu(items, event->globalPos()); } }
void ListView::contextMenuEvent(QContextMenuEvent* event) { QModelIndex index = indexAt(event->pos()); if (index.isValid()) { QMenu* menu = createContextMenu(index); menu->exec(event->globalPos()); delete menu; } event->accept(); }
GraphView::GraphView(GraphScene *scene, QWidget *parent) : QGraphicsView(scene, parent), m_temp(NULL), m_model(NULL), m_changingLinkMode(false), m_menu(new QMenu(this)) { setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); createContextMenu(); }
FrameLabel::FrameLabel(QWidget *parent) : QLabel(parent) { startPoint.setX(0); startPoint.setY(0); mouseCursorPos.setX(0); mouseCursorPos.setY(0); drawBox=false; mouseData.leftButtonRelease=false; mouseData.rightButtonRelease=false; createContextMenu(); }
CloneTasksTableView::CloneTasksTableView(QWidget *parent) : QTableView(parent) { setHorizontalHeader(new CloneTasksTableHeader(this)); setSelectionBehavior(QAbstractItemView::SelectRows); verticalHeader()->hide(); horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); createContextMenu(); }
MainWindow::MainWindow() : filename_(), default_extent_(-20037508.3428,-20037508.3428,20037508.3428,20037508.3428) { mapWidget_ = new MapWidget(this); QSplitter *splitter = new QSplitter(this); QTabWidget *tabWidget=new QTabWidget; layerTab_ = new LayerTab; layerTab_->setFocusPolicy(Qt::NoFocus); layerTab_->setIconSize(QSize(16,16)); //LayerDelegate *delegate = new LayerDelegate(this); //layerTab_->setItemDelegate(delegate); //layerTab_->setItemDelegate(new QItemDelegate(this)); //layerTab_->setViewMode(QListView::IconMode); layerTab_->setFlow(QListView::TopToBottom); tabWidget->addTab(layerTab_,tr("Layers")); // Styles tab styleTab_ = new StyleTab; tabWidget->addTab(styleTab_,tr("Styles")); splitter->addWidget(tabWidget); splitter->addWidget(mapWidget_); QList<int> list; list.push_back(200); list.push_back(600); splitter->setSizes(list); mapWidget_->setFocusPolicy(Qt::StrongFocus); mapWidget_->setFocus(); //setCentralWidget(mapWidget_); setCentralWidget(splitter); createActions(); createMenus(); createToolBars(); createContextMenu(); setWindowTitle(tr("Mapnik Viewer")); status=new QStatusBar(this); status->showMessage(tr("")); setStatusBar(status); resize(800,600); //connect mapview to layerlist connect(mapWidget_, SIGNAL(mapViewChanged()),layerTab_, SLOT(update())); // slider connect(slider_,SIGNAL(valueChanged(int)),mapWidget_,SLOT(zoomToLevel(int))); // connect(layerTab_,SIGNAL(update_mapwidget()),mapWidget_,SLOT(updateMap())); connect(layerTab_,SIGNAL(layerSelected(int)), mapWidget_,SLOT(layerSelected(int))); }
GLRenderWidget::GLRenderWidget(QWidget *_parent, const QGLWidget *_shareWidget, Qt::WindowFlags _flags) : QGLWidget(_parent, _shareWidget, _flags), mPauseTexture(0), mPausePlayback(false) { setFocusPolicy(Qt::WheelFocus); createContextMenu(); setMinimumSize(100,100); setBackgroundRole(QPalette::Dark); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); init(); }