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


C++ setIconSize函数代码示例

本文整理汇总了C++中setIconSize函数的典型用法代码示例。如果您正苦于以下问题:C++ setIconSize函数的具体用法?C++ setIconSize怎么用?C++ setIconSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: GetDefault

void MyColorButton::UpdateColor()
{
	GetDefault();
	QColor color(currentValue.R / 256, currentValue.G / 256, currentValue.B / 256);
	painter->fillRect(QRect(0, 0, w, h), color);
	painter->drawRect(0,0,w-1,h-1);

	if(!(defaultValue.R / 256 == currentValue.R / 256 && defaultValue.G / 256 == currentValue.G / 256 && defaultValue.B / 256 == currentValue.B / 256))
	{
		// not (almost) default color -> make border thicker to indicate non default value
		painter->drawRect(1,1,w-3,h-3);
	}

	QIcon icon(*pix);
	setIcon(icon);
	setIconSize(QSize(w, h));
}
开发者ID:pakokrew,项目名称:mandelbulber2,代码行数:17,代码来源:mycolorbutton.cpp

示例2: initStyleOption

void KoColorPopupButton::resizeEvent(QResizeEvent *e)
{
    QStyleOptionToolButton opt;
    initStyleOption(&opt);
    QSize size = iconSize();

    QSize rect = style()->sizeFromContents(QStyle::CT_ToolButton, &opt, size, this);
    int iconWidth = size.width() - rect.width() + e->size().width();

    if (iconWidth != size.width()) {
        size.setWidth(iconWidth);
        setIconSize(size);
    }
    QToolButton::resizeEvent(e);

    emit iconSizeChanged();
}
开发者ID:ChrisJong,项目名称:krita,代码行数:17,代码来源:KoColorPopupButton.cpp

示例3: QTabWidget

TabSupervisor::TabSupervisor(AbstractClient *_client, QWidget *parent)
    : QTabWidget(parent), userInfo(0), client(_client), tabServer(0), tabUserLists(0), tabDeckStorage(0), tabReplays(0), tabAdmin(0), tabLog(0)
{
    setElideMode(Qt::ElideRight);
    setMovable(true);
    setIconSize(QSize(15, 15));
    connect(this, SIGNAL(currentChanged(int)), this, SLOT(updateCurrent(int)));

    connect(client, SIGNAL(roomEventReceived(const RoomEvent &)), this, SLOT(processRoomEvent(const RoomEvent &)));
    connect(client, SIGNAL(gameEventContainerReceived(const GameEventContainer &)), this, SLOT(processGameEventContainer(const GameEventContainer &)));
    connect(client, SIGNAL(gameJoinedEventReceived(const Event_GameJoined &)), this, SLOT(gameJoined(const Event_GameJoined &)));
    connect(client, SIGNAL(userMessageEventReceived(const Event_UserMessage &)), this, SLOT(processUserMessageEvent(const Event_UserMessage &)));
    connect(client, SIGNAL(maxPingTime(int, int)), this, SLOT(updatePingTime(int, int)));
    connect(client, SIGNAL(notifyUserEventReceived(const Event_NotifyUser &)), this, SLOT(processNotifyUserEvent(const Event_NotifyUser &)));
    
    retranslateUi();
}
开发者ID:DINKIN,项目名称:Cockatrice,代码行数:17,代码来源:tab_supervisor.cpp

示例4: QTreeWidget

PlayerListWidget::PlayerListWidget(QWidget *parent)
	: QTreeWidget(parent), gameStarted(false)
{
	readyIcon = QIcon(":/resources/icon_ready_start.svg");
	notReadyIcon = QIcon(":/resources/icon_not_ready_start.svg");
	concededIcon = QIcon(":/resources/icon_conceded.svg");
	playerIcon = QIcon(":/resources/icon_player.svg");
	spectatorIcon = QIcon(":/resources/icon_spectator.svg");

	setMinimumHeight(100);
	setIconSize(QSize(20, 15));
	setColumnCount(6);
	setRootIsDecorated(false);
	setSelectionMode(NoSelection);
	header()->setResizeMode(QHeaderView::ResizeToContents);
	retranslateUi();
}
开发者ID:Enoctil,项目名称:cockatrice,代码行数:17,代码来源:playerlistwidget.cpp

示例5: QListWidget

SymbolView::SymbolView(QWidget* parent) : QListWidget(parent)
{
	setDragEnabled(true);
	setViewMode(QListView::IconMode);
	setFlow(QListView::LeftToRight);
	setSortingEnabled(true);
	setWrapping(true);
	setAcceptDrops(true);
	setDropIndicatorShown(true);
	setDragDropMode(QAbstractItemView::DragDrop);
	setResizeMode(QListView::Adjust);
	setSelectionMode(QAbstractItemView::SingleSelection);
	setContextMenuPolicy(Qt::CustomContextMenu);
	delegate = new ScListWidgetDelegate(this, this);
	setItemDelegate(delegate);
	setIconSize(QSize(48, 48));
	connect(this, SIGNAL(customContextMenuRequested (const QPoint &)), this, SLOT(HandleContextMenu(QPoint)));
}
开发者ID:pvanek,项目名称:scribus-cuba-trunk,代码行数:18,代码来源:symbolpalette.cpp

