void MusicBottomAreaWidget::createToolPopupMenu() { m_toolPopupMenu.setStyleSheet(MusicUIObject::MMenuStyle02); m_toolPopupMenu.addAction(m_ui->action_ImportSongs); m_toolPopupMenu.addAction(m_ui->action_Setting); m_toolPopupMenu.addSeparator(); m_toolPopupMenu.addAction(m_ui->action_Privious); m_toolPopupMenu.addAction(m_ui->action_Play); m_toolPopupMenu.addAction(m_ui->action_Next); m_toolPopupMenu.addSeparator(); m_toolPopupMenu.addAction(m_ui->action_OrderPlay); m_toolPopupMenu.addAction(m_ui->action_RandomPlay); m_toolPopupMenu.addAction(m_ui->action_SingleCycle); m_toolPopupMenu.addAction(m_ui->action_ListCycle); m_toolPopupMenu.addAction(m_ui->action_ItemOnce); m_toolPopupMenu.addSeparator(); m_toolPopupMenu.addAction(m_ui->action_VolumeSub); m_toolPopupMenu.addAction(m_ui->action_VolumePlus); m_toolPopupMenu.addSeparator(); m_toolPopupMenu.addAction(m_ui->action_About); m_toolPopupMenu.addAction(m_ui->action_Quit); createMenuActions(); }
// METODO LinQedinWindow::setupUI void LinQedInWindow::setupUI() { createMenuActions(); createMenus(); }
void Gui::setupUi() { onProjectNameChanged(QString(), false); setMouseTracking(true); installEventFilter(this); assert( !isFullScreen() ); //Gui::loadStyleSheet(); ///Restores position, size of the main window as well as whether it was fullscreen or not. _imp->restoreGuiGeometry(); _imp->_undoStacksGroup = new QUndoGroup; QObject::connect( _imp->_undoStacksGroup, SIGNAL(activeStackChanged(QUndoStack*)), this, SLOT(onCurrentUndoStackChanged(QUndoStack*)) ); createMenuActions(); /*CENTRAL AREA*/ //====================== _imp->_centralWidget = new QWidget(this); setCentralWidget(_imp->_centralWidget); _imp->_mainLayout = new QHBoxLayout(_imp->_centralWidget); _imp->_mainLayout->setContentsMargins(0, 0, 0, 0); _imp->_centralWidget->setLayout(_imp->_mainLayout); _imp->_leftRightSplitter = new Splitter(_imp->_centralWidget); _imp->_leftRightSplitter->setChildrenCollapsible(false); _imp->_leftRightSplitter->setObjectName(QString::fromUtf8(kMainSplitterObjectName)); _imp->_splitters.push_back(_imp->_leftRightSplitter); _imp->_leftRightSplitter->setOrientation(Qt::Horizontal); _imp->_leftRightSplitter->setContentsMargins(0, 0, 0, 0); _imp->_toolBox = new AutoHideToolBar(this, _imp->_leftRightSplitter); _imp->_toolBox->setToolButtonStyle(Qt::ToolButtonIconOnly); _imp->_toolBox->setOrientation(Qt::Vertical); _imp->_toolBox->setMaximumWidth(TO_DPIX(NATRON_TOOL_BUTTON_SIZE)); if (_imp->leftToolBarDisplayedOnHoverOnly) { _imp->refreshLeftToolBarVisibility( mapFromGlobal( QCursor::pos() ) ); } _imp->_leftRightSplitter->addWidget(_imp->_toolBox); _imp->_mainLayout->addWidget(_imp->_leftRightSplitter); _imp->createNodeGraphGui(); _imp->createCurveEditorGui(); _imp->createDopeSheetGui(); _imp->createScriptEditorGui(); _imp->createProgressPanelGui(); ///Must be absolutely called once _nodeGraphArea has been initialized. _imp->createPropertiesBinGui(); createDefaultLayoutInternal(false); _imp->_projectGui = new ProjectGui(this); _imp->_projectGui->create(_imp->_appInstance->getProject(), _imp->_layoutPropertiesBin, this); initProjectGuiKnobs(); setVisibleProjectSettingsPanel(); _imp->_aboutWindow = new AboutWindow(this, this); _imp->_aboutWindow->hide(); _imp->shortcutEditor = new ShortCutEditor(this); _imp->shortcutEditor->hide(); //the same action also clears the ofx plugins caches, they are not the same cache but are used to the same end boost::shared_ptr<Project> project = _imp->_appInstance->getProject(); QObject::connect( project.get(), SIGNAL(projectNameChanged(QString,bool)), this, SLOT(onProjectNameChanged(QString,bool)) ); boost::shared_ptr<TimeLine> timeline = project->getTimeLine(); QObject::connect( timeline.get(),SIGNAL(frameChanged(SequenceTime,int)), this,SLOT(renderViewersAndRefreshKnobsAfterTimelineTimeChange(SequenceTime,int)) ); QObject::connect( timeline.get(),SIGNAL(frameAboutToChange()), this, SLOT(onTimelineTimeAboutToChange())); /*Searches recursively for all child objects of the given object, and connects matching signals from them to slots of object that follow the following form: void on_<object name>_<signal name>(<signal parameters>); Let's assume our object has a child object of type QPushButton with the object name button1. The slot to catch the button's clicked() signal would be: void on_button1_clicked(); If object itself has a properly set object name, its own signals are also connected to its respective slots. */ QMetaObject::connectSlotsByName(this); appPTR->setOFXHostHandle(_imp->_appInstance->getOfxHostOSHandle()); } // setupUi
void Gui::wipeLayout() { std::list<TabWidgetI*> panesCpy = getApp()->getTabWidgetsSerialization(); getApp()->clearTabWidgets(); std::list<SerializableWindow*> floatingWidgets = getApp()->getFloatingWindowsSerialization(); FloatingWidget* projectFW = _imp->_projectGui->getPanel()->getFloatingWindow(); for (std::list<SerializableWindow*>::const_iterator it = floatingWidgets.begin(); it != floatingWidgets.end(); ++it) { if (!projectFW || (*it) != projectFW) { FloatingWidget* isFloating = dynamic_cast<FloatingWidget*>(*it); if (isFloating) { isFloating->deleteLater(); } } } getApp()->clearFloatingWindows(); // Re-add the project window if (projectFW) { getApp()->registerFloatingWindow(projectFW); } for (std::list<TabWidgetI*>::iterator it = panesCpy.begin(); it != panesCpy.end(); ++it) { TabWidget* pane = dynamic_cast<TabWidget*>(*it); if (!pane) { continue; } ///Conserve tabs by removing them from the tab widgets. This way they will not be deleted. while ( pane->count() > 0 ) { pane->removeTab(0, false); } //(*it)->setParent(NULL); pane->deleteLater(); } std::list<SplitterI*> splittersCpy = getApp()->getSplittersSerialization(); getApp()->clearSplitters(); for (std::list<SplitterI*>::iterator it = splittersCpy.begin(); it != splittersCpy.end(); ++it) { if (_imp->_leftRightSplitter != *it) { Splitter* isSplitter = dynamic_cast<Splitter*>(*it); if (!isSplitter) { continue; } while ( isSplitter->count() > 0 ) { isSplitter->widget(0)->setParent(NULL); } //(*it)->setParent(NULL); isSplitter->deleteLater(); } } Splitter *newSplitter = new Splitter(Qt::Horizontal,this, _imp->_centralWidget); newSplitter->addWidget(_imp->_toolBox); newSplitter->setObjectName_mt_safe( _imp->_leftRightSplitter->objectName_mt_safe() ); _imp->_mainLayout->removeWidget(_imp->_leftRightSplitter); getApp()->unregisterSplitter(_imp->_leftRightSplitter); _imp->_leftRightSplitter->deleteLater(); _imp->_leftRightSplitter = newSplitter; _imp->_leftRightSplitter->setChildrenCollapsible(false); _imp->_mainLayout->addWidget(newSplitter); getApp()->registerSplitter(newSplitter); // Re-create new menu actions createMenuActions(); } // Gui::wipeLayout
void HISMainWindow::createActions() { createMenuActions(); createToolActions(); }
// METODO ClientWindow::setupUI void ClientWindow::setupUI() { createMenuActions(); createMenus(); QWidget *centralWidget = new QWidget( this ); centralWidget->setStyleSheet( "background: #EEE" ); menuWidget->setFixedHeight( 50 ); menuWidget->setStyleSheet( "background: #069; color: white;" ); homeButton->setIcon( QIcon( QPixmap( ":/icons/icon/home.png" ) ) ); setButtonProperties( homeButton ); backButton->setIcon( QIcon( QPixmap( ":/icons/icon/arrow-left" ) ) ); setButtonProperties( backButton ); backButton->setVisible( false ); setMenuButtonProperties( profileButton ); setMenuButtonSelected( profileButton ); QWidget *middleFiller = new QWidget( menuWidget ); middleFiller->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); openSearchButton->setIcon( QIcon( QPixmap( ":/icons/icon/magnify.png" ) ) ); setButtonProperties( openSearchButton ); searchWidget->setFixedHeight( 50 ); searchWidget->setStyleSheet( "background: #069; color: white;" ); searchWidget->setVisible( false ); closeSearchButton->setIcon( QIcon( QPixmap( ":/icons/icon/close-white.png" ) ) ); setButtonProperties( closeSearchButton ); searchText->setPlaceholderText( tr( "Search" ) ); searchText->setStyleSheet( "QLineEdit { border: 1px solid white; border-top: none; border-right: none;" "border-left: none; padding: 0 10px; color: white; }" ); searchButton->setIcon( QIcon( QPixmap( ":/icons/icon/magnify.png" ) ) ); setButtonProperties( searchButton ); QHBoxLayout *searchLayout = new QHBoxLayout( searchWidget ); searchLayout->addWidget( closeSearchButton ); searchLayout->addWidget( searchText ); searchLayout->addWidget( searchButton ); searchLayout->setMargin( 0 ); QHBoxLayout* menuLayout = new QHBoxLayout( menuWidget ); menuLayout->addWidget( homeButton ); menuLayout->addWidget( backButton ); menuLayout->addSpacing( 10 ); menuLayout->addWidget( linqedinLabel ); menuLayout->addSpacing( 20 ); menuLayout->addWidget( profileButton ); menuLayout->addWidget( middleFiller ); menuLayout->addWidget( openSearchButton ); menuLayout->addWidget( searchWidget ); menuLayout->setContentsMargins( 0, 0, 0, 0 ); QWidget *contentWidget = new QWidget( scrollArea ); QWidget *contentFiller = new QWidget( contentWidget ); contentFiller->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ); contentLayout = new QVBoxLayout( contentWidget ); contentLayout->addWidget( profileWidget ); contentLayout->addWidget( contentFiller ); scrollArea->setWidget( contentWidget ); scrollArea->setWidgetResizable( true ); scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); QVBoxLayout *centralLayout = new QVBoxLayout( centralWidget ); centralLayout->addWidget( menuWidget ); centralLayout->addWidget( searchWidget ); centralLayout->addWidget( scrollArea ); centralLayout->setMargin( 0 ); centralLayout->setSpacing( 0 ); setStyleSheet( "QScrollBar:vertical { padding-left: 2px; width: 6px; }" "QScrollBar::handle:vertical { background: rgba(0,0,0,0.38); border-radius: 2px;" "min-height: 10px; }" "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { border: none; }" "QScrollBar:horizontal { padding-top: 2px; height: 6px; }" "QScrollBar::handle:horizontal { background: rgba(0,0,0,0.38); border-radius: 2px;" "min-height: 10px; }" "QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal { border: none; }" ); setCentralWidget( centralWidget ); setMinimumSize( 600, 400 ); setWindowTitle( "LinQedIn Client" ); }
bool ptToolBox::eventFilter(QObject* ASender, QEvent* AEvent) { if (ASender == FHelpIcon && AEvent->type() == QEvent::MouseButtonRelease) { QMouseEvent* e = (QMouseEvent*)AEvent; if (e->button() == Qt::LeftButton) { QDesktopServices::openUrl(QUrl(FFilter->helpUri())); return true; } else { return false; } } else if (ASender == FHeaderWidget && AEvent->type() == QEvent::MouseButtonRelease) { QMouseEvent* hEvent = (QMouseEvent*)AEvent; if (hEvent->button() == Qt::LeftButton && hEvent->modifiers() == Qt::NoModifier) { toggleFolded(); return true; } else if (hEvent->button() == Qt::LeftButton && hEvent->modifiers() == Qt::ControlModifier) { // toggle block createMenuActions(); FBlockAction->activate(QAction::Trigger); return true; } else if (hEvent->button() == Qt::RightButton) { // context menu execContextMenu(hEvent->globalPos()); return true; } else { return false; } } else { return QWidget::eventFilter(ASender, AEvent); } }