• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ setDragEnabled函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: toWorkingWidget

void toResultTableView::setup(bool readable, bool numberColumn, bool editable)
{
    Statistics      = NULL;
    Menu            = NULL;
    ReadAll         = false;
    Filter          = NULL;
    VisibleColumns  = 0;
    ReadableColumns = readable;
    NumberColumn    = numberColumn;
    ColumnsResized  = false;
    Ready           = false;
    Finished        = false;

    Working = new toWorkingWidget(this);
    connect(Working, SIGNAL(stop()), this, SLOT(slotStop()));
    Working->hide(); // hide by default

    createActions();

    setSelectionBehavior(QAbstractItemView::SelectItems);
    setSelectionMode(QAbstractItemView::ContiguousSelection);
    setAlternatingRowColors(true);

    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this,
            SIGNAL(customContextMenuRequested(const QPoint &)),
            this,
            SLOT(slotDisplayMenu(const QPoint &)));
    connect(horizontalHeader(),
            SIGNAL(sectionResized(int, int, int)),
            this,
            SLOT(slotColumnWasResized(int, int, int)));
    connect(this,
            SIGNAL(doubleClicked(const QModelIndex &)),
            this,
            SLOT(slotHandleDoubleClick(const QModelIndex &)));

    setDragEnabled(true);
    setDropIndicatorShown(true);

    // this is my dirty hack to prevent fetchMore being called on the
    // model during a horizontal scroll.
    // this would be one great way to fix it, but as of this time it's
    // prioritized low and not scheduled for a fix:
    // https://bugreports.qt-project.org/browse/QTBUG-9988
    disconnect(QTableView::horizontalScrollBar(),
               SIGNAL(valueChanged(int)),
               this,
               SLOT(horizontalScrollbarValueChanged(int)));
}
开发者ID:doniexun,项目名称:tora,代码行数:50,代码来源:toresulttableview.cpp


示例17: ListWidget

AnimationListWidget::AnimationListWidget(QWidget *parent):
    ListWidget(parent)
{
    setDropIndicatorShown(false);
    setMovement(Static);
    setDefaultDropAction(Qt::IgnoreAction);
    setEditTriggers(DoubleClicked | EditKeyPressed);
    setDragDropMode(DragOnly);
    setDragEnabled(true);
    setAcceptDrops(false);
    setSortingEnabled(true);
    createActions();

    connect( m_addToPlaylistAction, &QAction::triggered, this, &AnimationListWidget::addSelectedItemsToPlaylist);
}
开发者ID:cslux,项目名称:ledcc,代码行数:15,代码来源:AnimationListWidget.cpp


示例18: QListView

PlListView::PlListView( PLModel *model, QWidget *parent ) : QListView( parent )
{
    setModel( model );
    setViewMode( QListView::ListMode );
    setUniformItemSizes( true );
    setSelectionMode( QAbstractItemView::ExtendedSelection );
    setAlternatingRowColors( true );
    setDragEnabled(true);
    setAcceptDrops( true );
    setDropIndicatorShown(true);

    PlListViewItemDelegate *delegate = new PlListViewItemDelegate( this );
    setItemDelegate( delegate );
    setAttribute( Qt::WA_MacShowFocusRect, false );
}
开发者ID:banketree,项目名称:faplayer,代码行数:15,代码来源:views.cpp


示例19: setToolTip

