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


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

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


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

示例1: setupTabWidget

/**
 * Setup the tab widget.
 * @param w
 */
void DTabbedMainWindow::setupTabWidget(QTabWidget *w)
{
    w->setFocusPolicy(Qt::NoFocus);

    if ( ! w->cornerWidget( Qt::TopRightCorner ) )
    {
        QToolButton *closeButton = new QToolButton(w);
        QPixmap closepx(16, 16);
        closepx.fill(Qt::transparent);

        QPainter p(&closepx);
        p.initFrom(this);

        p.setPen(QPen(palette().buttonText() , 4));
        p.drawLine(0, 0, 15,15);
        p.drawLine(0,15, 15, 0);


        p.end();

        closeButton->setIcon(closepx);
        closeButton->adjustSize();
        closeButton->hide();

        w->setCornerWidget(closeButton, Qt::TopRightCorner);

        connect(closeButton, SIGNAL(clicked()), this, SLOT(closeCurrentTab()));
    }

    connect(w, SIGNAL(currentChanged ( int)), this, SLOT(emitWidgetChanged( int )));
}
开发者ID:BackupTheBerlios,项目名称:adresis-svn,代码行数:35,代码来源:dtabbedmainwindow.cpp

示例2: clearIcon

dtkSearchField::dtkSearchField(QWidget *parent) : QWidget(parent)
{
    QLineEdit *lineEdit = new QLineEdit(this);
    connect(lineEdit, SIGNAL(textChanged(QString)),
            this, SIGNAL(textChanged(QString)));
    connect(lineEdit, SIGNAL(editingFinished()),
            this, SIGNAL(editingFinished()));
    connect(lineEdit, SIGNAL(textChanged(QString)),
            this, SLOT(setText(QString)));

    QToolButton *clearButton = new QToolButton(this);
    QPixmap clearIcon(QString(":/Qocoa/qsearchfield_nonmac.png"));
    clearButton->setIcon(QIcon(clearIcon));
    clearButton->setIconSize(clearIcon.size());
    clearButton->setFixedSize(clearIcon.size());
    clearButton->setStyleSheet("border: none;");
    clearButton->hide();
    connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));

    d = new dtkSearchFieldPrivate(this, lineEdit, clearButton);

    lineEdit->setStyleSheet(QString("QLineEdit { padding-right: %1px; } ").arg(d->clearButtonPaddedWidth()));
    const int width = qMax(lineEdit->minimumSizeHint().width(), d->clearButtonPaddedWidth());
    const int height = qMax(lineEdit->minimumSizeHint().height(), d->clearButtonPaddedHeight());
    lineEdit->setMinimumSize(width, height);

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setMargin(0);
    layout->addWidget(lineEdit);
}
开发者ID:NicolasSchnitzler,项目名称:dtk,代码行数:30,代码来源:dtkSearchField.cpp

示例3: button

QToolButton* PanIconWidget::button()
{
    QToolButton* btn = new QToolButton;
    btn->setToolButtonStyle(Qt::ToolButtonIconOnly);
    btn->setIcon(SmallIcon("transform-move"));
    btn->hide();
    btn->setToolTip( i18n("Pan the image to a region"));
    return btn;
}
开发者ID:rosedu,项目名称:digikam,代码行数:9,代码来源:paniconwidget.cpp

示例4: load

