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


C++ QToolButton::setTextLabel方法代码示例

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


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

示例1: KDialog

/// Pixmap Collection Editor Dialog
PixmapCollectionEditor::PixmapCollectionEditor(PixmapCollection *collection, QWidget *parent)
        : KDialog(parent, "pixcollection_dialog", true,
                  i18n("Edit Pixmap Collection: %1", collection->collectionName()), Close, Close, false)
{
    m_collection = collection;
    QFrame *frame = makeMainWidget();
    QHBoxLayout *l = new QHBoxLayout(frame);
    setInitialSize(QSize(400, 200), true);

    //// Setup the icon toolbar /////////////////
    QVBoxLayout *vlayout = new QVBoxLayout(l);
    QToolButton *newItemPath = new QToolButton(frame);
    newItemPath->setIconSet(koIcon("document-open"));
    newItemPath->setTextLabel(i18n("&Add File"), true);
    vlayout->addWidget(newItemPath);
    m_buttons.insert(BNewItemPath, newItemPath);
    connect(newItemPath, SIGNAL(clicked()), this, SLOT(newItemByPath()));

    QToolButton *newItemName = new QToolButton(frame);
    newItemName->setIconSet(koIcon("list-add"));
    newItemName->setTextLabel(i18n("&Add an Icon"), true);
    vlayout->addWidget(newItemName);
    m_buttons.insert(BNewItemName, newItemName);
    connect(newItemName, SIGNAL(clicked()), this, SLOT(newItemByName()));

    QToolButton *delItem = new QToolButton(frame);
    delItem->setIconSet(koIcon("list-remove"));
    delItem->setTextLabel(i18n("&Remove Selected Item"), true);
    vlayout->addWidget(delItem);
    m_buttons.insert(BDelItem, delItem);
    connect(delItem, SIGNAL(clicked()), this, SLOT(removeItem()));
    vlayout->addStretch();

    // Setup the iconView
    m_iconView = new K3IconView(frame, "pixcollection_iconView");
    m_iconView->resize(100, 100);
    m_iconView->setArrangement(Q3IconView::LeftToRight);
    m_iconView->setAutoArrange(true);
    m_iconView->setMode(K3IconView::Select);
    l->addWidget(m_iconView);
    connect(m_iconView, SIGNAL(contextMenuRequested(Q3IconViewItem*,QPoint)), this, SLOT(displayMenu(Q3IconViewItem*,QPoint)));
    connect(m_iconView, SIGNAL(itemRenamed(Q3IconViewItem*,QString)), this, SLOT(renameCollectionItem(Q3IconViewItem*,QString)));

    PixmapMap::ConstIterator it;
    PixmapMap::ConstIterator endIt = collection->m_pixmaps.end();
    for (it = collection->m_pixmaps.constBegin(); it != endIt; ++it)
        createIconViewItem(it.key());
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:49,代码来源:pixmapcollection.cpp

示例2: QLabel

CColorPopup::CColorPopup (QWidget * parent, const char *name, Qt::WFlags f)
:QWidget (parent, name, f)
{
    colorShower = new QLabel (this, "color shower");
    colorShower->setFrameStyle (Q3Frame::WinPanel | Q3Frame::Sunken);
    colorShower->setLineWidth (2);
    colorShower->setMidLineWidth (1);
    colorShower->resize (37, 20);
    colorShower->setPaletteBackgroundColor (QColor (0, 0, 0));
    colorShower->move (5, 2);
    colorName = new Q3TextEdit (this);
    colorName->resize (55, 20);
    colorName->move (50, 2);
    colorName->setHScrollBarMode (Q3ScrollView::AlwaysOff);
    colorName->setVScrollBarMode (Q3ScrollView::AlwaysOff);
    
	QFont f1 ("Times", 8, QFont::Light);
    colorName->setFont (f1);
    colorName->clearFocus ();
    s = new CColorSwatches (this, "", ((CTools *) parent)->dad);
    s->resize (210, 125);
    s->move (2, 29);
    
	QToolButton * colordialog =new CToolButton (this, tr ("Open color dialog"));
    colordialog->move (180, 3);
    colordialog->resize (20, 20);
    colordialog->setIconSet (QIcon (QPixmap ("colordialogBut.png")));
    colordialog->setTextLabel (trUtf8 ("Open Color Dialog"));
    connect (colordialog, SIGNAL (clicked ()), this,SLOT (slotColordialog ()));

        //setFocusPolicy (QWidget::StrongFocus);
    setMouseTracking (true);
    mcursor = QPixmap ((const char **) eye_dropper_tool_xpm);
    setCursor (QCursor (mcursor, 1, 15));
}
开发者ID:ozkanpakdil,项目名称:f4l,代码行数:35,代码来源:colorpopup.cpp

示例3: QButtonGroup

QWidget *Frame::createCategoryPage( CategoryInterface *c )
{
    QButtonGroup *g = new QButtonGroup( 1, Horizontal, toolBox );
    g->setFrameStyle( QFrame::NoFrame );
    g->setEraseColor(green);
    g->setBackgroundMode(PaletteBase);
    for ( int i = 0; i < c->numCategories(); ++i ) {
	QToolButton *b = new QToolButton( g );
	b->setBackgroundMode(PaletteBase);
	b->setTextLabel( c->categoryName( i ) );
	b->setIconSet( c->categoryIcon( i ) );
	b->setAutoRaise( TRUE );
	b->setTextPosition( QToolButton::Right );
	b->setUsesTextLabel( TRUE );
	g->insert( b, i + c->categoryOffset() );
	connect( g, SIGNAL( clicked( int ) ), c, SLOT( setCurrentCategory( int ) ) );
    }
    return g;
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:19,代码来源:frame.cpp

示例4: KDialogBase

DelegateDialog::DelegateDialog(QWidget *parent)
    : KDialogBase(parent, "", true, "", Ok | Cancel, Ok, true)
{
    QWidget *page = new QWidget(this);
    QGridLayout *layout = new QGridLayout(page, 5, 3, 11, 6);

    QLabel *label = new QLabel(i18n("User:"), page);
    layout->addWidget(label, 0, 0);

    mEmail = new QLineEdit(page);
    layout->addWidget(mEmail, 0, 1);

    QToolButton *emailSelector = new QToolButton(page);
    emailSelector->setUsesTextLabel(true);
    emailSelector->setTextLabel(i18n("..."));
    layout->addWidget(emailSelector, 0, 2);

    QValueList<Scalix::DelegateTypes> types;
    types << Scalix::SendOnBehalfOf;
    types << Scalix::SeePrivate;
    types << Scalix::GetMeetings;
    types << Scalix::InsteadOfMe;

    int row = 1;
    for(uint i = 0; i < types.count(); ++i)
    {
        QCheckBox *box = new QCheckBox(Scalix::Delegate::rightsAsString(types[ i ]), page);
        layout->addMultiCellWidget(box, row, row, 1, 2);

        mRights.insert(types[ i ], box);
        row++;
    }

    connect(emailSelector, SIGNAL(clicked()), SLOT(selectEmail()));

    setMainWidget(page);
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:37,代码来源:delegatedialog.cpp

示例5: CHotKeyEditorMenu


//.........这里部分代码省略.........

  actionKillProcessAction = new CAction (tr("Kill Process"), getPixmapIcon("killProcessIcon"),
    tr("&Kill Process"), Qt::CTRL + Qt::Key_K, this, "actionKillProcessAction");
  actionKillProcessAction->setParentMenuText(tr("Action"));
  connect(actionKillProcessAction, SIGNAL(activated()), this, SLOT(killProcesses()));

  CAction * actionPingAction = new CAction (tr("Ping"), getPixmapIcon("pingIcon"),
    tr("&Ping"), Qt::CTRL + Qt::Key_P, this, "actionPingAction");
  actionPingAction->setParentMenuText(tr("Action"));
  connect(actionPingAction, SIGNAL(activated()), this, SLOT(ping()));

  CAction * actionShutdownAction = new CAction (tr("Shutdown"), getPixmapIcon("serverShutdownIcon"),
    tr("&Shutdown"), 0, this, "actionShutdownAction");
  actionShutdownAction->setParentMenuText(tr("Action"));
  connect(actionShutdownAction, SIGNAL(activated()), this, SLOT(shutdown()));

  fileTimerAction = new CAction (tr("Start Refresh Timer"), getPixmapIcon("timerIcon"),
    tr("Start Refresh &Timer"), Qt::CTRL + Qt::Key_T, this, "fileTimerAction", true);
  fileTimerAction->setParentMenuText(tr("File"));
  connect(fileTimerAction, SIGNAL(toggled(bool)), this, SLOT(fileTimerActionToggled(bool)));

  QPopupMenu *fileMenu = new QPopupMenu(this);
  QPopupMenu *actionMenu = new QPopupMenu(this);
  QPopupMenu *viewMenu = new QPopupMenu(this);
  connect(viewMenu, SIGNAL(aboutToShow()), this, SLOT(viewMenuAboutToShow()));

  fileMenu->insertItem(getPixmapIcon("saveIcon"), tr("Save"), save_menu);
  fileMenu->insertSeparator();
  fileRefreshAction->addTo(fileMenu);
  fileMenu->insertSeparator();
  fileTimerAction->addTo(fileMenu);
  fileMenu->insertSeparator();
  fileCloseAction->addTo(fileMenu);
  menuBar()->insertItem(tr("&File"), fileMenu);

  viewShowMessagesAction->addTo(viewMenu);
  menuBar()->insertItem(tr("&View"), viewMenu);

  actionKillProcessAction->addTo(actionMenu);

  flush_menu = flushMenu(m_mysql->mysql());
  connect(flush_menu, SIGNAL(activated(int)), this, SLOT(flush(int)));

  actionMenu->insertItem(getPixmapIcon("flushIcon"),tr("Flush"), flush_menu);

  actionPingAction->addTo(actionMenu);
  actionMenu->insertSeparator();
  actionShutdownAction->addTo(actionMenu);
  menuBar()->insertItem(tr("&Action"), actionMenu);

  new CHotKeyEditorMenu(this, menuBar(), "HotKeyEditor");

  QToolBar * actionToolBar = new QToolBar(tr("Action Bar"), this, Top);

  QToolButton * saveTypeButton = new QToolButton(actionToolBar);
  saveTypeButton->setPopup(save_menu);
  saveTypeButton->setPixmap(getPixmapIcon("saveIcon"));
  saveTypeButton->setTextLabel(tr("Save"), true);
  saveTypeButton->setPopupDelay(0);
  actionToolBar->addSeparator();

  actionKillProcessAction->addTo(actionToolBar);
  
  QToolButton * flushTypeButton = new QToolButton(actionToolBar);  
  flushTypeButton->setPopup(flush_menu);
  flushTypeButton->setPixmap(getPixmapIcon("flushIcon"));
  flushTypeButton->setTextLabel(tr("Flush"), true);
  flushTypeButton->setPopupDelay(0);    

  actionPingAction->addTo(actionToolBar);
  actionToolBar->addSeparator();
  actionShutdownAction->addTo(actionToolBar);

  QToolBar * refreshToolBar = new QToolBar(tr("Refresh Bar"), this, Top );  
  fileRefreshAction->addTo(refreshToolBar);  
  refreshToolBar->addSeparator();
 
  QLabel * delayLabel = new QLabel(refreshToolBar, "delayLabel" ); 
  delayLabel->setMinimumSize(QSize(65, 0));
  delayLabel->setText(tr("Refresh Rate (sec)"));
  
  delay = new QSpinBox(refreshToolBar, "delayBox");  
  delay->setMinimumSize(QSize( 50, 0)); 
  delay->setMaxValue(7200);
  delay->setMinValue(1);

  CConfig *cfg = new CConfig();  
  delay->setValue(cfg->readNumberEntry("Refresh Rate", 30));
  status->setTraditionalMode(strtobool(cfg->readStringEntry("Status Traditional Mode", "true")));
  delete cfg;
  status->refresh();  

  fileTimerAction->addTo(refreshToolBar);

  refreshTimer = new QTimer(this);
  connect(refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));

  connect(tabWidget, SIGNAL(currentChanged (QWidget *)), this, SLOT(tabChanged(QWidget *)));
  myResize(600, 400);
}
开发者ID:andrewbasterfield,项目名称:mysqlcc,代码行数:101,代码来源:CAdministrationWindow.cpp

示例6: QMainWindow

MainWindow::MainWindow(QWidget *parent):
    QMainWindow(parent)
{
    d_plot = new Plot(this);

    setCentralWidget(d_plot);

    QToolBar *toolBar = new QToolBar(this);

    QToolButton *btnSpectrogram = new QToolButton(toolBar);
    QToolButton *btnContour = new QToolButton(toolBar);
    QToolButton *btnPrint = new QToolButton(toolBar);

#if QT_VERSION >= 0x040000
    btnSpectrogram->setText("Spectrogram");
    //btnSpectrogram->setIcon(QIcon());
    btnSpectrogram->setCheckable(true);
    btnSpectrogram->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    toolBar->addWidget(btnSpectrogram);

    btnContour->setText("Contour");
    //btnContour->setIcon(QIcon());
    btnContour->setCheckable(true);
    btnContour->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    toolBar->addWidget(btnContour);

	btnPrint->setText("Print");
    btnPrint->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    toolBar->addWidget(btnPrint);
#else
    btnSpectrogram->setTextLabel("Spectrogram");
    //btnSpectrogram->setPixmap(zoom_xpm);
    btnSpectrogram->setToggleButton(true);
    btnSpectrogram->setUsesTextLabel(true);

    btnContour->setTextLabel("Contour");
    //btnContour->setPixmap(zoom_xpm);
    btnContour->setToggleButton(true);
    btnContour->setUsesTextLabel(true);

    btnPrint->setTextLabel("Print");
    btnPrint->setUsesTextLabel(true);
#endif

    addToolBar(toolBar);

    connect(btnSpectrogram, SIGNAL(toggled(bool)), 
        d_plot, SLOT(showSpectrogram(bool)));
    connect(btnContour, SIGNAL(toggled(bool)), 
        d_plot, SLOT(showContour(bool)));
    connect(btnPrint, SIGNAL(clicked()), 
        d_plot, SLOT(printPlot()) );

#if QT_VERSION >= 0x040000
    btnSpectrogram->setChecked(true);
    btnContour->setChecked(false);
#else
    btnSpectrogram->setOn(true);
    btnContour->setOn(false);
#endif
}
开发者ID:bodylinksystems,项目名称:GoldenCheetah,代码行数:61,代码来源:main.cpp

示例7: plainPage

popupPublic::popupPublic(QWidget *parent, const char *name,QString sfile,bool filemode,KShortcut goDefaultKey):
KDialogBase( Plain, i18n("Select Public Key"), Details | Ok | Cancel, Ok, parent, name,true)
{

	QWidget *page = plainPage();
	QVBoxLayout *vbox=new QVBoxLayout(page,0,spacingHint());
	vbox->setAutoAdd(true);

	setButtonText(KDialogBase::Details,i18n("Options"));

        if (KGpgSettings::allowCustomEncryptionOptions())
                customOptions=KGpgSettings::customEncryptionOptions();

        KIconLoader *loader = KGlobal::iconLoader();

        keyPair=loader->loadIcon("kgpg_key2",KIcon::Small,20);
        keySingle=loader->loadIcon("kgpg_key1",KIcon::Small,20);
	keyGroup=loader->loadIcon("kgpg_key3",KIcon::Small,20);

        if (filemode) setCaption(i18n("Select Public Key for %1").arg(sfile));
        fmode=filemode;

	QHButtonGroup *hBar=new QHButtonGroup(page);
	//hBar->setFrameStyle(QFrame::NoFrame);
	hBar->setMargin(0);

#if KDE_IS_VERSION( 3, 2, 90 )
	QToolButton *clearSearch = new QToolButton(hBar);
	clearSearch->setTextLabel(i18n("Clear Search"), true);
	clearSearch->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left"
                                            : "locationbar_erase"));
	(void) new QLabel(i18n("Search: "),hBar);
	KListViewSearchLine* listViewSearch = new KListViewSearchLine(hBar);
	connect(clearSearch, SIGNAL(pressed()), listViewSearch, SLOT(clear()));
