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


C++ setDragEnabled函数代码示例

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


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

示例1: LineEdit

LocationBar::LocationBar(QupZilla* mainClass)
    : LineEdit(mainClass)
    , p_QupZilla(mainClass)
    , m_webView(0)
    , m_pasteAndGoAction(0)
    , m_clearAction(0)
    , m_holdingAlt(false)
    , m_loadProgress(0)
    , m_progressVisible(false)
    , m_forceLineEditPaintEvent(false)
{
    setObjectName("locationbar");
    setDragEnabled(true);

    m_bookmarkIcon = new BookmarkIcon(p_QupZilla);
    m_goIcon = new GoIcon(this);
    m_rssIcon = new RssIcon(this);
    m_rssIcon->setToolTip(tr("Add RSS from this page..."));
    m_siteIcon = new SiteIcon(this);
    DownIcon* down = new DownIcon(this);

    ////RTL Support
    ////if we don't add 'm_siteIcon' by following code, then we should use suitable padding-left value
    //// but then, when typing RTL text the layout dynamically changed and within RTL layout direction
    //// padding-left is equivalent to padding-right and vice versa, and because style sheet is
    //// not changed dynamically this create padding problems.
    addWidget(m_siteIcon, LineEdit::LeftSide);

    addWidget(m_goIcon, LineEdit::RightSide);
    addWidget(m_bookmarkIcon, LineEdit::RightSide);
    addWidget(m_rssIcon, LineEdit::RightSide);
    addWidget(down, LineEdit::RightSide);

    m_completer.setLocationBar(this);
    connect(&m_completer, SIGNAL(showCompletion(QString)), this, SLOT(showCompletion(QString)));
    connect(&m_completer, SIGNAL(completionActivated()), this, SLOT(urlEnter()));

    connect(this, SIGNAL(textEdited(QString)), this, SLOT(textEdit()));
    connect(m_siteIcon, SIGNAL(clicked()), this, SLOT(showSiteInfo()));
    connect(m_goIcon, SIGNAL(clicked(QPoint)), this, SLOT(urlEnter()));
    connect(m_rssIcon, SIGNAL(clicked(QPoint)), this, SLOT(rssIconClicked()));
    connect(m_bookmarkIcon, SIGNAL(clicked(QPoint)), this, SLOT(bookmarkIconClicked()));
    connect(down, SIGNAL(clicked(QPoint)), this, SLOT(showMostVisited()));
    connect(mApp->searchEnginesManager(), SIGNAL(activeEngineChanged()), this, SLOT(updatePlaceHolderText()));
    connect(mApp->searchEnginesManager(), SIGNAL(defaultEngineChanged()), this, SLOT(updatePlaceHolderText()));
    connect(mApp, SIGNAL(message(Qz::AppMessageType, bool)), SLOT(onMessage(Qz::AppMessageType, bool)));

    loadSettings();

    clearIcon();
    updatePlaceHolderText();
}
开发者ID:Haommin,项目名称:qupzilla,代码行数:52,代码来源:locationbar.cpp

示例2: setConserveSpace

