void QmaxButton::mouseReleaseEvent(QMouseEvent *e) { Q_UNUSED(e); m_nPressed=0; refreshButton(); emit clicked(this->m_nUserCode); }
KCustomMenuEditor::KCustomMenuEditor(QWidget *parent) : KDialogBase(parent, "custommenueditor", true, i18n("Menu Editor"), Ok|Cancel, Ok, true), m_listView(0) { d = new KCustomMenuEditorPrivate; QHBox *page = makeHBoxMainWidget(); m_listView = new KListView(page); m_listView->addColumn(i18n("Menu")); m_listView->setFullWidth(true); m_listView->setSorting(-1); KButtonBox *buttonBox = new KButtonBox(page, Vertical); buttonBox->addButton(i18n("New..."), this, SLOT(slotNewItem())); d->pbRemove=buttonBox->addButton(i18n("Remove"), this, SLOT(slotRemoveItem())); d->pbMoveUp=buttonBox->addButton(i18n("Move Up"), this, SLOT(slotMoveUp())); d->pbMoveDown=buttonBox->addButton(i18n("Move Down"), this, SLOT(slotMoveDown())); buttonBox->layout(); connect( m_listView, SIGNAL( selectionChanged () ), this, SLOT( refreshButton() ) ); refreshButton(); }
void KCustomMenuEditor::slotRemoveItem() { QListViewItem *item = m_listView->currentItem(); if (!item) return; delete item; refreshButton(); }
void KCustomMenuEditor::slotMoveDown() { QListViewItem *item = m_listView->currentItem(); if (!item) return; QListViewItem *after = item->nextSibling(); if (!after) return; item->moveItem( after ); refreshButton(); }
void SharedMediaWidget::notifyPeerUpdated(const Notify::PeerUpdate &update) { if (update.peer != peer() && (!_migrated || update.peer != _migrated->peer)) { return; } bool updated = false; for (int i = 0; i < OverviewCount; ++i) { if (update.mediaTypesMask & (1 << i)) { refreshButton(static_cast<MediaOverviewType>(i)); updated = true; } } if (updated) { refreshVisibility(); contentSizeUpdated(); } }
void KCustomMenuEditor::slotNewItem() { QListViewItem *item = m_listView->currentItem(); KOpenWithDlg dlg(this); dlg.setSaveNewApplications(true); if (dlg.exec()) { KService::Ptr s = dlg.service(); if (s && s->isValid()) { Item *newItem = new Item(m_listView, s); newItem->moveItem(item); } refreshButton(); } }
void KCustomMenuEditor::slotMoveUp() { QListViewItem *item = m_listView->currentItem(); if (!item) return; QListViewItem *searchItem = m_listView->firstChild(); while(searchItem) { QListViewItem *next = searchItem->nextSibling(); if (next == item) { searchItem->moveItem(item); break; } searchItem = next; } refreshButton(); }
void LLFloaterEditUI::refreshCore() { LLView* view = LLView::sEditingUIView; LLRect r = view->getRect(); F32 width = (F32)r.getWidth(); F32 height = (F32)r.getHeight(); mWidthSpin->set(width); mHeightSpin->set(height); LLButton* buttonp = dynamic_cast<LLButton*>(view); if (buttonp) { refreshButton(view); } else { refreshView(view); } }
QmaxButton::QmaxButton(QString pText, QSize buttonSize, QString pImage,int pType, int pUserCode,QWidget *parent): QWidget(parent) { this->m_nUserCode = pUserCode; this->m_strText = pText; this->m_nType = pType; this->m_strImage = pImage; m_nPressed =0; m_nHighlight =1; m_nStatus=false; setGeometry(0,0,buttonSize.width(),buttonSize.height()); this->setCursor(Qt::PointingHandCursor); if(pType == 1|| pType == 0) this->logicalSize = QSize(buttonSize.width(),buttonSize.height()); else this->logicalSize = QSize(buttonSize.width(),buttonSize.height()); //this->logicalSize = QSize(int((buttonSize.width()/2.0f)-5),int(buttonSize.height()*1.5f)); // if(pType == 3) // this->logicalSize = QSize(int((buttonSize.width() / 2.0f) - 5), int(buttonSize.height() * 1.5f)); refreshButton(); }
NewsButton::NewsButton(QWidget *parent) : QToolButton(parent) , mReadIcon(QLatin1String("://images/16x16/mail-read-symbolic.png")) , mUnreadIcon(QLatin1String("://images/16x16/mail-unread-symbolic.png")) { auto &feed = NewsFeed::instance(); setToolButtonStyle(Qt::ToolButtonTextBesideIcon); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); setAutoRaise(true); setText(tr("News")); setToolTip(feed.errorString()); connect(&feed, &NewsFeed::refreshed, this, &NewsButton::refreshButton); connect(&feed, &NewsFeed::errorStringChanged, this, &NewsButton::setToolTip); connect(this, &QToolButton::pressed, this, &NewsButton::showNewsMenu); refreshButton(); }
void QmaxButton::setState(int pState) { if(pState == 1) m_nHighlight =1; refreshButton(); }
void QERecipe::refreshRecipeList() { QDomElement rootElement; QDomElement recipeElement; QDomNode rootNode; QString visible; QString tmp; bool flag; int count; int i; qComboBoxRecipeList->blockSignals(true); tmp = qComboBoxRecipeList->currentText(); qComboBoxRecipeList->clear(); rootElement = document.documentElement(); if (rootElement.tagName() == "epicsqt") { count = 0; rootNode = rootElement.firstChild(); while (rootNode.isNull() == false) { recipeElement = rootNode.toElement(); if (recipeElement.tagName() == "recipe") { visible = recipeElement.attribute("visible").toUpper(); if (visible.isEmpty()) { flag = true; } else { if (visible == "USER") { flag = true; } else if (visible == "SCIENTIST") { flag = (currentUserType > 0); } else if (visible == "ENGINEER") { flag = (currentUserType > 1); } else { flag = false; } } if (flag) { if (recipeElement.attribute("name").isEmpty()) { qComboBoxRecipeList->addItem("Recipe #" + QString::number(count)); count++; } else { qComboBoxRecipeList->addItem(recipeElement.attribute("name")); } } } rootNode = rootNode.nextSibling(); } } i = qComboBoxRecipeList->findText(tmp); if (i == -1) { qComboBoxRecipeList->setCurrentIndex(0); } else { qComboBoxRecipeList->setCurrentIndex(i); } refreshButton(); qComboBoxRecipeList->blockSignals(false); }
void QERecipe::comboBoxRecipeSelected(int) { refreshButton(); }
void QmaxButton::changeStatus(bool pValue) { m_nStatus = pValue; refreshButton(); }
void QmaxButton::refresh() { refreshButton(); }
void LoginForm::validatePassword(QString password) { password_valid = !password.isEmpty(); refreshButton(); }
void SharedMediaWidget::refreshButtons() { for (int typeIndex = 0; typeIndex < OverviewCount; ++typeIndex) { refreshButton(static_cast<MediaOverviewType>(typeIndex)); } }
void QmaxButton::setText(QString pText) { m_strText = pText; refreshButton(); }
void QmaxButton::mousePressEvent(QMouseEvent *e) { Q_UNUSED(e); m_nPressed =1; refreshButton(); }
void LoginForm::validateUsername(QString username) { // В дальнейшем здесь уместно сделать более надёжную проверку, чтобы сервер не засирали тупыми именами username_valid = !username.isEmpty(); refreshButton(); }