示例6: QToolBar

ToolBar::ToolBar(QWidget* parent) : QToolBar(parent)
{
	setIconSize(QSize(24, 24));
	setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);

	addAction(QIcon(":/Resource/Generic/Settings.png"), "", this, SIGNAL(settingsTriggered()))->setToolTip(tr("Settings"));

	QWidget* spacer = new QWidget(this);
	spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
	addWidget(spacer);

	addAction(QIcon(":/Resource/Network/Connect.png"), "", this, SIGNAL(connectTriggered()))->setToolTip(tr("Connect"));
	addAction(QIcon(":/Resource/Generic/Add.png"), "", this, SIGNAL(joinTriggered()))->setToolTip(tr("Add view"));

	QLineEdit lineEdit;
	lineEdit.setStyleSheet("QLineEdit { border: 1px solid transparent; }");
	setFixedHeight(28);
}
开发者ID:aboduo,项目名称:quazaa,代码行数:18,代码来源:toolbar.cpp

示例7: QToolButton

QgsMultiEditToolButton::QgsMultiEditToolButton( QWidget *parent )
  : QToolButton( parent )
{
  setFocusPolicy( Qt::StrongFocus );

  // set default tool button icon properties
  setFixedSize( 22, 22 );
  setStyleSheet( QStringLiteral( "QToolButton{ background: none; border: 1px solid rgba(0, 0, 0, 0%);} QToolButton:focus { border: 1px solid palette(highlight); }" ) );
  setIconSize( QSize( 16, 16 ) );
  setPopupMode( QToolButton::InstantPopup );

  mMenu = new QMenu( this );
  connect( mMenu, &QMenu::aboutToShow, this, &QgsMultiEditToolButton::aboutToShowMenu );
  setMenu( mMenu );

  // sets initial appearance
  updateState();
}
开发者ID:CS-SI,项目名称:QGIS,代码行数:18,代码来源:qgsmultiedittoolbutton.cpp

示例8: QToolButton

QedTimeButton::QedTimeButton(QWidget *parent) : QToolButton(parent)
{
    my.state = Timeless;
    setIconSize(QSize(52, 52));
    setFocusPolicy(Qt::NoFocus);
    my.forwardLiveIcon = QIcon(":/images/play_live.png");
    my.stoppedLiveIcon = QIcon(":/images/stop_live.png");
    my.forwardRecordIcon = QIcon(":/images/play_record.png");
    my.stoppedRecordIcon = QIcon(":/images/stop_record.png");
    my.forwardArchiveIcon = QIcon(":/images/play_archive.png");
    my.stoppedArchiveIcon = QIcon(":/images/stop_archive.png");
    my.backwardArchiveIcon = QIcon(":/images/back_archive.png");
    my.stepForwardArchiveIcon = QIcon(":/images/stepfwd_archive.png");
    my.stepBackwardArchiveIcon = QIcon(":/images/stepback_archive.png");
    my.fastForwardArchiveIcon = QIcon(":/images/fastfwd_archive.png");
    my.fastBackwardArchiveIcon = QIcon(":/images/fastback_archive.png");
    console->post(QedApp::DebugUi, "Time button resources loaded");
}
开发者ID:ColeJackes,项目名称:pcp,代码行数:18,代码来源:qed_timebutton.cpp

示例9: TabsTreeView

        TabsTreeView( QWidget *parent = 0 )
            : Amarok::PrettyTreeView( parent )
        {
            setAttribute( Qt::WA_NoSystemBackground );
            viewport()->setAutoFillBackground( false );

            setHeaderHidden( true );
            setIconSize( QSize( 36, 36 ) );
            setDragDropMode( QAbstractItemView::DragOnly );
            setSelectionMode( QAbstractItemView::SingleSelection );
            setSelectionBehavior( QAbstractItemView::SelectItems );
            setAnimated( true );
            setRootIsDecorated( false );
            setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
            setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
            setFixedWidth( 48 );

        }
开发者ID:ErrAza,项目名称:amarok,代码行数:18,代码来源:TabsView.cpp

示例10: width

// private
// LOOPT: This gets called twice on KolourPaint startup by:
//
//            1. setColorSimilarityInternal() called by the ctor
//            2. resizeEvent() when it's first shown()
//
//        We could get rid of the first and save a few milliseconds.
void kpColorSimilarityToolBarItem::updateIcon ()
{
    const int side = width () * 6 / 8;
#if DEBUG_KP_COLOR_SIMILARITY_TOOL_BAR_ITEM
    qCDebug(kpLogWidgets) << "kpColorSimilarityToolBarItem::updateIcon() width=" << width ()
              << " side=" << side << endl;
#endif

    QPixmap icon(side, side);
    icon.fill(Qt::transparent);

    kpColorSimilarityCubeRenderer::Paint (&icon,
        0/*x*/, 0/*y*/, side,
        colorSimilarity (), m_flashHighlight);

    setIconSize(QSize(side, side));
    setIcon(icon);
}
开发者ID:KDE,项目名称:kolourpaint,代码行数:25,代码来源:kpColorSimilarityToolBarItem.cpp

示例11: QListWidget

PageLayoutsWidget::PageLayoutsWidget(QWidget* parent) : QListWidget(parent)
{
	setDragEnabled(false);
	setViewMode(QListView::IconMode);
	setFlow(QListView::LeftToRight);
	setSortingEnabled(false);
	setWrapping(false);
	setWordWrap(true);
	setAcceptDrops(false);
	setDropIndicatorShown(false);
	setDragDropMode(QAbstractItemView::NoDragDrop);
	setResizeMode(QListView::Adjust);
	setSelectionMode(QAbstractItemView::SingleSelection);
	setFocusPolicy(Qt::NoFocus);
	setIconSize(QSize(32, 32));
	clear();
	setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
}
开发者ID:AlterScribus,项目名称:ece15,代码行数:18,代码来源:newfile.cpp

示例12: QPushButton

State2Button::State2Button(QWidget* parent, QString* path_enabled, QString* path_disabled, bool active) : QPushButton(parent) {
	setFlat(true);
	setFocusPolicy(Qt::NoFocus);
	resize(QSize(25, 25));
	setIconSize(QSize(23, 23));

	if (path_enabled != NULL)
		iconEnabled = new QIcon(RES->directory_qt + *path_enabled);
	if (path_disabled != NULL)
		iconDisabled = new QIcon(RES->directory_qt + *path_disabled);

	if (active)
		enable();
	else
		disable();

	QObject::connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()), Qt::DirectConnection);
}
开发者ID:FlorianPO,项目名称:SpriteEditor,代码行数:18,代码来源:State2Button.cpp

示例13: KToolBar

ThumbnailController::ThumbnailController( QWidget * parent, ThumbnailList * list )
    : KToolBar( parent, "ThumbsControlBar" )
{
    // change toolbar appearance
    setMargin( 3 );
    setFlat( true );
    setIconSize( 16 );
    setMovingEnabled( false );

    // insert a togglebutton [show only bookmarked pages]
    //insertSeparator();
    insertButton( "bookmark", FILTERB_ID, SIGNAL( toggled( bool ) ),
                  list, SLOT( slotFilterBookmarks( bool ) ),
                  true, i18n( "Show bookmarked pages only" ) );
    setToggle( FILTERB_ID );
    setButton( FILTERB_ID, KpdfSettings::filterBookmarks() );
    //insertLineSeparator();
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:18,代码来源:thumbnaillist.cpp

示例14: AlbumsTreeView

        AlbumsTreeView( QWidget *parent = 0 )
            : Amarok::PrettyTreeView( parent )
        {
            setAttribute( Qt::WA_NoSystemBackground );
            viewport()->setAutoFillBackground( false );

            setHeaderHidden( true );
            setIconSize( QSize(60,60) );
            setDragDropMode( QAbstractItemView::DragOnly );
            setSelectionMode( QAbstractItemView::ExtendedSelection );
            setSelectionBehavior( QAbstractItemView::SelectItems );
            //setAnimated( true ); // looks TERRIBLE
            
            setRootIsDecorated( false );

            setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
            setVerticalScrollMode( QAbstractItemView::ScrollPerPixel ); // Scrolling per item is really not smooth and looks terrible
        }
开发者ID:weiligang512,项目名称:apue-test,代码行数:18,代码来源:AlbumsView.cpp

示例15: connect

	void SBWidget::AddTrayAction (QAction *act)
	{
		connect (act,
				SIGNAL (destroyed (QObject*)),
				this,
				SLOT (handleTrayActDestroyed ()));

		auto tb = new QToolButton;
		const int w = maximumWidth () - TrayLay_->margin () * 4;
		tb->setMaximumSize (w, w);
		tb->setIconSize (IconSize_);
		tb->setAutoRaise (true);
		tb->setDefaultAction (act);
		tb->setPopupMode (QToolButton::DelayedPopup);
		TrayAct2Button_ [act] = tb;

		TrayLay_->addWidget (tb);
	}
开发者ID:Akon32,项目名称:leechcraft,代码行数:18,代码来源:sbwidget.cpp


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