SecondaryWindow::SecondaryWindow(bool showToolbar, QString name, QUrl baseUrl,
                                 QWidget* pParent, WebPage* pOpener,
                                 bool allowExternalNavigate) :
    BrowserWindow(showToolbar, true, name, baseUrl, pParent, pOpener,
                  allowExternalNavigate)
{
   setAttribute(Qt::WA_QuitOnClose, true);
   setAttribute(Qt::WA_DeleteOnClose, true);

#ifdef Q_OS_MAC
   setIconSize(QSize(26, 22));
#else
   setIconSize(QSize(26, 20));
#endif

   back_ = pToolbar_->addAction(icon("back"), QString::fromUtf8("Back"));
   back_->setToolTip(QString::fromUtf8("Back"));
   connect(back_, SIGNAL(triggered()),
           webView(), SLOT(back()));

   forward_ = pToolbar_->addAction(icon("forward"), QString::fromUtf8("Forward"));
   forward_->setToolTip(QString::fromUtf8("Forward"));
   connect(forward_, SIGNAL(triggered()),
           webView(), SLOT(forward()));

   reload_ = pToolbar_->addAction(icon("reload"), QString::fromUtf8("Reload"));
   reload_->setToolTip(QString::fromUtf8("Reload"));
   connect(reload_, SIGNAL(triggered()),
           webView(), SLOT(reload()));

   connect(webView(), SIGNAL(loadStarted()),
           this, SLOT(manageCommandState()));
   connect(webView(), SIGNAL(urlChanged(QUrl)),
           this, SLOT(manageCommandState()));

   manageCommandState();

   // Size it (use computed size if it seems sane; otherwise let Qt set it)
   QSize size = QSize(850, 1100).boundedTo(
         QApplication::desktop()->availableGeometry().size());
   if (size.width() > 500 && size.height() > 500)
   {
      size.setHeight(size.height()-75);
      resize(size);
   }

   connect(webView(), SIGNAL(onCloseWindowShortcut()),
           this, SLOT(onCloseWindowShortcut()));
}
Example #2
0
WidgetBoxCategoryListView::WidgetBoxCategoryListView(QDesignerFormEditorInterface *core, QWidget *parent) :
    QListView(parent),
    m_proxyModel(new QSortFilterProxyModel(this)),
    m_model(new WidgetBoxCategoryModel(core, this))
{
    setFocusPolicy(Qt::NoFocus);
    setFrameShape(QFrame::NoFrame);
    setIconSize(QSize(22, 22));
    setSpacing(1);
    setTextElideMode(Qt::ElideMiddle);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setResizeMode(QListView::Adjust);
    setUniformItemSizes(true);

    setItemDelegate(new WidgetBoxCategoryEntryDelegate(this));

    connect(this, SIGNAL(pressed(QModelIndex)), this, SLOT(slotPressed(QModelIndex)));
    setEditTriggers(QAbstractItemView::AnyKeyPressed);

    m_proxyModel->setSourceModel(m_model);
    m_proxyModel->setFilterRole(FilterRole);
    setModel(m_proxyModel);
    connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(scratchPadChanged()));
}
CategoryFilterWidget::CategoryFilterWidget(QWidget *parent)
    : QTreeView(parent)
{
    auto *proxyModel = new CategoryFilterProxyModel(this);
    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    proxyModel->setSourceModel(new CategoryFilterModel(this));
    setModel(proxyModel);
    setFrameShape(QFrame::NoFrame);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    setUniformRowHeights(true);
    setHeaderHidden(true);
    setIconSize(Utils::Gui::smallIconSize());
#ifdef Q_OS_MAC
    setAttribute(Qt::WA_MacShowFocusRect, false);
#endif
    m_defaultIndentation = indentation();
    if (!BitTorrent::Session::instance()->isSubcategoriesEnabled())
        setIndentation(0);
    setContextMenuPolicy(Qt::CustomContextMenu);
    sortByColumn(0, Qt::AscendingOrder);
    setCurrentIndex(model()->index(0, 0));

    connect(this, &QTreeView::collapsed, this, &CategoryFilterWidget::callUpdateGeometry);
    connect(this, &QTreeView::expanded, this, &CategoryFilterWidget::callUpdateGeometry);
    connect(this, &QWidget::customContextMenuRequested, this, &CategoryFilterWidget::showMenu);
    connect(selectionModel(), &QItemSelectionModel::currentRowChanged
            , this, &CategoryFilterWidget::onCurrentRowChanged);
    connect(model(), &QAbstractItemModel::modelReset, this, &CategoryFilterWidget::callUpdateGeometry);
}
BaseFilterWidget::BaseFilterWidget(QWidget *parent, TransferListWidget *transferList)
    : QListWidget(parent)
    , transferList(transferList)
{
    setFrameShape(QFrame::NoFrame);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    setUniformItemSizes(true);
    setSpacing(0);

    setIconSize(Utils::Gui::smallIconSize());

#if defined(Q_OS_MAC)
    setAttribute(Qt::WA_MacShowFocusRect, false);
#endif

    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, &BaseFilterWidget::customContextMenuRequested, this, &BaseFilterWidget::showMenu);
    connect(this, &BaseFilterWidget::currentRowChanged, this, &BaseFilterWidget::applyFilter);

    connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentAdded
            , this, &BaseFilterWidget::handleNewTorrent);
    connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentAboutToBeRemoved
            , this, &BaseFilterWidget::torrentAboutToBeDeleted);
}
Example #5
0
void UWPButton::mousePressEvent(QMouseEvent *event)
{
    if( isEnabled() && !m_PressedIcon.isNull() )
        setIcon(m_PressedIcon);
    setIconSize(iconSize()*res);
    QPushButton::mousePressEvent(event);
}
ColorSelect::ColorSelect(QWidget *parent, bool showByLayer, bool showByBlock) :
    QComboBox(parent) {

    qIconSize = QSize(32, 32);
    setIconSize(qIconSize);

    setMaximumHeight(32);

    if(showByLayer) {
        addItem(BY_LAYER);
    }
    if(showByBlock) {
        addItem(BY_BLOCK);
    }

    addItem(CUSTOM);
    insertSeparator(count());

    for(auto color : QColor::colorNames()){
        QPixmap pixmap(qIconSize);
        pixmap.fill(color);
        addItem(QIcon(pixmap), color);
    }

    connect(this, SIGNAL(activated(const QString&)), this, SLOT(onActivated(const QString&)));
}
MusicToolSetsWidget::MusicToolSetsWidget(QWidget *parent)
    : QListWidget(parent)
{
    setAttribute(Qt::WA_TranslucentBackground, true);
    setFrameShape(QFrame::NoFrame);//Set No Border
    setStyleSheet(MusicUIObject::MScrollBarStyle01);
    setIconSize(QSize(60, 60));
    setViewMode(QListView::IconMode);
    setMovement(QListView::Static);

#ifdef Q_OS_WIN
    setSpacing(17);
    addListWidgetItem();
#else
    setSpacing(16);
    QTimer::singleShot(1, this, SLOT(addListWidgetItem()));
#endif
    MusicUtils::UWidget::setTransparent(this, 50);
    connect(this, SIGNAL(itemClicked(QListWidgetItem*)),
                  SLOT(itemHasClicked(QListWidgetItem*)));

    M_CONNECTION_PTR->setValue(getClassName(), this);
    M_CONNECTION_PTR->poolConnect(getClassName(), MusicApplication::getClassName());
    M_CONNECTION_PTR->poolConnect(getClassName(), MusicLeftAreaWidget::getClassName());
}
Example #8
0
// DkCropToolbar --------------------------------------------------------------------
DkCropToolBar::DkCropToolBar(const QString & title, QWidget * parent /* = 0 */) : QToolBar(title, parent) {

	createIcons();
	createLayout();
	QMetaObject::connectSlotsByName(this);

	if (DkSettings::display.smallIcons)
		setIconSize(QSize(16, 16));
	else
		setIconSize(QSize(32, 32));

	if (DkSettings::display.toolbarGradient) 
		setObjectName("toolBarWithGradient");
	else
		setStyleSheet("QToolBar{spacing: 3px; padding: 3px;}");
}
UIGuestOSTypeSelectionButton::UIGuestOSTypeSelectionButton(QWidget *pParent)
    : QIWithRetranslateUI<QPushButton>(pParent)
{
    /* Determine icon metric: */
    const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
    setIconSize(QSize(iIconMetric, iIconMetric));

    /* We have to make sure that the button has strong focus, otherwise
     * the editing is ended when the menu is shown: */
    setFocusPolicy(Qt::StrongFocus);

    /* Create a signal mapper so that we not have to react to
     * every single menu activation ourself: */
    m_pSignalMapper = new QSignalMapper(this);
    if (m_pSignalMapper)
        connect(m_pSignalMapper, static_cast<void(QSignalMapper::*)(const QString &)>(&QSignalMapper::mapped),
                this, &UIGuestOSTypeSelectionButton::setOSTypeId);

    /* Create main menu: */
    m_pMainMenu = new QMenu(pParent);
    if (m_pMainMenu)
        setMenu(m_pMainMenu);

    /* Apply language settings: */
    retranslateUi();
}
NBTrashView::NBTrashView( NBTrashModel *model, QWidget *parent ) : QTreeView( parent ) {

	setRootIsDecorated( false );
	setIconSize( QSize( 24, 24 ) );

	setModel( model );

	setSelectionMode( QAbstractItemView::ExtendedSelection );
	setSelectionBehavior( QAbstractItemView::SelectRows );

	#if QT_VERSION >= 0x050000
		header()->setStretchLastSection( false );
		header()->setSectionResizeMode( 1, QHeaderView::Stretch );
		header()->resizeSection( 0, 250 );
		header()->resizeSection( 2, 100 );
		header()->resizeSection( 3, 150 );
	#else
		header()->setStretchLastSection( false );
		header()->setResizeMode( 1, QHeaderView::Stretch );
		header()->resizeSection( 0, 250 );
		header()->resizeSection( 2, 100 );
		header()->resizeSection( 3, 150 );
	#endif

	setAllColumnsShowFocus( true );
};
Example #11
0
ImageButton::ImageButton(QWidget* parent)
    : QPushButton(parent)
{
    setAutoDefault(false);
    setIconSize(QSize(100, 100));
    unsetImage();
    connect(this, SIGNAL(clicked()), this, SLOT(onClicked()));
}
Example #12
0
ListSoundItems::ListSoundItems(QWidget* const parent)
    : QListWidget(parent)
{
    setSelectionMode(QAbstractItemView::SingleSelection);
    setAcceptDrops(true);
    setSortingEnabled(false);
    setIconSize(QSize(32, 32));
}
Example #13
0
ToolButtonWidget::ToolButtonWidget(QWidget *parent) : QToolButton(parent)
{
	setAutoRaise(true);
	setContextMenuPolicy(Qt::NoContextMenu);

	ToolBarWidget *toolBar = qobject_cast<ToolBarWidget*>(parent);

	if (toolBar)
	{
		setIconSize(toolBar->iconSize());
		setMaximumButtonSize(toolBar->getMaximumButtonSize());
		setToolButtonStyle(toolBar->toolButtonStyle());

		connect(toolBar, SIGNAL(iconSizeChanged(QSize)), this, SLOT(setIconSize(QSize)));
		connect(toolBar, SIGNAL(maximumButtonSizeChanged(int)), this, SLOT(setMaximumButtonSize(int)));
		connect(toolBar, SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)), this, SLOT(setToolButtonStyle(Qt::ToolButtonStyle)));
	}
}
Example #14
0
PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
           : QTreeWidget( p ), p_intf(_p_intf)
{
    /* Properties */
    setFrameStyle( QFrame::NoFrame );
    setAttribute( Qt::WA_MacShowFocusRect, false );
    viewport()->setAutoFillBackground( false );
    setIconSize( QSize( 24,24 ) );
    setIndentation( 12 );
    setHeaderHidden( true );
    setRootIsDecorated( true );
    setAlternatingRowColors( false );

    /* drops */
    viewport()->setAcceptDrops(true);
    setDropIndicatorShown(true);
    invisibleRootItem()->setFlags( invisibleRootItem()->flags() & ~Qt::ItemIsDropEnabled );

#ifdef Q_OS_MAC
    setAutoFillBackground( true );
    QPalette palette;
    palette.setColor( QPalette::Window, QColor(209,215,226) );
    setPalette( palette );
#endif
    setMinimumHeight( 120 );

    /* Podcasts */
    podcastsParent = NULL;
    podcastsParentId = -1;

    /* Podcast connects */
    CONNECT( THEMIM, playlistItemAppended( int, int ),
             this, plItemAdded( int, int ) );
    CONNECT( THEMIM, playlistItemRemoved( int ),
             this, plItemRemoved( int ) );
    DCONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
              this, inputItemUpdate( input_item_t * ) );

    createItems();

    setRootIsDecorated( false );
    setIndentation( 5 );
    /* Expand at least to show level 2 */
    for ( int i = 0; i < topLevelItemCount(); i++ )
        expandItem( topLevelItem( i ) );

    /***
     * We need to react to both clicks and activation (enter-key) here.
     * We use curItem to avoid rebuilding twice.
     * See QStyle::SH_ItemView_ActivateItemOnSingleClick
     ***/
    curItem = NULL;
    CONNECT( this, itemActivated( QTreeWidgetItem *, int ),
             this, setSource( QTreeWidgetItem *) );
    CONNECT( this, itemClicked( QTreeWidgetItem *, int ),
             this, setSource( QTreeWidgetItem *) );
}
Example #15
0
ToolBar_Impl::ToolBar_Impl()
	: QToolBar(), WidgetInterface(), fArea(Qt::TopToolBarArea)
{
	QVariant value;
	value.setValue(&fActionGroups);
	setProperty("action_groups", value);
	setIconSize(QSize(32, 32));
	setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
}
Example #16
0
IconPickerDialog::IconPickerDialog(QWidget *parent) :
	QDialog(parent),
	ui(new Ui::IconPickerDialog)
{
    MultiMCPlatform::fixWM_CLASS(this);
	ui->setupUi(this);
	setWindowModality(Qt::WindowModal);
	
	auto contentsWidget = ui->iconView;
	contentsWidget->setViewMode(QListView::IconMode);
	contentsWidget->setFlow(QListView::LeftToRight);
	contentsWidget->setIconSize(QSize(48, 48));
	contentsWidget->setMovement(QListView::Static);
	contentsWidget->setResizeMode(QListView::Adjust);
	contentsWidget->setSelectionMode(QAbstractItemView::SingleSelection);
	contentsWidget->setSpacing(5);
	contentsWidget->setWordWrap(false);
	contentsWidget->setWrapping(true);
	contentsWidget->setUniformItemSizes(true);
	contentsWidget->setTextElideMode(Qt::ElideRight);
	contentsWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
	contentsWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
	contentsWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	contentsWidget->setItemDelegate(new ListViewDelegate());
	
	//contentsWidget->setAcceptDrops(true);
	contentsWidget->setDropIndicatorShown(true);
	contentsWidget->viewport()->setAcceptDrops(true);
	contentsWidget->setDragDropMode(QAbstractItemView::DropOnly);
	contentsWidget->setDefaultDropAction(Qt::CopyAction);
	
	contentsWidget->installEventFilter(this);
	
	contentsWidget->setModel(MMC->icons().get());
	
	auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"),QDialogButtonBox::ResetRole);
	auto buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"),QDialogButtonBox::ResetRole);
	
	
	connect(buttonAdd,SIGNAL(clicked(bool)),SLOT(addNewIcon()));
	connect(buttonRemove,SIGNAL(clicked(bool)),SLOT(removeSelectedIcon()));
	
	connect
	(
		contentsWidget,
		SIGNAL(doubleClicked(QModelIndex)),
		SLOT(activated(QModelIndex))
	);
	
	connect
	(
		contentsWidget->selectionModel(),
		SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
		SLOT(selectionChanged(QItemSelection,QItemSelection))
	);
}
int QTabBar::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: currentChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: selected((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: setCurrentIndex((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: setCurrentTab((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 4: d_func()->_q_scrollTabs(); break;
        }
        _id -= 5;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< Shape*>(_v) = shape(); break;
        case 1: *reinterpret_cast< int*>(_v) = currentIndex(); break;
        case 2: *reinterpret_cast< int*>(_v) = count(); break;
        case 3: *reinterpret_cast< bool*>(_v) = drawBase(); break;
        case 4: *reinterpret_cast< QSize*>(_v) = iconSize(); break;
        case 5: *reinterpret_cast< Qt::TextElideMode*>(_v) = elideMode(); break;
        case 6: *reinterpret_cast< bool*>(_v) = usesScrollButtons(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setShape(*reinterpret_cast< Shape*>(_v)); break;
        case 1: setCurrentIndex(*reinterpret_cast< int*>(_v)); break;
        case 3: setDrawBase(*reinterpret_cast< bool*>(_v)); break;
        case 4: setIconSize(*reinterpret_cast< QSize*>(_v)); break;
        case 5: setElideMode(*reinterpret_cast< Qt::TextElideMode*>(_v)); break;
        case 6: setUsesScrollButtons(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Example #18
0
void MuseScore::updateIcons()
      {
      setIconSize(QSize(preferences.getInt(PREF_UI_THEME_ICONWIDTH) * guiScaling, preferences.getInt(PREF_UI_THEME_ICONHEIGHT) * guiScaling));
      for (QAction* a : fileTools->actions()) {
            QWidget* widget = fileTools->widgetForAction(a);
            QString className = widget->metaObject()->className();
            if (className != "Ms::AccessibleToolButton" && className != "QToolBarSeparator")
                  widget->setFixedHeight(preferences.getInt(PREF_UI_THEME_ICONHEIGHT) + 8);  // hack
                  // apparently needed for viewModeCombo, see MuseScore::populateFileOperations
            }
      }
Example #19
0
wavrImagePicker::wavrImagePicker(QWidget *parent, QList<QString>* source, int picSize, int columns, int* selected, int actionIndex)
    : QTableWidget(parent)
{
    setMouseTracking(true);

    setBackgroundRole(QPalette::Window);
    setIconSize(QSize(picSize, picSize));
    setFrameShape(QFrame::NoFrame);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setEditTriggers(QAbstractItemView::NoEditTriggers);
    setSelectionMode(QAbstractItemView::NoSelection);
    setShowGrid(false);
    horizontalHeader()->setVisible(false);
    verticalHeader()->setVisible(false);
    setStyleSheet("QTableWidget { padding: 4px }");	// padding around table

    max_col = columns;
    int max_row = qCeil(source->count() / (qreal)max_col);

    setColumnCount(max_col);
    setRowCount(max_row);

    int cellSize = picSize + 8;
    verticalHeader()->setDefaultSectionSize(cellSize);
    verticalHeader()->setMinimumSectionSize(cellSize);
    horizontalHeader()->setDefaultSectionSize(cellSize);
    horizontalHeader()->setMinimumSectionSize(cellSize);

    //	set min and max size of table, with padding included
    setMinimumSize(max_col * cellSize + 8, max_row * cellSize + 8);
    setMaximumSize(max_col * cellSize + 8, max_row * cellSize + 8);

    for(int i = 0; i < max_row; i++) {
        for(int j = 0; j < max_col; j++) {
            int k = (i * max_col) + j;

            QTableWidgetItem* item = new QTableWidgetItem();
            item->setData(TypeRole, 0);
            if(k < source->count()) {
                item->setIcon(QIcon(source->value(k)));
                item->setData(TypeRole, 1);
                item->setSizeHint(QSize(picSize, picSize));
                item->setBackground(this->palette().window());
            }
            setItem(i, j, item);
        }
    }

    this->actionIndex = actionIndex;
    this->selected = selected;
    this->hoverItem = NULL;
}
My_Layers::My_Layers()
        : QTableWidget()
{
        setShowGrid(TRUE);
        setFocusPolicy(Qt::NoFocus);
	setSelectionMode(QAbstractItemView::NoSelection);	//Seleziono io dal codice, che รจ meglio
        verticalHeader()->hide();
	horizontalHeader()->hide();		
	setEditTriggers(QAbstractItemView::NoEditTriggers);	//Le caselle non sono editabili

	setIconSize(QSize(20,20));	//Imposto tutte le icone sulla dimensione 20x20 pixel
}
GlyphButton::GlyphButton( QString thePix, QString theHoverPix, QString thePressed, QString thePressedHover )
   : pix( thePix ), hoverPix( theHoverPix ), pPix( thePressed ), pHoverPix( thePressedHover )
{
    setStyleSheet( "QPushButton:flat { border: none; }" );
    setCheckable( thePressed.size() && thePressedHover.size() );
    setFlat( true );
    setIcon( QIcon( ":/" + pix ) );
    QPixmap p = QPixmap( ":/" + pix );
    setIconSize( p.size() );
    setGeometry( 0, 0, p.width(), p.height() );
    connect( this, SIGNAL( toggled( bool ) ), this, SLOT( changedState( bool ) ) );
}
Example #22
0
myPushButton::myPushButton(QString picName,QString tipText,QWidget *parent) :
    QPushButton(parent)
{
    setToolTip(tipText);
    setFlat(true);
    setWindowOpacity(0);
    pixmap.load(":/img/sysButton/"+picName);
    iconWidth=pixmap.width()/3;
    iconHeight=pixmap.height();

    setIcon(QIcon(pixmap.copy(0,0,iconWidth,iconHeight)));
    setIconSize(QSize(iconWidth,iconHeight));
}
Example #23
0
ExtendedTabWidget::ExtendedTabWidget(QWidget *parent) :
    QTabWidget(parent)
{
    QTabBar* tb = new QTabBar(this);
    tb->setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab);
    setTabBar(tb);
    setMovable(true);
    setTabPosition(QTabWidget::North);
    setTabShape(QTabWidget::Rounded);
    setTabsClosable(true);
    setIconSize(QSize(32, 32));

    connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(onClose(int)));
}
void VerPreQToolButton::setBoton()
{
    BL_FUNC_DEBUG
    connect ( this, SIGNAL ( clicked() ), this, SLOT ( click() ) );
    setObjectName ( QString::fromUtf8 ( "exporta" ) );
    setStatusTip ( _("Ver presupuesto con la misma referencia") );
    setToolTip ( _("Ver presupuesto con la misma referencia") );
    setMinimumSize ( QSize ( 32, 32 ) );
    setMaximumSize ( QSize ( 32, 32 ) );
    setIcon ( QIcon ( QString::fromUtf8 ( ":/Images/client-quote.png" ) ) );
    setIconSize ( QSize ( 22, 22 ) );
    setContentsMargins ( 0, 0, 0, 0 );
    
}
Example #25
0
FStateButton::FStateButton(const QString &ficon, const QString &bicon, int buttonFlag, QWidget *parent):
    QPushButton(parent), fStateIcon(ficon), bStateIcon(bicon), bflag(buttonFlag)
{
    state = 0;
    if(bflag == 0)
    {
        setIcon(QIcon(fStateIcon));
        setIconSize(QPixmap(fStateIcon).size());
    }
    else if (bflag == 1)
    {
        setText(fStateIcon);;
    }
    connect(this, SIGNAL(clicked()), this, SLOT(changeState()));
}
Example #26
0
/*!
  \param pBreakPointsWidget - pointer to BreakpointsWidget
  */
BreakpointsTreeView::BreakpointsTreeView(BreakpointsWidget *pBreakPointsWidget)
  : QTreeView(pBreakPointsWidget)
{
  mpBreakpointsWidget = pBreakPointsWidget;
  setItemDelegate(new ItemDelegate(this));
  setTextElideMode(Qt::ElideMiddle);
  setIndentation(0);
  setIconSize(QSize(15, 15));
  setExpandsOnDoubleClick(false);
  setContextMenuPolicy(Qt::CustomContextMenu);
  setUniformRowHeights(true);
  createActions();
  connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showContextMenu(QPoint)));
  connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(breakPointDoubleClicked(QModelIndex)));
}
Example #27
0
QgsBrowser::QgsBrowser( QWidget *parent, Qt::WindowFlags flags )
    : QMainWindow( parent, flags )
    , mDirtyMetadata( true )
    , mDirtyPreview( true )
    , mDirtyAttributes( true )
    , mLayer( 0 )
    , mParamWidget( 0 )
    , mAttributeTableFilterModel( 0 )
{
  setupUi( this );

  // Disable tabs by default
  tabWidget->setTabEnabled( tabWidget->indexOf( paramTab ), false );
  tabWidget->setTabEnabled( tabWidget->indexOf( metaTab ), false );
  tabWidget->setTabEnabled( tabWidget->indexOf( previewTab ), false );
  tabWidget->setTabEnabled( tabWidget->indexOf( attributesTab ), false );

  mModel = new QgsBrowserModel( treeView );
  treeView->setModel( mModel );

  // Last expanded is stored, don't cover whole height with file system
  //treeView->expand( mModel->index(0,0) );

  connect( treeView, SIGNAL( clicked( const QModelIndex& ) ), this, SLOT( itemClicked( const QModelIndex& ) ) );

  treeView->setExpandsOnDoubleClick( false );
  connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( itemDoubleClicked( const QModelIndex& ) ) );
  connect( treeView, SIGNAL( expanded( const QModelIndex& ) ), this, SLOT( itemExpanded( const QModelIndex& ) ) );

  connect( tabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( tabChanged() ) );

  connect( mActionNewVectorLayer, SIGNAL( triggered() ), this, SLOT( newVectorLayer() ) );

  connect( stopRenderingButton, SIGNAL( clicked() ), this, SLOT( stopRendering() ) );

  mapCanvas->setCanvasColor( Qt::white );

  //Set the icon size of for all the toolbars created in the future.
  QSettings settings;
  int size = settings.value( "/IconSize", QGIS_ICON_SIZE ).toInt();
  setIconSize( QSize( size, size ) );

  //Change all current icon sizes.
  QList<QToolBar *> toolbars = findChildren<QToolBar *>();
  foreach ( QToolBar * toolbar, toolbars )
  {
    toolbar->setIconSize( QSize( size, size ) );
  }
Example #28
0
void QBouton::scale(const QPixmap &image, float scale)
{
	QSize size;
	if (fabs(scale - 1.0f) < 0.001f)
	{
		size = image.size() * scale;
		setIcon(image.scaled(size));
	}
	else
	{
		setIcon(image);
		size = image.size();
	}
	setIconSize(size);
	resize(size);
}
Example #29
0
QueueListView::QueueListView(QWidget* parent)
    : QTreeWidget(parent), d(new QueueListViewPriv)
{
    setIconSize(QSize(d->iconSize, d->iconSize));
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setWhatsThis(i18n("This is the list of images to batch process."));

    setAcceptDrops(true);
    viewport()->setAcceptDrops(true);
    setDropIndicatorShown(true);
    setDragEnabled(true);
    viewport()->setMouseTracking(true);

    setSortingEnabled(false);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(false);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setColumnCount(3);
    setContextMenuPolicy(Qt::CustomContextMenu);

    QStringList titles;
    titles.append(i18n("Thumbnail"));
    titles.append(i18n("File Name"));
    titles.append(i18n("Target"));
    setHeaderLabels(titles);
    header()->setResizeMode(0, QHeaderView::ResizeToContents);
    header()->setResizeMode(1, QHeaderView::Stretch);
    header()->setResizeMode(2, QHeaderView::Stretch);

    d->toolTip      = new QueueToolTip(this);
    d->toolTipTimer = new QTimer(this);

    // -----------------------------------------------------------

    connect(DatabaseAccess::databaseWatch(), SIGNAL(collectionImageChange(const CollectionImageChangeset&)),
            this, SLOT(slotCollectionImageChange(const CollectionImageChangeset&)),
            Qt::QueuedConnection);

    connect(d->thumbLoadThread, SIGNAL(signalThumbnailLoaded(const LoadingDescription&, const QPixmap&)),
            this, SLOT(slotThumbnailLoaded(const LoadingDescription&, const QPixmap&)));

    connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
            this, SLOT(slotContextMenu()));

    connect(d->toolTipTimer, SIGNAL(timeout()),
            this, SLOT(slotToolTip()));
}
Example #30
0
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();
}