Exemplo n.º 1
0
TIconView::TIconView( QWidget *parent, const char* name )
    : KIconView( parent, name ), _module(0L)
{
    setResizeMode( Adjust );
    setItemsMovable( false );

    setItemTextPos( Right );

    setGridX( 200 );
    setGridY( 70 );

    QFont f = font();
    f.setWeight( QFont::Bold );
    setFont( f );

    setShowToolTips( false );

    KConfig *config = KGlobal::config();
    config->setGroup("Extra");
    showExtras = config->readNumEntry( "Selected" );

    toolTip = 0;

    connect( this, SIGNAL( executed( QIconViewItem* ) ), SLOT( slotItemSelected( QIconViewItem* ) ) );

    /* comment those signals due to bug#7761
    connect( this, SIGNAL( executed( QIconViewItem* ) ), SLOT( removeToolTip()) );
    connect( this, SIGNAL( onItem( QIconViewItem* ) ), SLOT( showToolTip( QIconViewItem* ) ) );
    connect( this, SIGNAL( onViewport() ),  SLOT( removeToolTip() ) );
    */

}
Exemplo n.º 2
0
/**********************************************************************
 *
 * KivioIconView
 *
 **********************************************************************/
KivioIconView::KivioIconView( bool _readWrite,QWidget *parent, const char *name )
: QIconView( parent, name )
{
  m_pSpawnerSet = NULL;
  m_pCurDrag = NULL;
  isReadWrite=_readWrite;
  objList.append(this);

  setGridX( 64 );
  setGridY( 64 );
  setResizeMode( Adjust );
  setWordWrapIconText(true);
  setHScrollBarMode( AlwaysOff );
  setVScrollBarMode( Auto );
  setAutoArrange(true);
  setSorting(true);

  setItemsMovable(false);

  setArrangement(LeftToRight);
  setAcceptDrops(false);
  viewport()->setAcceptDrops(false);
  if(isReadWrite) {
    connect(this, SIGNAL(doubleClicked(QIconViewItem*)), this, SLOT(slotDoubleClicked(QIconViewItem*)));
    connect(this, SIGNAL(clicked(QIconViewItem*)), this, SLOT(slotClicked(QIconViewItem*)));
  }
}
Exemplo n.º 3
0
TemplateIconView::TemplateIconView(QWidget *parent, const char *name, WFlags f) : KIconView(parent, name, f), m_templateManager(NULL), m_proc(NULL) {
	setItemsMovable(false);
	setMode(KIconView::Select);
	setResizeMode(QIconView::Adjust);
	setSelectionMode(QIconView::Single);
	setResizePolicy(QScrollView::Default);
	setArrangement(QIconView::TopToBottom);
	setMinimumHeight(100);
}
Exemplo n.º 4
0
/****************
 *  KWalletEntryList - A listview to store wallet entries
 */
KWalletEntryList::KWalletEntryList(QWidget *parent, const char *name)
: KListView(parent, name) {
	addColumn(i18n("Folders"));
	setRootIsDecorated(true);
	setDefaultRenameAction(Reject);
	setAcceptDrops(true);
	setItemsMovable(false);
	setDropVisualizer(false);
	viewport()->setAcceptDrops(true);
}
Exemplo n.º 5
0
AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name)
    : KIconView(parent, name)
{
    setSelectionMode(QIconView::Extended);
    setResizeMode(QIconView::Adjust);
    setWordWrapIconText(true);
    setGridX(100);
    setItemsMovable(false);
    setSorting(true, true);
    setMode(KIconView::Select);

    connect(this, SIGNAL(dropped(QDropEvent *, const QValueList<QIconDragItem> &)),
            this, SLOT(itemDropped(QDropEvent *, const QValueList<QIconDragItem> &)));
}
Exemplo n.º 6
0
TIconView::TIconView( QWidget *parent, const char* name )
    : KIconView( parent, name )
{
    setResizeMode( Adjust );
    setItemsMovable( false );

    setItemTextPos( Right );

    setGridX( 200 );
    setGridY( 70 );

    QFont f = font();
    f.setWeight( QFont::Bold );
    setFont( f );

}
Exemplo n.º 7
0
K3bDataFileView::K3bDataFileView( K3bView* view, K3bDataDirTreeView* dirTreeView, K3bDataDoc* doc, QWidget* parent )
  : K3bListView( parent ), 
    m_view(view),
    m_dropDirItem(0)
{
  m_treeView = dirTreeView;

  setAcceptDrops( true );
  setDropVisualizer( false );
  setDropHighlighter( true );
  setDragEnabled( true );
  setItemsMovable( false );
  setAllColumnsShowFocus( true );
  setShowSortIndicator( true );

  setNoItemText( i18n("Use drag'n'drop to add files and directories to the project.\n"
		      "To remove or rename files use the context menu.\n"
		      "After that press the burn button to write the CD.") );


  addColumn( i18n("Name") );
  addColumn( i18n("Type") );
  addColumn( i18n("Size") );
  addColumn( i18n("Local Path") );
  addColumn( i18n("Link") );

  setSelectionModeExt( KListView::Extended );

  m_doc = doc;
  m_currentDir = doc->root();
  checkForNewItems();

  connect( m_treeView, SIGNAL(dirSelected(K3bDirItem*)), this, SLOT(slotSetCurrentDir(K3bDirItem*)) );
  connect( m_doc, SIGNAL(itemRemoved(K3bDataItem*)), this, SLOT(slotDataItemRemoved(K3bDataItem*)) );
  connect( m_doc, SIGNAL(itemAdded(K3bDataItem*)), this, SLOT(slotItemAdded(K3bDataItem*)) );
  connect( this, SIGNAL(executed(QListViewItem*)), this, SLOT(slotExecuted(QListViewItem*)) );
  connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
	   this, SLOT(showPopupMenu(KListView*, QListViewItem*, const QPoint&)) );
  connect( this, SIGNAL(dropped(QDropEvent*, QListViewItem*, QListViewItem*)),
	   this, SLOT(slotDropped(QDropEvent*, QListViewItem*, QListViewItem*)) );
  connect( this, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)),
	   this, SLOT(slotDoubleClicked(QListViewItem*)) );

  setupActions();
}
Exemplo n.º 8
0
MontageView::MontageView( QWidget* parent, const char* name, WFlags f ) 
  : QIconView( parent, name, f ),
    m_dirty(false),
    m_remove_action(0),
    m_remove_all_action(0),
    m_open_action(0)