/** Initializes the view of this widget. */
void CSearchResultView::initView() {
    setToolTip(tr("Search result of the selected work"));
    setHeaderLabel(tr("Results"));
    setDragEnabled(true);
    setRootIsDecorated( false );
    setSelectionMode(QAbstractItemView::ExtendedSelection);

    //setup the popup menu
    m_popup = new QMenu(this);

    m_actions.copyMenu = new QMenu(tr("Copy..."), m_popup);
    m_actions.copyMenu->setIcon(CResMgr::searchdialog::result::foundItems::copyMenu::icon());

    m_actions.copy.result = new QAction(tr("Reference only"), this);
    BT_CONNECT(m_actions.copy.result, SIGNAL(triggered()),
               this,                  SLOT(copyItems()));
    m_actions.copyMenu->addAction(m_actions.copy.result);

    m_actions.copy.resultWithText = new QAction(tr("Reference with text"), this);
    BT_CONNECT(m_actions.copy.resultWithText, SIGNAL(triggered()),
               this,                          SLOT(copyItemsWithText()));
    m_actions.copyMenu->addAction(m_actions.copy.resultWithText);

    m_popup->addMenu(m_actions.copyMenu);

    m_actions.saveMenu = new QMenu(tr("Save..."), m_popup);
    m_actions.saveMenu->setIcon(CResMgr::searchdialog::result::foundItems::saveMenu::icon());

    m_actions.save.result = new QAction(tr("Reference only"), this);
    BT_CONNECT(m_actions.save.result, SIGNAL(triggered()),
               this,                  SLOT(saveItems()) );
    m_actions.saveMenu->addAction(m_actions.save.result);

    m_actions.save.resultWithText = new QAction(tr("Reference with text"), this);
    m_actions.saveMenu->addAction(m_actions.save.resultWithText);
    BT_CONNECT(m_actions.save.resultWithText, SIGNAL(triggered()),
               this,                          SLOT(saveItemsWithText()));
    m_popup->addMenu(m_actions.saveMenu);

    m_actions.printMenu = new QMenu(tr("Print..."), m_popup);
    m_actions.printMenu->setIcon(CResMgr::searchdialog::result::foundItems::printMenu::icon());

    m_actions.print.result = new QAction(tr("Reference with text"), this);
    BT_CONNECT(m_actions.print.result, SIGNAL(triggered()),
               this,                   SLOT(printItems()));
    m_actions.printMenu->addAction(m_actions.print.result);
    m_popup->addMenu(m_actions.printMenu);
}
开发者ID:bibletime,项目名称:bibletime,代码行数:49,代码来源:csearchresultview.cpp


示例20: QTreeView

CGroupListView::CGroupListView(QWidget *parent, CGroupList *model)
              : QTreeView(parent)
{
    setModel(model);
    setItemDelegate(new CGroupListViewDelegate(this));
    sortByColumn(COL_GROUP_NAME, Qt::AscendingOrder);
    setSelectionMode(QAbstractItemView::SingleSelection);
    setSortingEnabled(true);
    setAllColumnsShowFocus(true);
    setAlternatingRowColors(true);
    setAcceptDrops(true);
    setDragDropMode(QAbstractItemView::DropOnly);
    setDropIndicatorShown(true);
    setDragEnabled(false);
    header()->setSortIndicatorShown(true);
    setRootIsDecorated(false);
    itsMenu=new QMenu(this);

    itsDeleteAct=itsMenu->addAction(QIcon::fromTheme("list-remove"), i18n("Remove"),
                                    this, SIGNAL(del()));
    itsMenu->addSeparator();
    itsEnableAct=itsMenu->addAction(QIcon::fromTheme("enablefont"), i18n("Enable"),
                                    this, SIGNAL(enable()));
    itsDisableAct=itsMenu->addAction(QIcon::fromTheme("disablefont"), i18n("Disable"),
                                     this, SIGNAL(disable()));
    itsMenu->addSeparator();
    itsRenameAct=itsMenu->addAction(QIcon::fromTheme("edit-rename"), i18n("Rename..."),
                                    this, SLOT(rename()));
    
    if(!Misc::app(KFI_PRINTER).isEmpty())
    {
        itsMenu->addSeparator();
        itsPrintAct=itsMenu->addAction(QIcon::fromTheme("document-print"), i18n("Print..."),
                                       this, SIGNAL(print()));
    }
    else
        itsPrintAct=0L;
    itsMenu->addSeparator();
    itsExportAct=itsMenu->addAction(QIcon::fromTheme("document-export"), i18n("Export..."),
                                    this, SIGNAL(zip()));

    setWhatsThis(model->whatsThis());
    header()->setWhatsThis(whatsThis());
    connect(this, SIGNAL(addFamilies(QModelIndex,QSet<QString>)),
            model, SLOT(addToGroup(QModelIndex,QSet<QString>)));
    connect(this, SIGNAL(removeFamilies(QModelIndex,QSet<QString>)),
            model, SLOT(removeFromGroup(QModelIndex,QSet<QString>)));
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:48,代码来源:GroupList.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setDuration函数代码示例发布时间:2022-05-30
下一篇:
C++ setDragDropMode函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap