本文整理汇总了C++中QToolButton::setStatusTip方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolButton::setStatusTip方法的具体用法?C++ QToolButton::setStatusTip怎么用?C++ QToolButton::setStatusTip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QToolButton
的用法示例。
在下文中一共展示了QToolButton::setStatusTip方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createToolButton
QToolButton* ToolBar::createToolButton(QAction *act)
{
QToolButton *toolButton = new QToolButton();
toolButton->setMinimumSize(QSize(30, 30));
toolButton->setMaximumSize(QSize(30, 30));
toolButton->setDefaultAction(act);
toolButton->setStatusTip(act->text());
return toolButton;
}
示例2: createToolButton
QToolButton* AMScanViewPlotToolsButtonView::createToolButton(MPlotAbstractTool *tool)
{
QToolButton *toolButton = 0;
if (tool) {
toolButton = new QToolButton();
toolButton->setIcon(toolToIcon(tool));
toolButton->setIconSize(QSize(16, 16));
toolButton->setText(tool->name());
toolButton->setStatusTip(tool->description());
toolButton->setToolTip(tool->name());
toolButton->setCheckable(true);
toolButton->setAutoRaise(false);
}
return toolButton;
}
示例3: createItems
void ItemsWidget::createItems(int categoryId)
{
// Remove pervious buttons from grid layout
this->removeItems();
// Get all items
QList<Model::Item> items = Services::Item::getByCategoryId(categoryId);
int i=0, col = 0, row = 1;
for(QList<Model::Item>::iterator p = items.begin(); p != items.end(); ++p ) {
QToolButton* button = new QToolButton;
button->setObjectName(QString("%1_itemButton").arg(p->id()));
button->setText((Settings::Language::getCurrentLanguage() == Settings::Language::Arabic) ? p->arabicName() : p->englishName());
if ( Settings::Language::getCurrentLanguage() == Settings::Language::English ) {
if ( p->id() == 2 || p->id() == 29)
button->setFont(QFont("Hacen Liner Screen Bd", 10, QFont::Normal));
else
button->setFont(QFont("Hacen Liner Screen Bd", 13, QFont::Normal));
}
else
button->setFont(QFont("Hacen Liner Screen Bd", 13, QFont::Normal));
button->setIconSize(QSize(128,128));
//button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
button->setToolTip(button->text());
button->setStatusTip(button->text());
connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
this->signalMapper->setMapping(button, p->id());
layout->addWidget(button, row, col);
col++;
i++;
if ( col % ButtonsPerLine == 0) {
row++;
col = 0;
}
}
}
示例4: QWidget
/*! Constructor
* \brief This class implements the project management
*
* This also handles the mouse and keyboad events, and sends
* when appropiate, the file names to be opened by the parent.
*
* \param parent Parent of the widget.
*/
Project::Project(QWidget *parent) : QWidget(parent)
{
projectLibrary = 0;
m_libraryFileName = "";
m_libraryName = "";
QVBoxLayout *layout = new QVBoxLayout(this);
QToolBar *toolbar = new QToolBar;
QToolButton *projNew = new QToolButton();
projNew->setIcon(QIcon(Qucs::bitmapDirectory() + "project-new.png"));
projNew->setStatusTip(tr("Creates a new project"));
projNew->setToolTip(tr("Creates a new project"));
projNew->setWhatsThis(tr("New Project\n\nCreates a new project"));
QToolButton *projOpen = new QToolButton();
projOpen->setIcon(QIcon(Qucs::bitmapDirectory() + "fileopen.png"));
projOpen->setStatusTip(tr("Opens an existing project"));
projOpen->setToolTip(tr("Opens an existing project"));
projOpen->setWhatsThis(tr("Open Project\n\nOpens an existing project"));
QToolButton *addToProj = new QToolButton();
addToProj->setIcon(QIcon(Qucs::bitmapDirectory() + "filenew.png"));
addToProj->setStatusTip(tr("Adds a file to current project"));
addToProj->setToolTip(tr("Adds a file to current project"));
addToProj->setWhatsThis(tr("Add File to Project\n\nAdds a file to current project"));
QToolButton *projDel = new QToolButton();
projDel->setIcon(QIcon(Qucs::bitmapDirectory() + "fileclose.png"));
projDel->setStatusTip(tr("Removes a file from current project"));
projDel->setToolTip(tr("Removes a file from current project"));
projDel->setWhatsThis(tr("Remove from Project\n\nRemoves a file from current project"));
QToolButton *projClose = new QToolButton();
projClose->setIcon(QIcon(Qucs::bitmapDirectory() + "project-close.png"));
projClose->setStatusTip(tr("Closes the current project"));
projClose->setToolTip(tr("Closes the current project"));
projClose->setWhatsThis(tr("Close Project\n\nCloses the current project"));
connect(projNew, SIGNAL(clicked()), this, SLOT(slotNewProject()));
connect(projOpen, SIGNAL(clicked()), this, SLOT(slotOpenProject()));
connect(addToProj, SIGNAL(clicked()), this, SLOT(slotAddToProject()));
connect(projDel, SIGNAL(clicked()), this, SLOT(slotRemoveFromProject()));
connect(projClose, SIGNAL(clicked()), this, SLOT(slotCloseProject()));
toolbar->addWidget(projNew);
toolbar->addWidget(projOpen);
toolbar->addWidget(addToProj);
toolbar->addWidget(projDel);
toolbar->addWidget(projClose);
m_projectsSidebar = new ComponentsSidebar(this);
connect(m_projectsSidebar, SIGNAL(itemClicked(const QString&, const QString&)), this,
SLOT(slotOnClicked(const QString&, const QString&)));
connect(m_projectsSidebar, SIGNAL(itemDoubleClicked(const QString&, const QString&)), this,
SLOT(slotOnDoubleClicked(const QString&, const QString&)));
layout->addWidget(toolbar);
layout->addWidget(m_projectsSidebar);
setWindowTitle(tr("Project View"));
}
示例5: QMenu
/*!
* \brief Constructor.
*
* \param parent Parent of the widget.
*/
QuickOpen::QuickOpen(QWidget *parent) : QMenu(parent)
{
// Set window geometry
setMinimumSize(300,300);
QVBoxLayout *layout = new QVBoxLayout(this);
// Create the toolbar
QToolBar *toolbar = new QToolBar(this);
QToolButton *buttonUp = new QToolButton(this);
buttonUp->setIcon(Caneda::icon("go-up"));
buttonUp->setShortcut(Qt::Key_Backspace);
buttonUp->setStatusTip(tr("Go up one folder"));
buttonUp->setToolTip(tr("Go up one folder"));
buttonUp->setWhatsThis(tr("Go up one folder"));
buttonBack = new QToolButton(this);
buttonBack->setIcon(Caneda::icon("go-previous"));
buttonBack->setShortcut(Qt::ALT + Qt::Key_Left);
buttonBack->setStatusTip(tr("Go previous folder"));
buttonBack->setToolTip(tr("Go previous folder"));
buttonBack->setWhatsThis(tr("Go previous folder"));
buttonBack->setEnabled(false);
buttonForward = new QToolButton(this);
buttonForward->setIcon(Caneda::icon("go-next"));
buttonForward->setShortcut(Qt::ALT + Qt::Key_Right);
buttonForward->setStatusTip(tr("Go next folder"));
buttonForward->setToolTip(tr("Go next folder"));
buttonForward->setWhatsThis(tr("Go next folder"));
buttonForward->setEnabled(false);
QToolButton *buttonHome = new QToolButton(this);
buttonHome->setIcon(Caneda::icon("go-home"));
buttonHome->setShortcut(Qt::CTRL + Qt::Key_Home);
buttonHome->setStatusTip(tr("Go to the home folder"));
buttonHome->setToolTip(tr("Go to the home folder"));
buttonHome->setWhatsThis(tr("Go to the home folder"));
// Create the filter button
QToolButton *buttonFilters = new QToolButton(this);
QMenu *filterMenu = new QMenu(this);
filterGroup = new QActionGroup(this);
buttonFilters->setIcon(Caneda::icon("configure"));
buttonFilters->setPopupMode(QToolButton::InstantPopup);
buttonFilters->setMenu(filterMenu);
filterNone = new QAction(Caneda::icon("view-sidetree"), tr("Show all"), filterGroup);
QAction *filtersSeparator = new QAction(filterGroup);
filtersSeparator->setSeparator(true);
filterSchematics = new QAction(Caneda::icon("application-x-caneda-schematic"), tr("Show schematics"), filterGroup);
filterSymbols = new QAction(Caneda::icon("application-x-caneda-symbol"), tr("Show symbols"), filterGroup);
filterLayouts = new QAction(Caneda::icon("application-x-caneda-layout"), tr("Show layouts"), filterGroup);
filterSimulations = new QAction(Caneda::icon("application-x-spice-simulation-raw"), tr("Show simulations"), filterGroup);
filterText = new QAction(Caneda::icon("text-plain"), tr("Show text files"), filterGroup);
filterNone->setCheckable(true);
filterSchematics->setCheckable(true);
filterSymbols->setCheckable(true);
filterLayouts->setCheckable(true);
filterSimulations->setCheckable(true);
filterText->setCheckable(true);
Settings *settings = Settings::instance();
int index = settings->currentValue("quickopen/filter").toInt();
filterGroup->actions().at(index)->setChecked(true);
filterMenu->addActions(filterGroup->actions());
// Add the buttons to the toolbar
toolbar->addWidget(buttonUp);
toolbar->addWidget(buttonBack);
toolbar->addWidget(buttonForward);
toolbar->addWidget(buttonHome);
QWidget *spacer = new QWidget(this);
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
toolbar->addWidget(spacer);
toolbar->addWidget(buttonFilters);
layout->addWidget(toolbar);
// Set lineEdit properties
m_filterEdit = new QLineEdit(this);
m_filterEdit->setClearButtonEnabled(true);
m_filterEdit->setPlaceholderText(tr("Search..."));
m_filterEdit->installEventFilter(this);
layout->addWidget(m_filterEdit);
// Create a new filesystem model
m_model = new QFileSystemModel(this);
m_model->setIconProvider(new IconProvider());
m_model->setRootPath(QDir::homePath());
//.........这里部分代码省略.........
示例6: QLabel
QBoxLayout *
View::focusPanelLayout()
{
/*
* Focus mode when not in live view.
*/
QLabel *focusModeLabel = new QLabel( tr("Focus mode:") );
focusMode = new FocusMode();
focusMode->setStatusTip( tr("Focus mode when not in live view") );
QObject::connect(
focusMode, SIGNAL(propertyChanged(int,int)),
this, SIGNAL(propertyChanged(int,int)));
/*
* Focus mode when in live view.
*/
QLabel *focusModeLiveLabel = new QLabel( tr("Live view:") );
focusModeLive = new QComboBox();
focusModeLive->setMaxCount( Map::MAX_FocusMode );
focusModeLive->setStatusTip( tr("Focus mode when in live view") );
focusModeLive->setFixedWidth( 80 );
setEvfAFList( camera );
QObject::connect(
focusModeLive, SIGNAL(activated(int)),
this, SLOT(toEvfAFValue(int)) );
/*
* Auto focus button.
*/
QLabel *focusLabel = new QLabel( tr("Focus: ") );
QToolButton *focusButton = new QToolButton();
focusButton->setAutoRaise( true );
focusButton->setIcon( QIcon(":/Resources/Misc/button.png") );
focusButton->setIconSize( QSize(22, 22) );
focusButton->setStatusTip( tr("Auto focus") );
QObject::connect(
focusButton, SIGNAL(pressed()),
this, SLOT(autoFocusInitiated()) );
QObject::connect(
focusButton, SIGNAL(released()),
this, SLOT(autoFocusDiscontinued()) );
/*
* Focus map to show on live view.
*/
QLabel *focusMapLabel = new QLabel( tr("Focus map:") );
QComboBox *focusMapComboBox = new QComboBox();
focusMapComboBox->setStatusTip( tr("Capture series of images for constructing focus map") );
focusMapComboBox->addItem( tr("Disabled") );
focusMapComboBox->addItem( tr("Enabled") );
focusMapComboBox->setFixedWidth( 80 );
focusMapComboBox->setCurrentIndex( 0 );
camera->setFocusMapSetting( 0 );
QObject::connect(
focusMapComboBox, SIGNAL(activated(int)),
this, SLOT(setFocusMap(int)) );
/*
* Depth of field (DOF) preview.
*/
QLabel *dofPreviewLabel = new QLabel( tr("DOF preview:") );
QComboBox *dofPreviewComboBox = new QComboBox();
dofPreviewComboBox->addItem( tr("Disabled") );
dofPreviewComboBox->addItem( tr("Enabled") );
dofPreviewComboBox->setFixedWidth( 80 );
dofPreviewComboBox->setCurrentIndex( 0 );
QObject::connect(
dofPreviewComboBox, SIGNAL(activated(int)),
this, SLOT(setDOFPreview(int)) );
/*
* Focus adjustment buttons.
*/
const bool flat = false;
const int width = 22;
const int height = 16;
const int buttonHeight = 23;
const int latency = 333;
QLabel *focusAdjustmentLabel = new QLabel();
focusAdjustmentLabel->setText( tr("Focus adjustment:") );
/*
* Near focus: <<<
*/
QPushButton *focusNear3Button = new QPushButton();
focusNear3Button->setStatusTip( tr("Near focus: large movement") );
focusNear3Button->setIcon( QIcon(":/Resources/Focus/arrow-left3.png") );
focusNear3Button->setIconSize( QSize(width, height) );
focusNear3Button->setFixedHeight( buttonHeight );
focusNear3Button->setFlat( flat );
focusNear3Button->setAutoRepeat( true );
focusNear3Button->setAutoRepeatDelay( latency );
focusNear3Button->setAutoRepeatInterval( latency );
/*
* Near focus: <<
*/
QPushButton *focusNear2Button = new QPushButton();
focusNear2Button->setStatusTip( tr("Near focus: medium movement") );
focusNear2Button->setIcon( QIcon(":/Resources/Focus/arrow-left2.png") );
//.........这里部分代码省略.........
示例7: QLabel
QBoxLayout *
View::exposurePanelLayout()
{
QLabel *ssLabel = new QLabel( tr("Shutter speed:") );
shutterSpeed = new ShutterSpeed();
QObject::connect(
shutterSpeed, SIGNAL(propertyChanged(int,int)),
this, SIGNAL(propertyChanged(int,int)) );
QLabel *apertureLabel = new QLabel( tr("Aperture:") );
aperture = new Aperture();
QObject::connect(
aperture, SIGNAL(propertyChanged(int,int)),
this, SIGNAL(propertyChanged(int,int)) );
QLabel *isoLabel = new QLabel( tr("ISO speed:") );
isoSpeed = new ISOSpeed();
QObject::connect(
isoSpeed, SIGNAL(propertyChanged(int,int)),
this, SIGNAL(propertyChanged(int,int)) );
shootingMode = new ShootingMode();
QLabel *ecLabel = new QLabel( tr("Exposure compensation:") );
exposureComp = new ExposureComp( camera, 3, this );
QObject::connect(
exposureComp, SIGNAL(propertyChanged(int,int)),
this, SIGNAL(propertyChanged(int,int)));
QLabel *expLabel = new QLabel( tr("Exposure:") );
QToolButton *expButton = new QToolButton();
expButton->setAutoRaise( true );
expButton->setStatusTip( tr("Auto exposure button") );
expButton->setIcon( QIcon(":/Resources/Misc/button.png") );
expButton->setIconSize( QSize(22, 22) );
QObject::connect(
expButton, SIGNAL(pressed()),
this, SLOT(autoMeteringInitiated()) );
QObject::connect(
expButton, SIGNAL(released()),
this, SLOT(autoMeteringDiscontinued()) );
QLabel *driveLabel = new QLabel( tr("Drive:") );
driveMode = new DriveMode();
QObject::connect(
driveMode, SIGNAL(propertyChanged(int,int)),
this, SIGNAL(propertyChanged(int,int)) );
QLabel *meteringLabel = new QLabel( tr("Metering:") );
meteringMode = new MeteringMode();
QObject::connect(
meteringMode, SIGNAL(propertyChanged(int,int)),
this, SIGNAL(propertyChanged(int,int)));
QLabel *whiteLabel = new QLabel( tr("White balance:") );
whiteBalance = new WhiteBalance();
QObject::connect(
whiteBalance, SIGNAL(propertyChanged(int,int)),
this, SIGNAL(propertyChanged(int,int)) );
QGridLayout *layer1Layout = new QGridLayout();
layer1Layout->addWidget( ssLabel, 0, 0 );
layer1Layout->addWidget( shutterSpeed, 1, 0 );
layer1Layout->addWidget( apertureLabel, 0, 1 );
layer1Layout->addWidget( aperture, 1, 1 );
layer1Layout->addWidget( isoLabel, 0, 2 );
layer1Layout->addWidget( isoSpeed, 1, 2 );
layer1Layout->setColumnStretch( 0, 1 );
layer1Layout->setColumnStretch( 1, 1 );
layer1Layout->setColumnStretch( 2, 1 );
QGridLayout *layer2Layout = new QGridLayout();
layer2Layout->addWidget( shootingMode, 0, 0, 2, 1 );
layer2Layout->addWidget( ecLabel, 0, 2 );
layer2Layout->addWidget( exposureComp, 1, 2 );
layer2Layout->addWidget( expLabel, 0, 4, Qt::AlignHCenter );
layer2Layout->addWidget( expButton, 1, 4, Qt::AlignHCenter |
Qt::AlignVCenter );
layer2Layout->setColumnStretch( 1, 1 );
layer2Layout->setColumnStretch( 3, 1 );
QGridLayout *layer3Layout = new QGridLayout();
layer3Layout->addWidget( driveLabel, 0, 0 );
layer3Layout->addWidget( driveMode, 1, 0 );
layer3Layout->addWidget( meteringLabel, 0, 1 );
layer3Layout->addWidget( meteringMode, 1, 1 );
layer3Layout->addWidget( whiteLabel, 0, 2 );
layer3Layout->addWidget( whiteBalance, 1, 2 );
QVBoxLayout *layout = new QVBoxLayout();
layout->addLayout( layer1Layout );
layout->addLayout( layer2Layout );
layout->addLayout( layer3Layout );
layout->setContentsMargins( 0, 5, 0, 5 );
return( layout );
}