void QuickLauncher::loadConfig()
{
    DEBUGSTR << "QuickLauncher::loadConfig()" << endl << flush;
    //TDEConfig *c = config();
    //c->setGroup("General");
    setConserveSpace(m_settings->conserveSpace());
    setDragEnabled(m_settings->dragEnabled());
    /*DEBUGSTR << "    IconDim="<<m_iconDim << endl << flush;
    DEBUGSTR << "    ConserveSpace=" << (m_manager->conserveSpace()) << 
        endl << flush;
    DEBUGSTR << "    DragEnabled=" << isDragEnabled() << endl << flush;*/
    TQStringList volatileButtons = m_settings->volatileButtons();
    TQStringList urls = m_settings->buttons();
    if (m_settings->showDesktopEnabled()) {
        if (!urls.contains("SPECIAL_BUTTON__SHOW_DESKTOP"))
            urls.prepend("SPECIAL_BUTTON__SHOW_DESKTOP");
    }
    else {
        if (urls.contains("SPECIAL_BUTTON__SHOW_DESKTOP"))
            urls.remove("SPECIAL_BUTTON__SHOW_DESKTOP");
    }
    kdDebug() << "GetButtons " << urls.join("/") << endl;
    TQStringList::Iterator iter(urls.begin());
    int n = 0;
    while (iter != urls.end()) {
        TQString url = *iter;
        addApp(url, n, false);
        ++iter;
        ++n;
    }

    // Restore sticky state
    for (n=0; n<int(m_buttons->size()); ++n)
    {
        QuickButton* button = (*m_buttons)[n];
        if (volatileButtons.contains(button->menuId()) == false)
        {
            button->setSticky(true);
        }
        button->setDynamicModeEnabled(m_settings->autoAdjustEnabled());
    }

    m_popularity->readConfig(m_settings);
    m_popularity->setHistoryHorizon(m_settings->historyHorizon()/100.0);

    TQStringList serviceNames = m_settings->serviceNames();
    TQValueList<int> insPos = m_settings->serviceInspos();
    for (int n=std::min(serviceNames.size(),insPos.size())-1; n>=0; --n)
    {
        m_appOrdering[serviceNames[n]] = insPos[n];
    }
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:52,代码来源:quicklauncher.cpp

示例3: KListView

QueueList::QueueList( QWidget *parent, const char *name )
    : KListView( parent, name )
{
    addColumn( i18n("Name") );
    setResizeMode( QListView::LastColumn );
    setSelectionMode( QListView::Extended );
    setSorting( -1 );

    setAcceptDrops( true );
    setDragEnabled( true );
    setDropVisualizer( true );    //the visualizer (a line marker) is drawn when dragging over tracks
    setDropVisualizerWidth( 3 );
}
开发者ID:tmarques,项目名称:waheela,代码行数:13,代码来源:queuemanager.cpp

示例4: ListView

 ListView() : m_sType( Seed::Undefined )
 {
     UnicornWidget::paintItBlack( this );
     
     QPalette p = palette();
     p.setColor( QPalette::Text, QColor( 0xb0b0b0 ) );
     setPalette( p );
     
     setAlternatingRowColors( true );
     setAttribute( Qt::WA_MacShowFocusRect, false );
     
     setDragEnabled( true );
 }
开发者ID:AICIDNN,项目名称:lastfm-desktop,代码行数:13,代码来源:TrackDashboard.cpp

示例5: QListWidget

EntityList::EntityList(QWidget *parent)
  : QListWidget(parent)
{
  setSelectionMode(QAbstractItemView::SingleSelection);
  setDragEnabled(true);

  connect(qApp, SIGNAL(load()), SLOT(load()));
  connect(qApp, SIGNAL(unload()), SLOT(unload()));

  if (application().is_loaded()) {
    load();
  }
}
开发者ID:majo33,项目名称:atom,代码行数:13,代码来源:entity_list.cpp

示例6: QStandardItem

QStandardItem *ConversationData::makeContextItem(ConversationContext *context,
    bool editable) {

    auto item = new QStandardItem();

    item->setData(context->id(), IDData);
    item->setText(context->label());
    item->setEditable(editable);
    item->setDragEnabled(editable);
    item->setDropEnabled(editable);

    return item;
}
开发者ID:etherealvisage,项目名称:pineseed-editor,代码行数:13,代码来源:ConversationData.cpp

示例7: QTreeWidget

dragTarget::dragTarget (dragSource *source, QWidget *parent ) : QTreeWidget ( parent )
{
  //let's initialize the dropIndicator
  indicator = new QWidget(viewport());
  indicator -> setAutoFillBackground(true);
  QPalette pale = indicator -> palette();
  pale.setColor(QPalette::Base, Qt::blue);
  indicator -> setPalette(pale);
  hideIndicator();
  //let's initialize some pointers...
  sourceView = source;
  scrollUpTimer = new QTimer();
  scrollDownTimer = new QTimer();

  indicatorToRestore = NULL;
  //setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
  //...and some list settings
  subLevel = false;
  setAcceptDrops ( true );
  setDragEnabled ( true );
  setAutoScroll(true);
  setDragDropMode ( QAbstractItemView::DragDrop );
  setColumnCount ( 4 );
  setHeaderLabels ( QStringList() <<tr ( "Item" ) <<tr ( "Path" ) <<tr ( "MimeType" ) <<tr ( "Size" ) );
  header() -> moveSection ( 3,1 );
  setColumnWidth ( 0,170 );
  setDropIndicatorShown ( true );
  //setAnimated ( true );

  newFolder = new QAction ( tr ( "New Folder" ), this );
  newFolder -> setIcon ( KIcon ( "folder-new" ) );
  //newFolder -> setShortcut(QKeySequence(tr("Ctrl+A")));
  //this -> addAction(newFolder);
  delItem = new QAction ( tr ( "Delete Item" ), this );
  delItem -> setIcon ( KIcon ( "edit-delete" ) );
  //delItem -> setShortcut(QKeySequence(tr("Del"))); //TODO check!
  //this -> addAction(delItem);
  //this-> setContextMenuPolicy(Qt::DefaultContextMenu); //se non imposto defaultcontextmenu non posso reimplementare la gestione del contextmenu

  //creo il menu
  menu = new QMenu ( tr ( "Options" ),this );
  menu -> addAction ( newFolder );
  menu -> addAction ( delItem );
  connect ( newFolder, SIGNAL ( triggered() ), this, SLOT ( createNewFolder() ) );
  connect ( delItem, SIGNAL ( triggered() ), this, SLOT ( deleteItem() ) );
  delItem -> setEnabled ( false );
  setItemsExpandable ( true );
  setSelectionMode(QAbstractItemView::ExtendedSelection);
  //setSelectionMode(QAbstractItemView::ExtendedSelection); //inizialmente viene gestita solo la selezione singola

}
开发者ID:alediaferia,项目名称:aku,代码行数:51,代码来源:dragtarget.cpp

示例8: QListWidget

LiveListWidget::LiveListWidget(QWidget *parent) :
    QListWidget(parent)
{
    setAcceptDrops(true);
    setDragEnabled(true);
    setDragDropMode(QAbstractItemView::InternalMove);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

    QFile qss("../QConnect/livelistwidget.css");
    qss.open(QFile::ReadOnly);
    setStyleSheet(qss.readAll());
    qss.close();

}
开发者ID:dasanchez,项目名称:QConnect,代码行数:14,代码来源:livelistwidget.cpp

示例9: QTreeWidget

SearchListView::SearchListView(SearchFilter* filter, QWidget* parent, const char* name)
               : QTreeWidget(parent), mFilter(filter), mN(0) {
	QStringList headers;
	headers << QString::null << tr("User") << tr("Filename") << tr("Size") << tr("Speed") << tr("Queued") << tr("Imm.") << tr("Length") << tr("Bitrate") << tr("Path") << QString::null;
	setHeaderLabels(headers);
	setSortingEnabled(false);
	header()->setClickable(true);
	setRootIsDecorated(false);
	setSelectionMode(QAbstractItemView::ExtendedSelection);
 	setAllColumnsShowFocus(true);

	setColumnWidth ( 0, 30 );
	setColumnWidth ( 1, 100 );
	setColumnWidth ( 2, 250 );
	setColumnWidth ( 3, 100 );
	setColumnWidth ( 4, 100 );
	setColumnWidth ( 5, 75 );
	setColumnWidth ( 6, 30 );
	setColumnWidth ( 7, 75 );
	setColumnWidth ( 8, 75 );
	setColumnWidth ( 9, 150 );
	setColumnWidth ( 10, 250 );
	setColumnWidth ( 11, 0 );

	mPopupMenu = new QMenu(this);
	QAction * ActionDownloadFiles, * ActionDownloadFilesTo, * ActionDownloadFolders;
	ActionDownloadFiles = new QAction(tr("Download file(s)"), this);
	connect(ActionDownloadFiles, SIGNAL(triggered()), this, SLOT(downloadFiles()));
	mPopupMenu->addAction(ActionDownloadFiles);

	ActionDownloadFilesTo = new QAction(tr("Download file(s) to..."), this);
	connect(ActionDownloadFilesTo, SIGNAL(triggered()), this, SLOT(downloadFilesTo()));
	mPopupMenu->addAction(ActionDownloadFilesTo);

	ActionDownloadFolders = new QAction(tr("Download selected folder(s)"), this);
	connect(ActionDownloadFolders, SIGNAL(triggered()), this, SLOT(downloadFolders()));
	mPopupMenu->addAction(ActionDownloadFolders);

	mPopupMenu->addSeparator();
	mUsersMenu = mPopupMenu->addMenu(tr("Users"));

	setContextMenuPolicy(Qt::CustomContextMenu);
	connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(slotContextMenu(const QPoint&)));
	connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), SLOT(slotActivate(QTreeWidgetItem*, int)));
	connect(this, SIGNAL(itemActivated(QTreeWidgetItem*, int)), SLOT(slotActivate(QTreeWidgetItem*, int)));

	connect(header(), SIGNAL(sectionClicked(int)), this, SLOT(headerClicked(int)));

	setDragEnabled(true);
}
开发者ID:TiBeN,项目名称:museek-plus,代码行数:50,代码来源:searchlistview.cpp

