当前位置: 首页>>代码示例>>C++>>正文


C++ KPushButton::setObjectName方法代码示例

本文整理汇总了C++中KPushButton::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ KPushButton::setObjectName方法的具体用法?C++ KPushButton::setObjectName怎么用?C++ KPushButton::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KPushButton的用法示例。


在下文中一共展示了KPushButton::setObjectName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PopupWidget

LongMessageWidget::LongMessageWidget( QWidget *anchor, const QString &message,
                                     Amarok::Logger::MessageType type )
        : PopupWidget( anchor )
        , m_counter( 0 )
        , m_timeout( 6000 )
{
    DEBUG_BLOCK
    Q_UNUSED( type )

    setFrameStyle( QFrame::StyledPanel | QFrame::Raised );

    setContentsMargins( 4, 4, 4, 4 );

    setMinimumWidth( 26 );
    setMinimumHeight( 26 );
    setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );

    QPalette p = QToolTip::palette();
    setPalette( p );

    KHBox *hbox = new KHBox( this );
    layout()->addWidget( hbox );

    hbox->setSpacing( 12 );

    m_countdownFrame = new CountdownFrame( hbox );
    m_countdownFrame->setObjectName( "counterVisual" );
    m_countdownFrame->setFixedWidth( fontMetrics().width( "X" ) );
    m_countdownFrame->setFrameStyle( QFrame::Plain | QFrame::Box );
    QPalette pal;
    pal.setColor( m_countdownFrame->foregroundRole(), p.dark().color() );
    m_countdownFrame->setPalette( pal );

    QLabel *alabel = new QLabel( message, hbox );
    alabel->setWordWrap( true );
    alabel->setOpenExternalLinks( true );
    alabel->setObjectName( "label" );
    alabel->setTextFormat( Qt::RichText );
    alabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
    alabel->setPalette( p );

    hbox = new KHBox( this );
    layout()->addWidget( hbox );

    KPushButton *button = new KPushButton( KStandardGuiItem::close(), hbox );
    button->setObjectName( "closeButton" );
    connect( button, SIGNAL( clicked() ), SLOT( close() ) );

    reposition();

    show();
    m_timerId = startTimer( m_timeout / m_countdownFrame->height() );
}
开发者ID:phalgun,项目名称:amarok-nepomuk,代码行数:53,代码来源:LongMessageWidget.cpp

示例2: KPushButton

KPushButton * PostWidget::addButton(const QString & objName, const QString & toolTip, const KIcon & icon)
{
    KPushButton * button = new KPushButton(icon, QString(), _mainWidget);
    button->setObjectName(objName);
    button->setToolTip(toolTip);
    button->setIconSize(QSize(16,16));
    button->setMinimumSize(QSize(20, 20));
    button->setMaximumSize(QSize(20, 20));
    button->setFlat(true);
    button->setVisible(false);
    button->setCursor(Qt::PointingHandCursor);

    d->mUiButtons.insert(objName, button);
    d->buttonsLayout->addWidget( button, 1, d->mUiButtons.count() );
    return button;
}
开发者ID:xrg,项目名称:choqok,代码行数:16,代码来源:postwidget.cpp

示例3: QWidget

KMultiFormListBoxWindowed::KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, QWidget *parent,
																	 bool showUpDownButtons, bool showHelpButton,
																	 QString addButtonText)
  : QWidget( parent )
{
  _layout = new QVBoxLayout(this);

	QHBoxLayout *innerLayout = new QHBoxLayout();
	_layout->addLayout(innerLayout);

  _listbox = new KListWidget(this/*,"listbox"*/);
  _listbox->setSelectionMode(QAbstractItemView::SingleSelection);
  innerLayout->addWidget(_listbox);

  QVBoxLayout *buttons = new QVBoxLayout();
  innerLayout->addLayout(buttons);

  KPushButton *but = new KPushButton(addButtonText, this);
  but->setObjectName("Add Button");
  buttons->addWidget(but,0);
  connect(but, SIGNAL(clicked()), this, SLOT(addNewElement()));

  but = new KPushButton(i18n("Edit"), this);
  but->setObjectName("Edit Button");
  buttons->addWidget(but,0);
  connect(but,SIGNAL(clicked()), this, SLOT(slotEditSelected()));
  connect(_listbox, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(slotEditSelected(QListWidgetItem *)));
	_buttonList.append(but);

  but = new KPushButton(i18n("Delete"), this);
  but->setObjectName("Delete Button");
  buttons->addWidget(but,0);
  connect(but, SIGNAL(clicked()), this, SLOT(slotDeleteEntry()));
	_buttonList.append(but);

  but = new KPushButton(i18n("Copy"), this);
  but->setObjectName("Copy Button");
  buttons->addWidget(but,0);
  connect(but, SIGNAL(clicked()), this, SLOT(slotCopySelected()));
	_buttonList.append(but);

	if (showUpDownButtons) {
		but = new KPushButton(i18n("Up"), this);
		but->setObjectName("Up Button");
		buttons->addWidget(but, 0);
		connect(but, SIGNAL(clicked()), this, SLOT(slotMoveItemUp()));
		_buttonList.append(but);

		but = new KPushButton(i18n("Down"), this);
		but->setObjectName( "Down Button");
		buttons->addWidget(but, 0);
		connect(but, SIGNAL(clicked()), this, SLOT(slotMoveItemDown()));
		_buttonList.append(but);
	}

	if (showHelpButton) {
		but = new KPushButton(KStandardGuiItem::help(), this);
		but->setObjectName( "Help Button");
		buttons->addWidget(but, 0);
		connect(but, SIGNAL(clicked()), this, SIGNAL(showHelp()));
	}

  buttons->addStretch(1);
  _factory = factory;
	slotUpdateButtonState();

}
开发者ID:KDE,项目名称:kregexpeditor,代码行数:67,代码来源:kmultiformlistbox-windowed.cpp


注:本文中的KPushButton::setObjectName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。