bool HelpDialogBase::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: languageChange(); break; case 1: init(); break; case 2: destroy(); break; case 3: addBookmark(); break; case 4: currentBookmarkChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 5: currentIndexChanged((QListBoxItem*)static_QUType_ptr.get(_o+1)); break; case 6: currentTabChanged((const QString&)static_QUType_QString.get(_o+1)); break; case 7: loadIndexFile(); break; case 8: currentContentsChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 9: removeBookmark(); break; case 10: searchInIndex((const QString&)static_QUType_QString.get(_o+1)); break; case 11: showTopic(); break; case 12: showTopic((int)static_QUType_int.get(_o+1),(QListBoxItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break; case 13: showSearchHelp(); break; case 14: startSearch(); break; case 15: showResultPage((QListBoxItem*)static_QUType_ptr.get(_o+1)); break; case 16: showResultPage((int)static_QUType_int.get(_o+1),(QListBoxItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break; case 17: showResultPage((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break; default: return QWidget::qt_invoke( _id, _o ); } return TRUE; }
void TabbedComponent::changeCallback (const int newCurrentTabIndex, const String& newTabName) { if (panelComponent != nullptr) { panelComponent->setVisible (false); removeChildComponent (panelComponent); panelComponent = nullptr; } if (getCurrentTabIndex() >= 0) { panelComponent = getTabContentComponent (getCurrentTabIndex()); if (panelComponent != nullptr) { // do these ops as two stages instead of addAndMakeVisible() so that the // component has always got a parent when it gets the visibilityChanged() callback addChildComponent (panelComponent); panelComponent->setVisible (true); panelComponent->toFront (true); } repaint(); } resized(); currentTabChanged (newCurrentTabIndex, newTabName); }
bool AeWindow::save(int tabindex, QString location) { AeEditor* e = (AeEditor*) m_tabs->widget(tabindex); if(!e->saveFile(location)) { QMessageBox::warning(this, "Error", "Could not save to " + location); return false; } AeProject* p = AeProject::getProject(projects_, location); if(p != e->project()) { ae_debug("project was " << e->project()->displayName() << ", now " << p->displayName()); e->project()->editors_.removeOne(e); if(e->project()->editors_.length() == 0) { ae_debug("project " << e->project()->displayName() << " has no more editors, deleting it"); projects_.removeOne(e->project()); delete e->project(); } e->setProject(p); p->editors_.append(e); if(!projects_.contains(p)) projects_.append(p); } // if it was a project file, reload the settings if(location.endsWith(".aeproj")) p->parseAeproj(location); // if we're here, all went well m_tabs->tabBar()->setTabTextColor(tabindex, Qt::black); currentTabChanged(tabindex); return true; }
void TabbedButtonBar::setCurrentTabIndex (int newIndex, const bool sendChangeMessage_) { if (currentTabIndex != newIndex) { if (((unsigned int) newIndex) >= (unsigned int) tabs.size()) newIndex = -1; currentTabIndex = newIndex; for (int i = 0; i < getNumChildComponents(); ++i) { TabBarButton* const tb = dynamic_cast <TabBarButton*> (getChildComponent (i)); if (tb != 0) tb->setToggleState (tb->tabIndex == newIndex, false); } resized(); if (sendChangeMessage_) sendChangeMessage (this); currentTabChanged (newIndex, newIndex >= 0 ? tabs [newIndex] : String::empty); } }
void WareSrcWidgetCollection::onCurrentTabChanged(int Index) { if (WareSrcWidget* Ware = qobject_cast<WareSrcWidget*>(mp_TabWidget->widget(Index))) { QString FilePath = Ware->getCurrentFilePath(); emit currentTabChanged(FilePath.isEmpty() ? Ware->wareSrcContainer().getAbsolutePath() : FilePath); } checkModifiedStatus(); }
void shouldNotChangeCurrentTabWhenAddingUnlessModelWasEmpty() { QSignalSpy spy(model, SIGNAL(currentTabChanged())); QQuickItem* tab = createTab(); model->add(tab); QCOMPARE(spy.count(), 1); QCOMPARE(model->currentTab(), tab); spy.clear(); model->add(createTab()); QVERIFY(spy.isEmpty()); QCOMPARE(model->currentTab(), tab); }
void shouldUpdateCurrentTabWhenSettingCurrent() { QQuickItem* tab1 = createTab(); model->add(tab1); QSignalSpy spy(model, SIGNAL(currentTabChanged())); model->setCurrent(0); QVERIFY(spy.isEmpty()); QCOMPARE(model->currentTab(), tab1); QQuickItem* tab2 = createTab(); model->add(tab2); model->setCurrent(1); QCOMPARE(spy.count(), 1); QCOMPARE(model->currentTab(), tab2); }
void DeclarativeTabModel::setCurrentTab(DeclarativeTab *currentTab) { if (currentTab != m_currentTab) { if (m_currentTab) { m_currentTab->disconnect(this); } m_currentTab = currentTab; if (m_currentTab) { connect(m_currentTab, SIGNAL(thumbPathChanged(QString,int)), this, SLOT(updateThumbPath(QString,int))); } emit currentTabChanged(); } }
void TabbedButtonBar::setCurrentTabIndex (int newIndex, const bool sendChangeMessage_) { if (currentTabIndex != newIndex) { if (! isPositiveAndBelow (newIndex, tabs.size())) newIndex = -1; currentTabIndex = newIndex; for (int i = 0; i < tabs.size(); ++i) { TabBarButton* tb = tabs.getUnchecked(i)->component; tb->setToggleState (i == newIndex, false); } resized(); if (sendChangeMessage_) sendChangeMessage(); currentTabChanged (newIndex, getCurrentTabName()); } }
bool HelpDialog::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: showTopic((int)static_QUType_int.get(_o+1),(QListBoxItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break; case 1: showTopic((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break; case 2: showTopic((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 3: loadIndexFile(); break; case 4: insertContents(); break; case 5: setupFullTextIndex(); break; case 6: currentTabChanged((const QString&)static_QUType_QString.get(_o+1)); break; case 7: currentIndexChanged((QListBoxItem*)static_QUType_ptr.get(_o+1)); break; case 8: showTopic(); break; case 9: searchInIndex((const QString&)static_QUType_QString.get(_o+1)); break; case 10: addBookmark(); break; case 11: removeBookmark(); break; case 12: currentBookmarkChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 13: currentContentsChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 14: startSearch(); break; case 15: showSearchHelp(); break; case 16: initialize(); break; case 17: toggleContents(); break; case 18: toggleIndex(); break; case 19: toggleBookmarks(); break; case 20: toggleSearch(); break; case 21: lastWinClosed(); break; case 22: showResultPage((int)static_QUType_int.get(_o+1),(QListBoxItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break; case 23: showResultPage((QListBoxItem*)static_QUType_ptr.get(_o+1)); break; case 24: setIndexingProgress((int)static_QUType_int.get(_o+1)); break; case 25: showItemMenu((QListBoxItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break; case 26: showItemMenu((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break; case 27: insertBookmarks(); break; case 28: processEvents(); break; default: return HelpDialogBase::qt_invoke( _id, _o ); } return TRUE; }
void shouldUpdateCurrentTabWhenRemoving() { QSignalSpy spy(model, SIGNAL(currentTabChanged())); // Adding a tab to an empty model should update the current tab. // Removing the last tab from the model should update it too. model->add(createTab()); delete model->remove(0); QCOMPARE(spy.count(), 2); // When removing a tab after the current one, // the current tab shouldn’t change. QQuickItem* tab1 = createTab(); model->add(tab1); model->add(createTab()); spy.clear(); delete model->remove(1); QCOMPARE(model->currentTab(), tab1); QVERIFY(spy.isEmpty()); // When removing the current tab, if there is a tab after it, // it becomes the current one. QQuickItem* tab2 = createTab(); model->add(tab2); spy.clear(); delete model->remove(0); QCOMPARE(spy.count(), 1); QCOMPARE(model->currentTab(), tab2); // When removing the current tab, if it was the last one, the // current tab should be reset to 0. spy.clear(); delete model->remove(0); QCOMPARE(spy.count(), 1); QCOMPARE(model->currentTab(), (QObject*) 0); }
RObjectViewer::RObjectViewer (QWidget *parent, RObject *object, ViewerPage initial_page) : RKMDIWindow (parent, RKMDIWindow::ObjectWindow, false), RObjectListener (RObjectListener::ObjectView) { RK_TRACE (APP); RK_ASSERT (object); _object = object; addNotificationType (RObjectListener::ObjectRemoved); addNotificationType (RObjectListener::MetaChanged); addNotificationType (RObjectListener::DataChanged); listenForObject (_object); QVBoxLayout *layout = new QVBoxLayout (this); layout->setContentsMargins (0, 0, 0, 0); description_label = new QLabel (this); description_label->setWordWrap (true); layout->addWidget (description_label); status_label = new QLabel (this); status_label->hide (); layout->addWidget (status_label); tabs = new QTabWidget (this); tabs->insertTab (SummaryPage, summary_widget = new RObjectSummaryWidget (tabs, object), i18n ("summary (x)")); tabs->insertTab (PrintPage, print_widget = new RObjectPrintWidget (tabs, object), i18n ("print (x)")); tabs->insertTab (StructurePage, structure_widget = new RObjectStructureWidget (tabs, object), i18n ("str (x)")); layout->addWidget (tabs); tabs->setFocusPolicy (Qt::StrongFocus); setPart (new RKDummyPart (this, tabs)); initializeActivationSignals (); tabs->setCurrentIndex (initial_page); currentTabChanged (initial_page); connect (tabs, SIGNAL (currentChanged(int)), this, SLOT (currentTabChanged (int))); initDescription (false); }
TabSwitcherWidget::TabSwitcherWidget(WindowsManager *manager, QWidget *parent) : QWidget(parent), m_windowsManager(manager), m_model(new QStandardItemModel(this)), m_frame(new QFrame(this)), m_tabsView(new QListView(m_frame)), m_previewLabel(new QLabel(m_frame)), m_loadingMovie(NULL), m_reason(KeyboardReason) { QHBoxLayout *mainLayout = new QHBoxLayout(this); mainLayout->addWidget(m_frame, 0, Qt::AlignCenter); setLayout(mainLayout); setAutoFillBackground(false); QHBoxLayout *frameLayout = new QHBoxLayout(m_frame); frameLayout->addWidget(m_tabsView, 1); frameLayout->addWidget(m_previewLabel, 0, Qt::AlignCenter); m_frame->setLayout(frameLayout); m_frame->setAutoFillBackground(true); m_frame->setMinimumWidth(600); m_frame->setObjectName(QLatin1String("tabSwitcher")); m_frame->setStyleSheet(QStringLiteral("#tabSwitcher {background:%1;border:1px solid #B3B3B3;border-radius:4px;}").arg(palette().color(QPalette::Base).name())); m_tabsView->setModel(m_model); m_tabsView->setItemDelegate(new AddressDelegate(false, m_tabsView)); m_tabsView->setEditTriggers(QAbstractItemView::NoEditTriggers); m_tabsView->setGridSize(QSize(200, 22)); m_tabsView->setIconSize(QSize(22, 22)); m_tabsView->setStyleSheet(QLatin1String("border:0;")); m_tabsView->viewport()->installEventFilter(this); m_previewLabel->setFixedSize(260, 170); m_previewLabel->setAlignment(Qt::AlignCenter); m_previewLabel->setStyleSheet(QLatin1String("border:1px solid gray;")); connect(m_tabsView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentTabChanged(QModelIndex))); }
void toTabWidget::tabChanged(int index) { QWidget *widget = QTabWidget::widget(index); if (widget) emit currentTabChanged(widget); }
EditAccount::EditAccount( QWidget* parent, const char* name, Qt::WFlags fl ) : QDialog(parent, fl) , account(0) , accountNameInput(new QLineEdit) { setupUi(this); setObjectName(name); //connect custom slots connect(setSignatureButton,SIGNAL(clicked()),SLOT(sigPressed())); connect(accountType,SIGNAL(currentIndexChanged(int)),SLOT(typeChanged(int))); connect(authentication,SIGNAL(currentIndexChanged(int)),SLOT(authChanged(int))); connect(emailInput,SIGNAL(textChanged(QString)),SLOT(emailModified())); connect(pushCheckBox,SIGNAL(stateChanged(int)),SLOT(pushCheckChanged(int))); connect(intervalCheckBox,SIGNAL(stateChanged(int)),SLOT(intervalCheckChanged(int))); // this functionality is not currently used //connect(mailboxButton,SIGNAL(clicked()),SLOT(configureFolders())); mailboxButton->hide(); emailTyped = false; QtopiaApplication::setInputMethodHint(mailPortInput, QtopiaApplication::Number); QtopiaApplication::setInputMethodHint(smtpPortInput, QtopiaApplication::Number); const QString uncapitalised("email noautocapitalization"); // These fields should not be autocapitalised QtopiaApplication::setInputMethodHint(mailUserInput, QtopiaApplication::Named, uncapitalised); QtopiaApplication::setInputMethodHint(mailServerInput, QtopiaApplication::Named, uncapitalised); QtopiaApplication::setInputMethodHint(emailInput, QtopiaApplication::Named, uncapitalised); QtopiaApplication::setInputMethodHint(smtpUsernameInput, QtopiaApplication::Named, uncapitalised); QtopiaApplication::setInputMethodHint(smtpServerInput, QtopiaApplication::Named, uncapitalised); // Too easy to mistype numbers in phone mode mailPasswInput->installEventFilter( this ); accountNameInput->installEventFilter( this ); defaultMailCheckBox->installEventFilter( this ); PortValidator *pv = new PortValidator(this); mailPortInput->setValidator(pv); smtpPortInput->setValidator(pv); mailPasswInput->setEchoMode(QLineEdit::PasswordEchoOnEdit); #ifdef QT_NO_OPENSSL encryption->hide(); lblEncryption->hide(); authentication->hide(); lblAuthentication->hide(); smtpUsernameInput->hide(); lblSmtpUsername->hide(); smtpPasswordInput->hide(); lblSmtpPassword->hide(); encryptionIncoming->hide(); lblEncryptionIncoming->hide(); #else authentication->addItem("INCOMING"); // notr smtpPasswordInput->setEchoMode(QLineEdit::PasswordEchoOnEdit); #endif typeChanged(1); createTabbedView(); setLayoutDirection( qApp->layoutDirection() ); currentTabChanged(0); }