示例10: BaseModelItem

FolderModelItem::FolderModelItem( const QString & text )
    : BaseModelItem( text )
{
//        QIcon icon;
//        icon.addPixmap( qApp->style()->standardPixmap( QStyle::SP_DirClosedIcon ), QIcon::Normal, QIcon::Off );
//        icon.addPixmap( qApp->style()->standardPixmap( QStyle::SP_DirOpenIcon ), QIcon::Normal, QIcon::On );
//        setIcon( icon );
    setIcon( QIcon( ":/folder" ) );
    setType( FOLDER );

    setDropEnabled( true );
    setDragEnabled( true );
    setEditable( true );
}
开发者ID:gil9red,项目名称:NotesManagerNavigationPanel,代码行数:14,代码来源:foldermodelitem.cpp

示例11: QListWidget

PageSelectWidget::PageSelectWidget(QWidget *parent) :
    QListWidget(parent)
{
    setSelectionRectVisible(false);
    setViewMode(IconMode);
    setSpacing(2);
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
    setWordWrap(true);
    setDragEnabled(NoDragDrop);
    setEditTriggers(NoEditTriggers);
    setTextElideMode(Qt::ElideNone);

    setItemDelegate(new PageSelectWidgetItemDelegate(this));
}
开发者ID:ActionLuzifer,项目名称:razor-qt,代码行数:14,代码来源:pageselectwidget.cpp

