MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), m_videoWidget(new VideoWidget(this)), m_mediaObject(new CustomMediaObject()), m_audioOutput(new CustomAudioOutput(Phonon::VideoCategory)) { ui->setupUi(this); connect(m_videoWidget, SIGNAL(doubleClicked(Qt::MouseButton)), this, SLOT(videoDoubleClicked(Qt::MouseButton))); Phonon::createPath(m_mediaObject, m_audioOutput); Phonon::createPath(m_mediaObject, m_videoWidget); QVBoxLayout* videoLayout = findChild<QVBoxLayout*>("videoLayout"); if (videoLayout) { m_videoWidget->setObjectName("videoWidget"); videoLayout->insertWidget(0, m_videoWidget); QVBoxLayout* controlsLayout = findChild<QVBoxLayout*>("controlsLayout"); if (controlsLayout) { Phonon::SeekSlider* seekSlider = new Phonon::SeekSlider(m_mediaObject); seekSlider->setObjectName("seekSlider"); controlsLayout->insertWidget(0, seekSlider); } } }
void QgsOptionsDialogBase::initOptionsBase( bool restoreUi ) { // don't add to dialog margins // redefine now, or those in inherited .ui file will be added if ( layout() ) { layout()->setContentsMargins( 0, 0, 0, 0 ); // Qt default spacing } // start with copy of qgsoptionsdialog_template.ui to ensure existence of these objects mOptListWidget = findChild<QListWidget*>( "mOptionsListWidget" ); QFrame* optionsFrame = findChild<QFrame*>("mOptionsFrame"); mOptStackedWidget = findChild<QStackedWidget*>( "mOptionsStackedWidget" ); mOptSplitter = findChild<QSplitter*>( "mOptionsSplitter" ); mOptButtonBox = findChild<QDialogButtonBox*>( "buttonBox" ); QFrame* buttonBoxFrame = findChild<QFrame*>("mButtonBoxFrame"); if ( !mOptListWidget || !mOptStackedWidget || !mOptSplitter || !optionsFrame ) { return; } QSettings settings; int size = settings.value( "/IconSize", 24 ).toInt(); mOptListWidget->setIconSize( QSize(size, size) ); optionsFrame->layout()->setContentsMargins(0,3,3,3); QVBoxLayout* layout = static_cast<QVBoxLayout*>(optionsFrame->layout()); if ( buttonBoxFrame ) { buttonBoxFrame->layout()->setContentsMargins(0,0,0,0); layout->insertWidget(layout->count() + 1, buttonBoxFrame ); } else { layout->insertWidget( layout->count() + 1, mOptButtonBox ); } if ( mOptButtonBox ) { // enforce only one connection per signal, in case added in Qt Designer disconnect( mOptButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); connect( mOptButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); disconnect( mOptButtonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); connect( mOptButtonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); } connect( mOptSplitter, SIGNAL( splitterMoved( int, int ) ), this, SLOT( updateOptionsListVerticalTabs() ) ); connect( mOptStackedWidget, SIGNAL( currentChanged( int ) ), this, SLOT( optionsStackedWidget_CurrentChanged( int ) ) ); connect( mOptStackedWidget, SIGNAL( widgetRemoved( int ) ), this, SLOT( optionsStackedWidget_WidgetRemoved( int ) ) ); mInit = true; if ( restoreUi ) restoreOptionsBaseUi(); }
CloudView::CloudView(QWidget *parent) : QWidget(parent), clone_task_dialog_(NULL) { setupUi(this); // seahub_messages_monitor_ = new SeahubMessagesMonitor(this); // mSeahubMessagesBtn->setVisible(false); layout()->setContentsMargins(1, 0, 1, 0); // Setup widgets from top down setupHeader(); createAccountView(); createTabs(); // tool bar have to be created after tabs, since some of the toolbar // actions are provided by the tabs createToolBar(); setupDropArea(); setupFooter(); QVBoxLayout *vlayout = (QVBoxLayout *)layout(); vlayout->insertWidget(kIndexOfAccountView, account_view_); vlayout->insertWidget(kIndexOfToolBar, tool_bar_); vlayout->insertWidget(kIndexOfTabWidget, tabs_); resizer_ = new QSizeGrip(this); resizer_->resize(resizer_->sizeHint()); refresh_status_bar_timer_ = new QTimer(this); connect(refresh_status_bar_timer_, SIGNAL(timeout()), this, SLOT(refreshStatusBar())); AccountManager *account_mgr = seafApplet->accountManager(); connect(account_mgr, SIGNAL(accountsChanged()), this, SLOT(onAccountChanged())); #if defined(Q_OS_MAC) mHeader->setVisible(false); #endif connect(ServerStatusService::instance(), SIGNAL(serverStatusChanged()), this, SLOT(refreshServerStatus())); connect(CustomizationService::instance(), SIGNAL(serverLogoFetched(const QUrl&)), this, SLOT(onServerLogoFetched(const QUrl&))); QTimer::singleShot(0, this, SLOT(onAccountChanged())); }
bool CTimelineWidget::AddThumbnail(CThumbnailWidget *a_pThumbnail, QWidget* a_pColumn) { QVBoxLayout* pVBLayout = dynamic_cast<QVBoxLayout*>(a_pColumn->layout()); if (!pVBLayout) { return false; } if (pVBLayout->count() == 0) { pVBLayout->addWidget(a_pThumbnail); } else if (pVBLayout->count() == 1) { CThumbnailWidget* pOtherThumbnail = dynamic_cast<CThumbnailWidget*>(pVBLayout->itemAt(0)->widget()); if (pOtherThumbnail) { if (a_pThumbnail->GetPlayerID() == CMainWindow::PLAYER_1 && pOtherThumbnail->GetPlayerID() == CMainWindow::PLAYER_2) { pVBLayout->insertWidget(0, a_pThumbnail); } else if (a_pThumbnail->GetPlayerID() == CMainWindow::PLAYER_2 && pOtherThumbnail->GetPlayerID() == CMainWindow::PLAYER_1) { pVBLayout->insertWidget(1, a_pThumbnail); } else { return false; } } else { return false; } } else { return false; } if (a_pThumbnail->GetPlayerID() == CMainWindow::PLAYER_1) { pVBLayout->setAlignment(a_pThumbnail, Qt::AlignTop); } else if (a_pThumbnail->GetPlayerID() == CMainWindow::PLAYER_2) { pVBLayout->setAlignment(a_pThumbnail, Qt::AlignBottom); } else if (a_pThumbnail->GetPlayerID() == CMainWindow::BOTH_PLAYER) { pVBLayout->setAlignment(a_pThumbnail, Qt::AlignCenter); } return true; }
CloneTasksDialog::CloneTasksDialog(QWidget *parent) : QDialog(parent) { setupUi(this); setWindowTitle(tr("Download tasks")); setWindowIcon(QIcon(":/images/seafile.png")); setMinimumSize(QSize(600, 300)); createEmptyView(); table_ = new CloneTasksTableView; model_ = new CloneTasksTableModel(this); table_->setModel(model_); stack_ = new QStackedWidget; stack_->insertWidget(INDEX_EMPTY_VIEW, empty_view_); stack_->insertWidget(INDEX_TASKS_VIEW, table_); QVBoxLayout *vlayout = (QVBoxLayout *)layout(); vlayout->insertWidget(0, stack_); mClearBtn->setToolTip(tr("remove all successful tasks")); connect(mClearBtn, SIGNAL(clicked()), model_, SLOT(clearSuccessfulTasks())); onModelReset(); connect(model_, SIGNAL(modelReset()), this, SLOT(onModelReset())); }
fsirc::fsirc(QWidget *parent) : QDialog(parent) { setupUi(this); actionNewTab = new QAction (QIcon (":/fsirc/data/new.svg"), tr ("New tab"), this); actionNewTab->setToolTip (tr ("Create new tab")); ircTabHolder->addAction(actionNewTab); actionCloseTab = new QAction (QIcon (":/fsirc/data/close.svg"), tr ("Close tab"), this); actionCloseTab->setToolTip (tr ("Close current tab")); actionCloseTab->setDisabled (true); ircTabHolder->addAction(actionCloseTab); cornerButtons = new QToolBar(ircTabHolder); cornerButtons->addAction(actionNewTab); cornerButtons->addAction(actionCloseTab); QVBoxLayout *mainLayout = qobject_cast<QVBoxLayout*> (layout ()); mainLayout->insertWidget (0, cornerButtons); setWindowIcon(QIcon(":/fsirc/data/icon.svg")); ticker = new QTimer; ticker->setInterval(700); ticker->start(); initConnections(); connect(ticker, SIGNAL(timeout()), this, SLOT(checkIfTop())); trayIcon = 0; }
SplashScreen::SplashScreen( QWidget *parent /* = NULL*/ ):QDialog(parent) { setEnabled(false); setAttribute(Qt::WA_DeleteOnClose); setWindowFlags(Qt::Window | Qt::FramelessWindowHint); #ifdef Q_OS_WIN setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint); #endif setWindowModality(Qt::ApplicationModal); QHBoxLayout* mainLayout = new QHBoxLayout(); setLayout(mainLayout); setContentsMargins(0, 0, 0, 0); mainLayout->setMargin(0); QFrame *frame = new QFrame(this); mainLayout->addWidget(frame); QHBoxLayout* frameLayout = new QHBoxLayout(); frameLayout->setMargin(0); frame->setContentsMargins(0, 0, 0, 0); frame->setLayout(frameLayout); SplashScreenWidget* sWidget = new SplashScreenWidget(); QVBoxLayout* aWLayout = (QVBoxLayout*)frame->layout(); aWLayout->insertWidget(0, sWidget); aWLayout->setStretchFactor(sWidget, 100); installEventFilter(this); }
void ConfigObjectDialog::addHardwareParametersGroup(QLayout *parent) { list<SpmcPeripheral*> peripherals = object->getPeripherals(); QVBoxLayout* layout = new QVBoxLayout(); QWidget* widget = new QWidget(); QFormLayout* paramsLayout = new QFormLayout(); widget->setLayout(paramsLayout); QVBoxLayout* pinLayout = new QVBoxLayout(); for (list<SpmcPeripheral*>::iterator i = peripherals.begin(); i != peripherals.end(); i++) { if (!((*i)->getParameters().empty())) { addParameters(paramsLayout, (*i)->getParameters()); } map<string, list<PeripheralPort*> > ports = (*i)->getPorts(); for (map<string, list<PeripheralPort*> >::iterator i = ports.begin(); i != ports.end(); i++) { addPortsGroup(pinLayout, i->first, i->second); } } addGroup(layout, "Pins", pinLayout); QWidget* tpWidget = new QWidget(); QFormLayout* tpLayout = new QFormLayout(); tpWidget->setLayout(tpLayout); addParameters(tpLayout, object->getTimestampPinParameters()); pinLayout->addWidget(tpWidget); if (!paramsLayout->isEmpty()) { layout->insertWidget(0, widget); } else { widget->deleteLater(); } addGroup(parent, "Hardware Parameter", layout); }
void ChannelStripContainer::OnChannelAdded(MixerChannel* channel) { QVBoxLayout* layout = (QVBoxLayout*)this->ui->channelsContent->layout(); ChannelStripWidget* widget = new ChannelStripWidget(channel); layout->insertWidget(layout->count() - 1, widget, 0, Qt::AlignLeft); }
MainWidget::MainWidget (QWidget *parent) : QWidget (parent) , UpperBar_ (new QToolBar) , MenuGeneral_ (new QMenu (tr ("General"))) , ProxyModel_ (new SortFilterProxyModel ()) { Ui_.setupUi (this); ProxyModel_->setSourceModel (Core::Instance ().GetCLModel ()); Ui_.CLTree_->setModel (ProxyModel_); QVBoxLayout *lay = qobject_cast<QVBoxLayout*> (layout ()); lay->insertWidget (0, UpperBar_); QAction *accountsList = new QAction (tr ("Accounts..."), this); connect (accountsList, SIGNAL (triggered ()), this, SLOT (showAccountsList ())); MenuGeneral_->addAction (accountsList); UpperBar_->addAction (MenuGeneral_->menuAction ()); ActionChangeStatus_ = new QAction (tr ("Change status..."), this); connect (ActionChangeStatus_, SIGNAL (triggered ()), this, SLOT (handleChangeStatusRequested ())); }
QLostWindow::QLostWindow(QWidget *parent) : QWidget(parent) { setStyleSheet("QWinWindow { background: rgb(237,224,200); }"); setFixedSize(350,205); QVBoxLayout *mainLayout = new QVBoxLayout(); setLayout(mainLayout); QLabel *infLable = new QLabel("You lost!\n Please try again",this); infLable->setStyleSheet("QLabel { color: rgb(119,110,101); font: 20pt; font: bold;} "); mainLayout->insertWidget(0, infLable, 0, Qt::AlignCenter); button = new QPushButton("try again",this); button->setStyleSheet("QPushButton { color: rgb(119,110,101); font: 20pt; font: bold;}"); mainLayout->insertWidget(1, button, 0, Qt::AlignCenter); }
/*! * \brief sets \a hw as a header of the widget * */ void QwwTipWidget::setHeaderWidget(QWidget *hw) { Q_D(QwwTipWidget); QVBoxLayout *l = dynamic_cast<QVBoxLayout*>(layout()); if (!l) return; delete d->m_headerWidget; l->insertWidget(0, hw); d->m_headerWidget = hw; }
void MTContactDetails::on_btnAddressAdd_clicked() { QObject * pqobjSender = QObject::sender(); if (NULL != pqobjSender) { QPushButton * pBtnAdd = dynamic_cast<QPushButton *>(pqobjSender); if (m_pAddresses && (NULL != pBtnAdd)) { QVariant varContactID = pBtnAdd->property("contactid"); QVariant varMethodCombo = pBtnAdd->property("methodcombo"); QVariant varAddressEdit = pBtnAdd->property("addressedit"); int nContactID = varContactID.toInt(); QComboBox * pCombo = VPtr<QComboBox>::asPtr(varMethodCombo); QLineEdit * pAddressEdit = VPtr<QLineEdit>::asPtr(varAddressEdit); QWidget * pWidget = VPtr<QWidget>::asPtr(pBtnAdd->property("methodwidget")); if ((nContactID > 0) && (NULL != pCombo) && (NULL != pAddressEdit) && (NULL != pWidget)) { QString qstrMethodType = QString(""); QString qstrAddress = QString(""); // -------------------------------------------------- if (pCombo->currentIndex() < 0) return; // -------------------------------------------------- QVariant varMethodType = pCombo->itemData(pCombo->currentIndex()); qstrMethodType = varMethodType.toString(); if (qstrMethodType.isEmpty()) return; // -------------------------------------------------- qstrAddress = pAddressEdit->text(); if (qstrAddress.isEmpty()) return; // -------------------------------------------------- bool bAdded = MTContactHandler::getInstance()->AddMsgAddressToContact(nContactID, qstrMethodType, qstrAddress); if (bAdded) // Let's add it to the GUI, too, then. { QString qstrTypeDisplay = pCombo->currentText(); // -------------------------------------------------- QLayout * pLayout = m_pAddresses->layout(); QVBoxLayout * pVBox = (NULL == pLayout) ? NULL : dynamic_cast<QVBoxLayout *>(pLayout); if (NULL != pVBox) { QWidget * pNewWidget = this->createSingleAddressWidget(nContactID, qstrMethodType, qstrTypeDisplay, qstrAddress); if (NULL != pNewWidget) pVBox->insertWidget(pVBox->count()-1, pNewWidget); } } } } } }
ChessComponent::ChessComponent(QWidget* parent) : QWidget(parent) { scene = new QGraphicsScene(0, 0, SCENE_HEIGHT, SCENE_HEIGHT); view = new QGraphicsView(scene); QVBoxLayout* layout = new QVBoxLayout; this->setLayout(layout); layout->insertWidget(0, view); drawChessSquares(); this->selected = nullptr; }
QGameOverWindow::QGameOverWindow(QWidget *parent) : QWidget(parent) { setStyleSheet("QGameOverWindow { background: rgb(237,224,200); }"); setFixedSize(425,205); QVBoxLayout *layout = new QVBoxLayout(this); // game over label QLabel* gameover = new QLabel("Game Over!", this); gameover->setStyleSheet("QLabel { color: rgb(119,110,101); font: 40pt; font: bold;} "); // reset button reset = new QResetButton(this); reset->setFixedHeight(50); reset->setFixedWidth(100); // add game over label to window layout->insertWidget(0,gameover,0,Qt::AlignCenter); // add reset button to window layout->insertWidget(1,reset,0,Qt::AlignCenter); }
void CWizFolderSelector::setCopyStyle(bool showKeepTagsOption) { QVBoxLayout* lay = qobject_cast<QVBoxLayout*>(layout()); QCheckBox* checkKeepTime = new QCheckBox(tr("Keep create/update time"), this); checkKeepTime->setCheckState(m_bKeepTime ? Qt::Checked : Qt::Unchecked); connect(checkKeepTime, SIGNAL(stateChanged(int)), SLOT(on_checkKeepTime_stateChanged(int))); lay->insertWidget(1, checkKeepTime); if (showKeepTagsOption) { QCheckBox* checkKeepTags = new QCheckBox(tr("Keep tags"), this); checkKeepTags->setCheckState(m_bKeepTags ? Qt::Checked : Qt::Unchecked); connect(checkKeepTags, SIGNAL(stateChanged(int)), SLOT(on_checkKeepTags_stateChanged(int))); lay->insertWidget(2, checkKeepTags); } }
// NOTE: Unlike QMainWindow::addToolBar, we only allow one // fixed-size undockable menu bar at top of the dock layout. void TMainWindow::setMenuWidget(QWidget *menubar) { if (menubar) { QVBoxLayout *vlayout = static_cast<QVBoxLayout *>(layout()); // If necessary, remove current menu bar if (m_menu && m_menu != menubar) vlayout->removeWidget(m_menu); vlayout->insertWidget(0, menubar); } }
void DevicesConfigurationWidget::prependCustomWidget(RobotModelInterface &robotModel, QWidget * const widget) { if (!widget) { return; } Q_ASSERT(mRobotModelConfigurers.contains(robotModel.name())); QVBoxLayout *layout = dynamic_cast<QVBoxLayout *>(mRobotModelConfigurers[robotModel.name()]->layout()); Q_ASSERT(layout); layout->insertWidget(0, widget); }
void OsgForm::setupUserInterface() { QVBoxLayout *vbl = dynamic_cast<QVBoxLayout*>(ui->leftWidget->layout()); if (vbl) { vbl->insertWidget(0, m_viewToolBar); vbl->insertWidget(0, m_viewMenuBar); QMenu *viewmenu = new QMenu("view"); viewmenu->addAction("top"); viewmenu->addAction("front"); viewmenu->addAction("right"); m_viewMenuBar->addMenu(viewmenu); m_viewToolBar->addAction("hello"); m_viewToolBar->addAction("goodBye"); m_viewToolBar->hide(); m_viewMenuBar->hide(); } buildLayerBox(); connect(ui->osgTreeWidget, SIGNAL(currentObject(osg::ref_ptr<osg::Object>)), ui->osgPropertyTable, SLOT(displayObject(osg::ref_ptr<osg::Object>))); connect(&m_loadWatcher, SIGNAL(finished()), this, SLOT(readNodesFinished())); connect(&m_saveWatcher, SIGNAL(finished()), this, SLOT(wrieNodesFinished()) ); connect(ui->osgPropertyTable, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(itemWasChangedInTable(QTableWidgetItem*))); connect(ui->osgTreeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(itemWasChangedInTree(QTreeWidgetItem*, int))); connect(ui->cameraMaskLineEdit, SIGNAL(editingFinished()), this, SLOT(setCameraMaskFromLineEdit())); QList<int> sz; sz.append(100); for (int i=1 ; i < ui->splitterLeftRight->children().size() ; i++) sz.append(0); ui->splitterLeftRight->setSizes(sz); ui->splitter->setStretchFactor(0, 1); ui->splitter->setStretchFactor(1, 0); ui->splitter->setStretchFactor(2, 0); ui->progressBar->hide(); this->setCameraMask(ui->osg3dView->getCamera()->getCullMask()); QRegExpValidator *rev = new QRegExpValidator(QRegExp("[0-9a-fA-F]{1,8}")); ui->cameraMaskLineEdit->setValidator(rev); }
ChatForm::ChatForm(Friend* chatFriend) : f(chatFriend) , callId(0) { nameLabel->setText(f->getDisplayedName()); avatar->setPixmap(QPixmap(":/img/contact_dark.png"), Qt::transparent); statusMessageLabel = new CroppingLabel(); statusMessageLabel->setObjectName("statusLabel"); statusMessageLabel->setFont(Style::getFont(Style::Medium)); statusMessageLabel->setMinimumHeight(Style::getFont(Style::Medium).pixelSize()); isTypingLabel = new QLabel(); QFont font = isTypingLabel->font(); font.setItalic(true); font.setPixelSize(8); isTypingLabel->setFont(font); typingTimer.setSingleShot(true); QVBoxLayout* mainLayout = dynamic_cast<QVBoxLayout*>(layout()); mainLayout->insertWidget(1, isTypingLabel); netcam = new NetCamView(); timer = nullptr; headTextLayout->addWidget(statusMessageLabel); headTextLayout->addStretch(); callDuration = new QLabel(); headTextLayout->addWidget(callDuration, 1, Qt::AlignCenter); callDuration->hide(); menu.addAction(tr("Load History..."), this, SLOT(onLoadHistory())); connect(Core::getInstance(), &Core::fileSendStarted, this, &ChatForm::startFileSend); connect(sendButton, &QPushButton::clicked, this, &ChatForm::onSendTriggered); connect(fileButton, &QPushButton::clicked, this, &ChatForm::onAttachClicked); connect(callButton, &QPushButton::clicked, this, &ChatForm::onCallTriggered); connect(videoButton, &QPushButton::clicked, this, &ChatForm::onVideoCallTriggered); connect(msgEdit, &ChatTextEdit::enterPressed, this, &ChatForm::onSendTriggered); connect(msgEdit, &ChatTextEdit::textChanged, this, &ChatForm::onTextEditChanged); connect(micButton, SIGNAL(clicked()), this, SLOT(onMicMuteToggle())); connect(volButton, SIGNAL(clicked()), this, SLOT(onVolMuteToggle())); connect(chatWidget, &ChatAreaWidget::onFileTranfertInterract, this, &ChatForm::onFileTansBtnClicked); connect(Core::getInstance(), &Core::fileSendFailed, this, &ChatForm::onFileSendFailed); connect(this, SIGNAL(chatAreaCleared()), this, SLOT(clearReciepts())); connect(nameLabel, &CroppingLabel::textChanged, this, [=](QString text, QString orig) {if (text != orig) emit aliasChanged(text);} ); connect(&typingTimer, &QTimer::timeout, this, [=]{Core::getInstance()->sendTyping(f->getFriendID(), false);}); setAcceptDrops(true); }
AccountListWidget::AccountListWidget( AccountModelFactoryProxy* model, QWidget* parent ) : QWidget( parent ) , m_model( model ) { QVBoxLayout* mainLayout = new QVBoxLayout( this ); TomahawkUtils::unmarginLayout( mainLayout ); m_layout = new QVBoxLayout; TomahawkUtils::unmarginLayout( m_layout ); mainLayout->addLayout( m_layout ); mainLayout->setSpacing( 8 ); connect( m_model, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SLOT( updateEntries( QModelIndex, QModelIndex ) ) ); connect( m_model, SIGNAL( rowsInserted ( QModelIndex, int, int ) ), this, SLOT( insertEntries( QModelIndex, int, int ) ) ); connect( m_model, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( removeEntries( QModelIndex, int, int ) ) ); connect( m_model, SIGNAL( modelReset() ), this, SLOT( loadAllEntries() ) ); connect( m_model, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SLOT( updateToggleOnlineStateButton() ) ); QWidget* separatorLine = new QWidget( this ); separatorLine->setFixedHeight( 1 ); separatorLine->setContentsMargins( 0, 0, 0, 0 ); separatorLine->setStyleSheet( "QWidget { border-top: 1px solid " + TomahawkStyle::BORDER_LINE.name() + "; }" ); //from ProxyStyle mainLayout->insertWidget( 0, separatorLine ); mainLayout->addSpacing( 6 ); QLabel *connectionsLabel = new QLabel( tr( "Connections" ).toUpper(), this ); QFont clFont = connectionsLabel->font(); clFont.setBold( true ); connectionsLabel->setStyleSheet( "color: " + TomahawkStyle::GROUP_HEADER.name() ); clFont.setPointSize( TomahawkUtils::defaultFontSize() + 1 ); connectionsLabel->setFont( clFont ); connectionsLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); m_toggleOnlineButton = new QPushButton( tr( "Connect &All" ), this ); m_toggleOnlineButtonState = false; connect( m_toggleOnlineButton, SIGNAL( clicked() ), this, SLOT( toggleOnlineStateForAll() ) ); QHBoxLayout *headerLayout = new QHBoxLayout( this ); headerLayout->addWidget( connectionsLabel ); headerLayout->addSpacing( 30 ); headerLayout->addWidget( m_toggleOnlineButton ); mainLayout->insertLayout( 0, headerLayout ); updateToggleOnlineStateButton(); }
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) : SubView (id), mLayout(new QHBoxLayout), mDocument(document), mScene(NULL), mToolbar(NULL) { QVBoxLayout *layout = new QVBoxLayout; layout->setContentsMargins (QMargins (0, 0, 0, 0)); layout->addWidget (mBottom = new TableBottomBox (NullCreatorFactory(), document.getData(), document.getUndoStack(), id, this), 0); mLayout->setContentsMargins (QMargins (0, 0, 0, 0)); CSVRender::WorldspaceWidget* wordspaceWidget = NULL; widgetType whatWidget; if (id.getId()=="sys::default") { whatWidget = widget_Paged; CSVRender::PagedWorldspaceWidget *newWidget = new CSVRender::PagedWorldspaceWidget (this, document); wordspaceWidget = newWidget; makeConnections(newWidget); } else { whatWidget = widget_Unpaged; CSVRender::UnpagedWorldspaceWidget *newWidget = new CSVRender::UnpagedWorldspaceWidget (id.getId(), document, this); wordspaceWidget = newWidget; makeConnections(newWidget); } replaceToolbarAndWorldspace(wordspaceWidget, makeToolbar(wordspaceWidget, whatWidget)); layout->insertLayout (0, mLayout, 1); CSVFilter::FilterBox *filterBox = new CSVFilter::FilterBox (document.getData(), this); layout->insertWidget (0, filterBox); QWidget *widget = new QWidget; widget->setLayout (layout); setWidget (widget); }
void LXQtGroupPopup::dropEvent(QDropEvent *event) { qlonglong temp; QDataStream stream(event->mimeData()->data(LXQtTaskButton::mimeDataFormat())); stream >> temp; WId window = (WId) temp; LXQtTaskButton *button = nullptr; int oldIndex(0); // get current position of the button being dragged for (int i = 0; i < layout()->count(); i++) { LXQtTaskButton *b = qobject_cast<LXQtTaskButton*>(layout()->itemAt(i)->widget()); if (b && b->windowId() == window) { button = b; oldIndex = i; break; } } if (button == nullptr) return; int newIndex = -1; // find the new position to place it in for (int i = 0; i < oldIndex && newIndex == -1; i++) { QWidget *w = layout()->itemAt(i)->widget(); if (w && w->pos().y() + w->height() / 2 > event->pos().y()) newIndex = i; } const int size = layout()->count(); for (int i = size - 1; i > oldIndex && newIndex == -1; i--) { QWidget *w = layout()->itemAt(i)->widget(); if (w && w->pos().y() + w->height() / 2 < event->pos().y()) newIndex = i; } if (newIndex == -1 || newIndex == oldIndex) return; QVBoxLayout * l = qobject_cast<QVBoxLayout *>(layout()); l->takeAt(oldIndex); l->insertWidget(newIndex, button); l->invalidate(); }
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) : SubView (id) { QVBoxLayout *layout = new QVBoxLayout; layout->setContentsMargins (QMargins (0, 0, 0, 0)); layout->addWidget (mBottom = new TableBottomBox (NullCreatorFactory(), document.getData(), document.getUndoStack(), id, this), 0); QHBoxLayout *layout2 = new QHBoxLayout; layout2->setContentsMargins (QMargins (0, 0, 0, 0)); SceneToolbar *toolbar = new SceneToolbar (48, this); if (id.getId()=="sys::default") mScene = new CSVRender::PagedWorldspaceWidget (this); else mScene = new CSVRender::UnpagedWorldspaceWidget (id.getId(), document, this); SceneToolMode *navigationTool = mScene->makeNavigationSelector (toolbar); toolbar->addTool (navigationTool); SceneToolMode *lightingTool = mScene->makeLightingSelector (toolbar); toolbar->addTool (lightingTool); layout2->addWidget (toolbar, 0); layout2->addWidget (mScene, 1); layout->insertLayout (0, layout2, 1); CSVFilter::FilterBox *filterBox = new CSVFilter::FilterBox (document.getData(), this); layout->insertWidget (0, filterBox); QWidget *widget = new QWidget; widget->setLayout (layout); setWidget (widget); mScene->selectDefaultNavigationMode(); connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest())); }
BookmarksDialog::BookmarksDialog(QWidget *parent) : QDialog( parent ), m_ui( new Ui::BookmarksDialog ) { m_ui->setupUi(this); // Windows Mobile Window Flags setWindowFlags( windowFlags() & ( ~Qt::WindowOkButtonHint ) ); setWindowFlags( windowFlags() | Qt::WindowCancelButtonHint ); QSettings settings( "MoNavClient" ); settings.beginGroup( "Bookmarks" ); QStringList names = settings.value( "names" ).toStringList(); for ( int i = 0; i < names.size(); i++ ) { UnsignedCoordinate pos; pos.x = settings.value( QString( "%1.coordinates.x" ).arg( i ), 0 ).toUInt(); pos.y = settings.value( QString( "%1.coordinates.y" ).arg( i ), 0 ).toUInt(); m_coordinates.push_back( pos ); } m_names.setColumnCount( 1 ); for ( int i = 0; i < names.size(); i++ ) m_names.appendRow( new QStandardItem( names[i] ) ); m_chosen = -1; m_ui->bookmarkList->setModel( &m_names ); #ifdef Q_WS_MAEMO_5 setAttribute( Qt::WA_Maemo5StackedWindow ); QVBoxLayout* box = qobject_cast< QVBoxLayout* >( layout() ); assert( box != NULL ); m_ui->bookmarkList->hide(); m_valueButton = new QMaemo5ValueButton( "Bookmark", this ); m_selector = new QMaemo5ListPickSelector; m_selector->setModel( &m_names ); m_selector->setCurrentIndex( 0 ); m_valueButton->setPickSelector( m_selector ); m_valueButton->setValueLayout( QMaemo5ValueButton::ValueBesideText ); box->insertWidget( 0, m_valueButton ); m_ui->deleteButton->setEnabled( m_names.rowCount() != 0 ); m_ui->chooseButton->setEnabled( m_names.rowCount() != 0 ); #endif connectSlots(); }
void LogConfig::fill() { for (BOX_MAP::iterator it = m_boxes.begin(); it != m_boxes.end(); ++it) delete (*it).second; m_boxes.clear(); QVBoxLayout *lay = static_cast<QVBoxLayout*>(layout()); PacketType *packet; ContactList::PacketIterator it_packet; unsigned pos = 4; while ((packet = ++it_packet) != NULL){ QCheckBox *box = new QCheckBox(i18n(packet->name()), this); lay->insertWidget(pos++, box); box->setChecked(m_plugin->isLogType(packet->id())); m_boxes.insert(BOX_MAP::value_type(packet->id(), box)); } setMinimumSize(sizeHint()); }
//----------------------------------------------------------------------------- // Function: NewBusDialog::~NewBusDialog() //----------------------------------------------------------------------------- void NewBusDialog::setupLayout() { QGroupBox* signalButtonGroup = new QGroupBox(tr("Select source for logical signal generation"), this); QVBoxLayout* buttonLayout = new QVBoxLayout(signalButtonGroup); buttonLayout->addWidget(&nameSelection_); buttonLayout->addWidget(&descriptionSelection_); nameSelection_.setChecked(true); QVBoxLayout* topLayout = dynamic_cast<QVBoxLayout*>(layout()); if (topLayout) { topLayout->insertWidget(0, signalButtonGroup); } else { layout()->addWidget(signalButtonGroup); } }
RecordDialog::RecordDialog(QWidget *parent, const char *name) :QDialog(parent, name, TRUE) { QVBoxLayout *layout = new QVBoxLayout(this); QHBoxLayout *hlayout = new QHBoxLayout(this); layout->insertSpacing(0,5); output = new QMultiLineEdit(this, "output"); output->setReadOnly(true); output->setWordWrap(QMultiLineEdit::WidgetWidth); output->setText(tr("Please enter the name of the new remote, and press Next\n")); layout->insertWidget(-1, output); layout->insertSpacing(-1, 5); layout->insertLayout(-1, hlayout); layout->insertSpacing(-1, 5); hlayout->insertSpacing(0, 5); input = new QLineEdit(this, "input"); hlayout->insertWidget(-1, input, 1); hlayout->insertSpacing(-1, 5); nextbtn = new QPushButton(tr("Next"), this, "next"); nextbtn->setDefault(true); hlayout->insertWidget(-1, nextbtn); hlayout->insertSpacing(-1, 5); connect(nextbtn, SIGNAL(clicked()), this, SLOT(nextPressed()) ); setCaption(tr("Learn Remote")); input->setFocus(); stepnum = 0; outputenabled = false; writeok = true; ignorekill = false; record = new OProcess; // We need to stop lircd because irrecord accesses the IR device directly lh = new LircHandler(); lh->stopLircd(); }
//----------------------------------------------------------------------------- // Function: NewDesignPage() //----------------------------------------------------------------------------- NewDesignPage::NewDesignPage(LibraryInterface* libInterface, QWidget* parentDlg): NewPage(libInterface, VLNV::COMPONENT, tr("New HW Design"), tr("Creates a hierarchical HW design"), parentDlg), attributeEditor_(0) { // Create the attribute editor. attributeEditor_ = new KactusAttributeEditor(this); connect(attributeEditor_, SIGNAL(productHierarchyChanged()), this, SLOT(onProductHierarchyChanged())); // Create the VLNV editor. vlnvEditor_->setImplementationFilter(true, KactusAttribute::HW); // Setup the layout. QVBoxLayout* widgetLayout = dynamic_cast<QVBoxLayout*>(layout()); Q_ASSERT(widgetLayout); widgetLayout->insertWidget(3, attributeEditor_); onProductHierarchyChanged(); }
MigrateDialog::MigrateDialog(const QString &dir, const QStringList &cnvDirs) : QWizard(NULL) //: MigrateDialogBase(NULL, "migrate", true) { setupUi(this); m_dir = dir; m_cnvDirs = cnvDirs; m_bProcess = false; QVBoxLayout *lay = (QVBoxLayout*)(page1->layout()); for (QStringList::Iterator it = m_cnvDirs.begin(); it != m_cnvDirs.end(); ++it){ QCheckBox *chk = new QCheckBox(*it, page1); lay->insertWidget(1, chk); chk->show(); chk->setChecked(true); m_boxes.push_back(chk); } chkRemove->setChecked(true); connect(this, SIGNAL(selected(const QString&)), this, SLOT(pageSelected(const QString&))); button( QWizard::HelpButton )->hide(); }