本文整理汇总了C++中QToolButton::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolButton::resize方法的具体用法?C++ QToolButton::resize怎么用?C++ QToolButton::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QToolButton
的用法示例。
在下文中一共展示了QToolButton::resize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: listPlugins
void OptionsTabPlugins::listPlugins()
{
if ( !w )
return;
OptPluginsUI *d = (OptPluginsUI *)w;
d->tw_Plugins->clear();
PluginManager *pm=PluginManager::instance();
QStringList plugins = pm->availablePlugins();
plugins.sort();
const QSize buttonSize = QSize(21,21);
foreach ( const QString& plugin, plugins ){
QIcon icon = pm->icon(plugin);
bool enabled = pm->isEnabled(plugin);
const QString path = pm->pathToPlugin(plugin);
QString toolTip = tr("Plugin Path:\n%1").arg(path);
Qt::CheckState state = enabled ? Qt::Checked : Qt::Unchecked;
QTreeWidgetItem *item = new QTreeWidgetItem(d->tw_Plugins, QTreeWidgetItem::Type);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setText(C_NAME, plugin);
item->setText(C_VERSION, pm->version(plugin));
item->setTextAlignment(C_VERSION, Qt::AlignHCenter);
item->setToolTip(C_NAME, toolTip);
item->setCheckState(C_NAME, state);
if ( !enabled ) {
icon = QIcon(icon.pixmap(icon.availableSizes().at(0), QIcon::Disabled));
}
item->setIcon(C_NAME,icon);
QString shortName = PluginManager::instance()->shortName(plugin);
QToolButton *aboutbutton = new QToolButton(d->tw_Plugins);
aboutbutton->setIcon(QIcon(IconsetFactory::iconPixmap("psi/info")));
aboutbutton->resize(buttonSize);
aboutbutton->setObjectName("ab_" + shortName);
aboutbutton->setToolTip(tr("Show information about plugin"));
connect(aboutbutton, SIGNAL(clicked()), this, SLOT(showPluginInfo()));
d->tw_Plugins->setItemWidget(item, C_ABOUT, aboutbutton);
QToolButton *settsbutton = new QToolButton(d->tw_Plugins);
settsbutton->setIcon(QIcon(IconsetFactory::iconPixmap("psi/options")));
settsbutton->resize(buttonSize);
settsbutton->setObjectName("sb_" + shortName);
settsbutton->setToolTip(tr("Open plugin settings dialog"));
connect(settsbutton, SIGNAL(clicked()), this, SLOT(settingsClicked()));
settsbutton->setEnabled(enabled);
d->tw_Plugins->setItemWidget(item, C_SETTS, settsbutton);
}
示例2: GetUpdate
QToolButton* PackagesDelegate::GetUpdate (const QModelIndex& index) const
{
int row = index.row ();
if (!Row2Update_.contains (row))
{
QAction *action = new QAction (Core::Instance ()
.GetProxy ()->GetIcon ("update"),
tr ("Update"),
Viewport_);
action->setCheckable (true);
action->setProperty ("Role", "Update");
connect (action,
SIGNAL (triggered ()),
this,
SLOT (handleAction ()));
QToolButton *toolButton = new QToolButton ();
toolButton->resize (CActionsSize, CActionsSize);
toolButton->setDefaultAction (action);
Row2Update_ [row] = toolButton;
}
QToolButton *button = Row2Update_ [row];
QAction *action = button->defaultAction ();
bool upgradable = index.data (PackagesModel::PMRUpgradable).toBool ();
action->setEnabled (upgradable);
action->setData (index.data (PackagesModel::PMRPackageID));
WasUpgradable_ [index] = upgradable;
return button;
}
示例3: 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));
}
示例4: GetInstallRemove
QToolButton* PackagesDelegate::GetInstallRemove (const QModelIndex& index) const
{
int row = index.row ();
if (!Row2InstallRemove_.contains (row))
{
QAction *action = new QAction (Viewport_);
action->setCheckable (true);
action->setProperty ("Role", "InstallRemove");
connect (action,
SIGNAL (triggered ()),
this,
SLOT (handleAction ()));
QToolButton *toolButton = new QToolButton ();
toolButton->resize (CActionsSize, CActionsSize);
toolButton->setDefaultAction (action);
Row2InstallRemove_ [row] = toolButton;
}
QToolButton *button = Row2InstallRemove_ [row];
bool installed = index.data (PackagesModel::PMRInstalled).toBool ();
QString label;
QString iconName;
if (installed)
{
label = tr ("Remove");
iconName = "remove";
}
else
{
label = tr ("Install");
iconName = "addjob";
}
QAction *action = button->defaultAction ();
WasInstalled_ [index] = installed;
action->setText (label);
action->setIcon (Core::Instance ().GetProxy ()->GetIcon (iconName));
action->setData (index.data (PackagesModel::PMRPackageID));
action->setProperty ("Installed", index.data (PackagesModel::PMRInstalled));
return button;
}