示例12: setText

ContactListItem::ContactListItem(const QString& groupName)
{	
	m_group = 0;
	m_contact = 0;

	setText(groupName);
	
	setEditable(false);
	setDragEnabled(false);
	setDropEnabled(false);
	/*QFont f = font();
	f.setPointSize(9);
	setFont(f);*/
}
开发者ID:Andrsid,项目名称:myagent-im,代码行数:14,代码来源:contactlistitem.cpp

示例13: QTreeView

SearchEditorTreeView::SearchEditorTreeView(QWidget *parent)
    : QTreeView(parent)
{
    setDragEnabled(true);
    setAcceptDrops(false);
    setDropIndicatorShown(true);
    setDragDropMode(QAbstractItemView::InternalMove);
    setAutoScroll(true);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setSelectionBehavior(QAbstractItemView::SelectRows);
    setSortingEnabled(false);
    setTabKeyNavigation(true);
    setAutoExpandDelay(200);
}
开发者ID:AmesianX,项目名称:Sigil,代码行数:14,代码来源:SearchEditorTreeView.cpp

示例14: K3ListView

TreeView::TreeView( bool controlCenter, KActionCollection *ac, QWidget *parent, const char *name )
    : K3ListView(parent), m_ac(ac), m_rmb(0), m_clipboard(0),
      m_clipboardFolderInfo(0), m_clipboardEntryInfo(0),
      m_controlCenter(controlCenter), m_layoutDirty(false)
{
    setObjectName(name);
	setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(true);
    setSorting(-1);
    setAcceptDrops(true);
    setDropVisualizer(true);
    setDragEnabled(true);
    setMinimumWidth(240);

    addColumn("");
    header()->hide();

    connect(this, SIGNAL(dropped(QDropEvent*, Q3ListViewItem*, Q3ListViewItem*)),
	    SLOT(slotDropped(QDropEvent*, Q3ListViewItem*, Q3ListViewItem*)));

    connect(this, SIGNAL(clicked( Q3ListViewItem* )),
	    SLOT(itemSelected( Q3ListViewItem* )));

    connect(this,SIGNAL(selectionChanged ( Q3ListViewItem * )),
            SLOT(itemSelected( Q3ListViewItem* )));

    connect(this, SIGNAL(rightButtonPressed(Q3ListViewItem*, const QPoint&, int)),
	    SLOT(slotRMBPressed(Q3ListViewItem*, const QPoint&)));

    // connect actions
    connect(m_ac->action("newitem"), SIGNAL(activated()), SLOT(newitem()));
    connect(m_ac->action("newsubmenu"), SIGNAL(activated()), SLOT(newsubmenu()));
    if (m_ac->action("newsep"))
        connect(m_ac->action("newsep"), SIGNAL(activated()), SLOT(newsep()));

    m_menuFile = new MenuFile( KStandardDirs::locateLocal("xdgconf-menu", "applications-kmenuedit.menu"));
    m_rootFolder = new MenuFolderInfo;
    m_separator = new MenuSeparatorInfo;
    m_drag = 0;

    //	Read menu format configuration information
    KSharedConfig::Ptr pConfig = KSharedConfig::openConfig("kickerrc");
    KConfigGroup cg(pConfig, "menus");
    m_detailedMenuEntries = cg.readEntry("DetailedMenuEntries", true);
    if (m_detailedMenuEntries)
    {
        m_detailedEntriesNamesFirst = cg.readEntry("DetailedEntriesNamesFirst", false);
    }
}
开发者ID:jschwartzenberg,项目名称:kicker,代码行数:50,代码来源:treeview.cpp

示例15: QTreeView

QSceneGraphTreeView::QSceneGraphTreeView(QWidget *parent)
    :   QTreeView(parent),
		sceneGraphModel(NULL)
{
	sceneGraphModel = new SceneGraphModel();
    sceneGraphModel->SetScene(NULL);
	
	setDragDropMode(QAbstractItemView::InternalMove);
	setDragEnabled(true);
	setAcceptDrops(true);
	setDropIndicatorShown(true);

	ConnectToSignals();
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:14,代码来源:QSceneGraphTreeView.cpp


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