#endif

        keysList = new KListView( page );
	 keysList->addColumn(i18n("Name"));
	 keysList->addColumn(i18n("Email"));
	 keysList->addColumn(i18n("ID"));

#if KDE_IS_VERSION( 3, 2, 90 )
	 listViewSearch->setListView(keysList);
#endif

        keysList->setRootIsDecorated(false);
        page->setMinimumSize(540,200);
        keysList->setShowSortIndicator(true);
        keysList->setFullWidth(true);
	keysList->setAllColumnsShowFocus(true);
        keysList->setSelectionModeExt(KListView::Extended);
	keysList->setColumnWidthMode(0,QListView::Manual);
	keysList->setColumnWidthMode(1,QListView::Manual);
	keysList->setColumnWidth(0,210);
	keysList->setColumnWidth(1,210);

        boutonboxoptions=new QButtonGroup(5,Qt::Vertical ,page,0);

	KActionCollection *actcol=new KActionCollection(this);
	(void) new KAction(i18n("&Go to Default Key"),goDefaultKey, this, SLOT(slotGotoDefaultKey()),actcol,"go_default_key");


        CBarmor=new QCheckBox(i18n("ASCII armored encryption"),boutonboxoptions);
        CBuntrusted=new QCheckBox(i18n("Allow encryption with untrusted keys"),boutonboxoptions);
        CBhideid=new QCheckBox(i18n("Hide user id"),boutonboxoptions);
        setDetailsWidget(boutonboxoptions);
        QWhatsThis::add
                (keysList,i18n("<b>Public keys list</b>: select the key that will be used for encryption."));
        QWhatsThis::add
                (CBarmor,i18n("<b>ASCII encryption</b>: makes it possible to open the encrypted file/message in a text editor"));
        QWhatsThis::add
                (CBhideid,i18n("<b>Hide user ID</b>: Do not put the keyid into encrypted packets. This option hides the receiver "
                                "of the message and is a countermeasure against traffic analysis. It may slow down the decryption process because "
                                "all available secret keys are tried."));
        QWhatsThis::add
                (CBuntrusted,i18n("<b>Allow encryption with untrusted keys</b>: when you import a public key, it is usually "
                                  "marked as untrusted and you cannot use it unless you sign it in order to make it 'trusted'. Checking this "
                                  "box enables you to use any key, even if it has not be signed."));

        if (filemode) {
		QWidget *parentBox=new QWidget(boutonboxoptions);
		QHBoxLayout *shredBox=new QHBoxLayout(parentBox,0);
		//shredBox->setFrameStyle(QFrame::NoFrame);
		//shredBox->setMargin(0);
	       CBshred=new QCheckBox(i18n("Shred source file"),parentBox);
                QWhatsThis::add
                        (CBshred,i18n("<b>Shred source file</b>: permanently remove source file. No recovery will be possible"));

		QString shredWhatsThis = i18n( "<qt><b>Shred source file:</b><br /><p>Checking this option will shred (overwrite several times before erasing) the files you have encrypted. This way, it is almost impossible that the source file is recovered.</p><p><b>But you must be aware that this is not secure</b> on all file systems, and that parts of the file may have been saved in a temporary file or in the spooler of your printer if you previously opened it in an editor or tried to print it. Only works on files (not on folders).</p></qt>");
		  KActiveLabel *warn= new KActiveLabel( i18n("<a href=\"whatsthis:%1\">Read this before using shredding</a>").arg(shredWhatsThis),parentBox );
		  shredBox->addWidget(CBshred);
		  shredBox->addWidget(warn);
        }

	        CBsymmetric=new QCheckBox(i18n("Symmetrical encryption"),boutonboxoptions);
                QWhatsThis::add
                        (CBsymmetric,i18n("<b>Symmetrical encryption</b>: encryption does not use keys. You just need to give a password "
                                          "to encrypt/decrypt the file"));
                QObject::connect(CBsymmetric,SIGNAL(toggled(bool)),this,SLOT(isSymetric(bool)));

//.........这里部分代码省略.........
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:101,代码来源:popuppublic.cpp


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