示例#1
0
文件: qmaxbutton.cpp 项目: Qmax/PT6
void QmaxButton::mouseReleaseEvent(QMouseEvent *e)
{
    Q_UNUSED(e);
    m_nPressed=0;
    refreshButton();


    emit clicked(this->m_nUserCode);
}
示例#2
0
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();
}
示例#3
0
void
KCustomMenuEditor::slotRemoveItem()
{
   QListViewItem *item = m_listView->currentItem();
   if (!item)
      return;

   delete item;
   refreshButton();
}
示例#4
0
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();
	}
}
示例#6
0
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();
   }
}
示例#7
0
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();
}
示例#8
0
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);
	}
}
示例#9
0
文件: qmaxbutton.cpp 项目: Qmax/PT6
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();
}
示例#10
0
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();
}
示例#11
0
文件: qmaxbutton.cpp 项目: Qmax/PT6
void QmaxButton::setState(int pState)
{
    if(pState == 1)
        m_nHighlight =1;
    refreshButton();
}
示例#12
0
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);

}
示例#13
0
void QERecipe::comboBoxRecipeSelected(int)
{

    refreshButton();

}
示例#14
0
文件: qmaxbutton.cpp 项目: Qmax/PT6
void QmaxButton::changeStatus(bool pValue)
{
    m_nStatus = pValue;
    refreshButton();
}
示例#15
0
文件: qmaxbutton.cpp 项目: Qmax/PT6
void QmaxButton::refresh()
{
    refreshButton();
}
示例#16
0
文件: loginform.cpp 项目: WST/acid-pc
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));
	}
}
示例#18
0
文件: qmaxbutton.cpp 项目: Qmax/PT6
void QmaxButton::setText(QString pText)
{
    m_strText = pText;
    refreshButton();
}
示例#19
0
文件: qmaxbutton.cpp 项目: Qmax/PT6
void QmaxButton::mousePressEvent(QMouseEvent *e)
{
    Q_UNUSED(e);
    m_nPressed =1;
    refreshButton();
}
示例#20
0
文件: loginform.cpp 项目: WST/acid-pc
void LoginForm::validateUsername(QString username) {
	// В дальнейшем здесь уместно сделать более надёжную проверку, чтобы сервер не засирали тупыми именами
	username_valid = !username.isEmpty();
	refreshButton();
}