bool StatusBar::load(CoreI *core) {
	menuMapper = new QSignalMapper(this);
	connect(menuMapper, SIGNAL(mapped(QObject *)), this, SLOT(actionTriggered(QObject *)));

	core_i = core;
	if((main_win_i = (MainWindowI *)core_i->get_interface(INAME_MAINWINDOW)) == 0) return false;
	if((icons_i = (IconsI *)core_i->get_interface(INAME_ICONS)) == 0) return false;
	if((accounts_i = (AccountsI *)core_i->get_interface(INAME_ACCOUNTS)) == 0) return false;
	if((menus_i = (MenusI *)core_i->get_interface(INAME_MENUS)) == 0) return false;

	if((events_i = (EventsI *)core_i->get_interface(INAME_EVENTS)) == 0) return false;
	events_i->add_event_listener(this, UUID_ACCOUNT_CHANGED);

	status_bar = new QStatusBar();
	main_win_i->set_status_bar(status_bar);

	toolbuttons = new QWidget(status_bar);
	toolbuttons->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
	toolButtonLayout = new QHBoxLayout(toolbuttons);
	toolButtonLayout->setSpacing(6);
	toolButtonLayout->setMargin(4);
	toolbuttons->setLayout(toolButtonLayout);
	status_bar->addWidget(toolbuttons);

	QToolButton *tb = new QToolButton();
	tb->setIcon(icons_i->get_icon("generic"));
	tb->setToolTip("Global Status");

	QMenu *menu = menus_i->get_menu("Global Status");
	//connect(proto, SIGNAL(local_status_change(const QString &, const QString &, GlobalStatus)) , this, SLOT(local_status_change(const QString &, const QString &, GlobalStatus)));
	each_contact_status(gs) {
		QAction *a = menus_i->add_menu_action("Global Status", hr_status_name[gs], status_name[gs]);
		a->setData(gs);
		connect(a, SIGNAL(triggered()), menuMapper, SLOT(map()));
		menuMapper->setMapping(a, a);
	}
	menus_i->add_menu_action("Global Status", "Global Status", "generic");
	menus_i->add_menu_separator("Global Status", menu->actions().at(1));

	tb->setMenu(menu);
	tb->setPopupMode(QToolButton::InstantPopup);
	tb->hide();
	status_bar->addPermanentWidget(tb);
	globalButton = tb;

	return true;
}
开发者ID:mtux,项目名称:sjae,代码行数:47,代码来源:statusbar.cpp

示例5: QWidget

ManageBox::ManageBox(const QString & nameprefix, bool enable_clone, QWidget *parent)
            : QWidget(parent)
{

    namePrefix = nameprefix;
    // Management Buttons on the right top
    QHBoxLayout *manageBoxLayout = new QHBoxLayout;

    QToolButton *cloneButton = new QToolButton(this);
    if (enable_clone) {
        if (namePrefix.startsWith('S')) {
            cloneAction = new QAction(QIcon(seqwavcp_xpm), tr("&Clone..."), this);
        }
        else {
            cloneAction = new QAction(QIcon(lfowavcp_xpm), tr("&Clone..."), this);
        }
        cloneAction->setToolTip(tr("Duplicate this Module in muted state"));
        cloneButton->setDefaultAction(cloneAction);
        connect(cloneAction, SIGNAL(triggered()), this, SLOT(moduleClone()));
    }
    else cloneButton->hide();
    renameAction = new QAction(QIcon(arprename_xpm), tr("&Rename..."), this);
    renameAction->setToolTip(tr("Rename this Module"));
    QToolButton *renameButton = new QToolButton(this);
    renameButton->setDefaultAction(renameAction);
    connect(renameAction, SIGNAL(triggered()), this, SLOT(moduleRename()));

    deleteAction = new QAction(QIcon(arpremove_xpm), tr("&Delete..."), this);
    deleteAction->setToolTip(tr("Delete this Module"));
    QToolButton *deleteButton = new QToolButton(this);
    deleteButton->setDefaultAction(deleteAction);
    connect(deleteAction, SIGNAL(triggered()), this, SLOT(moduleDelete()));

    manageBoxLayout->addStretch();
    manageBoxLayout->addWidget(cloneButton);
    manageBoxLayout->addWidget(renameButton);
    manageBoxLayout->addWidget(deleteButton);

    setLayout(manageBoxLayout);
}
开发者ID:milkmiruku,项目名称:qmidiarp,代码行数:40,代码来源:managebox.cpp


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