{
  initActions();

  setItemsMovable(false);

  connect( this, SIGNAL( doubleClicked( QIconViewItem* ) ), 
	   this,   SLOT( itemDoubleClicked( QIconViewItem* ) ));

  connect( this, SIGNAL( contextMenuRequested(QIconViewItem*, const QPoint&) ),
	   this,   SLOT( showContextMenu(QIconViewItem*, const QPoint&) ) );
}
K2sendPlayList::K2sendPlayList( QWidget* parent, const char* name )
    : KListView( parent, name ) , m_head(NULL) , m_last(NULL),c(0),dir(1)
{
    addColumn("Id",30);
    addColumn("Tile",80);
    addColumn("Album",80);
    addColumn("Artist",80);
    addColumn("Length",40);
    addColumn("Bitrate",40);
    setSorting(-1);
    setSelectionMode(QListView::Extended);
    setShowSortIndicator(TRUE);
    setDragEnabled(TRUE);
    setAcceptDrops(TRUE);
    setDropVisualizer(TRUE);
    setItemsMovable (TRUE);
    setAllColumnsShowFocus(TRUE);

     connect( this, SIGNAL(dropped (QDropEvent *, QListViewItem *, QListViewItem *)),
         this, SLOT(insertDroppedEvent(QDropEvent *, QListViewItem *, QListViewItem *)));
     startTimer(50);
}
Exemplo n.º 10
0
KileAbbrevView::KileAbbrevView(QWidget *parent, const char *name) 
	: KListView(parent, name), m_changes(false)
{

	addColumn(i18n("Short"));
	addColumn(QString::null);
	addColumn(i18n("Expanded Text"));
	setAllColumnsShowFocus(true);
	setFullWidth(true);

	setItemsMovable(false);                 // default: true
	//setAcceptDrops(false);                // default: false
	//setDragEnabled(false);                // default: false
	//setShadeSortColumn(true);             // default: true
	header()->setMovingEnabled(false);      // default: true

	m_popup = new QPopupMenu( this );

	connect(this, SIGNAL(mouseButtonClicked(int,QListViewItem *,const QPoint &,int)),
	        this, SLOT(slotMouseButtonClicked(int,QListViewItem *,const QPoint &,int)));

	connect(this, SIGNAL(contextMenu(KListView *,QListViewItem *,const QPoint &)),
	        this, SLOT(slotContextMenu(KListView *,QListViewItem *,const QPoint &)));
}
int Q3IconView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = Q3ScrollView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: selectionChanged(); break;
        case 1: selectionChanged((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 2: currentChanged((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 3: clicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 4: clicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 5: pressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 6: pressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 7: doubleClicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 8: returnPressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 9: rightButtonClicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 10: rightButtonPressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 11: mouseButtonPressed((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3IconViewItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break;
        case 12: mouseButtonClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3IconViewItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break;
        case 13: contextMenuRequested((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 14: dropped((*reinterpret_cast< QDropEvent*(*)>(_a[1])),(*reinterpret_cast< const Q3ValueList<Q3IconDragItem>(*)>(_a[2]))); break;
        case 15: moved(); break;
        case 16: onItem((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 17: onViewport(); break;
        case 18: itemRenamed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break;
        case 19: itemRenamed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 20: arrangeItemsInGrid((*reinterpret_cast< const QSize(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
        case 21: arrangeItemsInGrid((*reinterpret_cast< const QSize(*)>(_a[1]))); break;
        case 22: arrangeItemsInGrid((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 23: arrangeItemsInGrid(); break;
        case 24: setContentsPos((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 25: updateContents(); break;
        case 26: doAutoScroll(); break;
        case 27: adjustItems(); break;
        case 28: slotUpdate(); break;
        case 29: movedContents((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        }
        _id -= 30;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = sorting(); break;
        case 1: *reinterpret_cast< bool*>(_v) = sortDirection(); break;
        case 2: *reinterpret_cast< SelectionMode*>(_v) = selectionMode(); break;
        case 3: *reinterpret_cast< int*>(_v) = gridX(); break;
        case 4: *reinterpret_cast< int*>(_v) = gridY(); break;
        case 5: *reinterpret_cast< int*>(_v) = spacing(); break;
        case 6: *reinterpret_cast< ItemTextPos*>(_v) = itemTextPos(); break;
        case 7: *reinterpret_cast< QBrush*>(_v) = itemTextBackground(); break;
        case 8: *reinterpret_cast< Arrangement*>(_v) = arrangement(); break;
        case 9: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break;
        case 10: *reinterpret_cast< int*>(_v) = maxItemWidth(); break;
        case 11: *reinterpret_cast< int*>(_v) = maxItemTextLength(); break;
        case 12: *reinterpret_cast< bool*>(_v) = autoArrange(); break;
        case 13: *reinterpret_cast< bool*>(_v) = itemsMovable(); break;
        case 14: *reinterpret_cast< bool*>(_v) = wordWrapIconText(); break;
        case 15: *reinterpret_cast< bool*>(_v) = showToolTips(); break;
        case 16: *reinterpret_cast< uint*>(_v) = count(); break;
        }
        _id -= 17;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 2: setSelectionMode(*reinterpret_cast< SelectionMode*>(_v)); break;
        case 3: setGridX(*reinterpret_cast< int*>(_v)); break;
        case 4: setGridY(*reinterpret_cast< int*>(_v)); break;
        case 5: setSpacing(*reinterpret_cast< int*>(_v)); break;
        case 6: setItemTextPos(*reinterpret_cast< ItemTextPos*>(_v)); break;
        case 7: setItemTextBackground(*reinterpret_cast< QBrush*>(_v)); break;
        case 8: setArrangement(*reinterpret_cast< Arrangement*>(_v)); break;
        case 9: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break;
        case 10: setMaxItemWidth(*reinterpret_cast< int*>(_v)); break;
        case 11: setMaxItemTextLength(*reinterpret_cast< int*>(_v)); break;
        case 12: setAutoArrange(*reinterpret_cast< bool*>(_v)); break;
        case 13: setItemsMovable(*reinterpret_cast< bool*>(_v)); break;
        case 14: setWordWrapIconText(*reinterpret_cast< bool*>(_v)); break;
        case 15: setShowToolTips(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 17;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 17;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemplo n.º 12
0
bool QIconView::qt_property( int id, int f, QVariant* v)
{
    switch ( id - staticMetaObject()->propertyOffset() ) {
    case 0: switch( f ) {
	case 1: *v = QVariant( this->sorting(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 1: switch( f ) {
	case 1: *v = QVariant( this->sortDirection(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 2: switch( f ) {
	case 0: setSelectionMode((SelectionMode&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->selectionMode() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 3: switch( f ) {
	case 0: setGridX(v->asInt()); break;
	case 1: *v = QVariant( this->gridX() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 4: switch( f ) {
	case 0: setGridY(v->asInt()); break;
	case 1: *v = QVariant( this->gridY() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 5: switch( f ) {
	case 0: setSpacing(v->asInt()); break;
	case 1: *v = QVariant( this->spacing() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 6: switch( f ) {
	case 0: setItemTextPos((ItemTextPos&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->itemTextPos() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 7: switch( f ) {
	case 0: setItemTextBackground(v->asBrush()); break;
	case 1: *v = QVariant( this->itemTextBackground() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 8: switch( f ) {
	case 0: setArrangement((Arrangement&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->arrangement() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 9: switch( f ) {
	case 0: setResizeMode((ResizeMode&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->resizeMode() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 10: switch( f ) {
	case 0: setMaxItemWidth(v->asInt()); break;
	case 1: *v = QVariant( this->maxItemWidth() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 11: switch( f ) {
	case 0: setMaxItemTextLength(v->asInt()); break;
	case 1: *v = QVariant( this->maxItemTextLength() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 12: switch( f ) {
	case 0: setAutoArrange(v->asBool()); break;
	case 1: *v = QVariant( this->autoArrange(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 13: switch( f ) {
	case 0: setItemsMovable(v->asBool()); break;
	case 1: *v = QVariant( this->itemsMovable(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 14: switch( f ) {
	case 0: setWordWrapIconText(v->asBool()); break;
	case 1: *v = QVariant( this->wordWrapIconText(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 15: switch( f ) {
	case 0: setShowToolTips(v->asBool()); break;
	case 1: *v = QVariant( this->showToolTips(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 16: switch( f ) {
	case 1: *v = QVariant( this->count() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    default:
	return QScrollView::qt_property( id, f, v );
    }
    return TRUE;
}