当前位置: 首页 > wzjs >正文

网站怎么添加管理员西部数码网站管理助手 mysql

网站怎么添加管理员,西部数码网站管理助手 mysql,免费扑克网站,上海包装设计公司排名(1)本类的继承关系如下 : 在本篇之前,已经阅读与注释了抽象的模型基类,列表模型,表格模型,抽象的视图基类,表格视图,表格窗体,列表模型。所以,对…

(1)本类的继承关系如下

在这里插入图片描述

++ 在本篇之前,已经阅读与注释了抽象的模型基类,列表模型,表格模型,抽象的视图基类,表格视图,表格窗体,列表模型。所以,对于此列表窗体,就不详细注释了。只对新的知识点添加注释与测试。
++ 开始本类的属性阅读

在这里插入图片描述

++ 另一个属性

在这里插入图片描述

++测试一下

在这里插入图片描述

++ 补充 :排序,升序降序都可以的,有成员函数支持排序操作

在这里插入图片描述

(2)接着开始本类的 public 成员函数的学习,跟二维表窗体 QTableWidget 类似的管理条目的成员函数,就不再注释了 :

在这里插入图片描述

++既然有了上面的函数,还有必要使用选择模型 么?

在这里插入图片描述

++

在这里插入图片描述

++至此,本类的 public 权限的成员函数,就学习完毕了。

(3)接着学习本类的 槽函数与信号函数

在这里插入图片描述

++信号函数

在这里插入图片描述

++测试结果

在这里插入图片描述

(4)本类的源代码定义于头文件 qlistwidget . h

class QListWidgetPrivate;/*
The QListWidget class provides an item-based list widget.QListWidget是一个方便的类,它提供的列表视图类似于 QListView提供的列表视图,
但具有用于添加和删除项目的经典基于项目的界面。
QListWidget 使用内部模型来管理列表中的每个QListWidgetltem。
为了实现更灵活的列表视图小部件,请使用带有标准模型的QListView类。
列表小部件的构建方式与其他小部件相同:QListWidget *listWidget = new QListWidget(this);列表控件的`selectionMode()、属性决定了列表中同时可被选中的项数量,以及是否支持创建复杂的项选择。
这可以通过`setSelectionMode()'函数进行设置。
添加项目到列表有两种方式:它们可以以列表控件作为其父控件来构建,
或者可以没有父控件,然后在稍后阶段添加到列表中。
如果在构建项目时列表控件已经存在,那么第一种方法使用起来更为便捷:new QListWidgetItem(tr("Oak"), listWidget);如果您需要在列表中的特定位置插入一个新项,
那么该新项应被构造为没有父项控件。然后应使用函数将其放置在列表中。
列表控件将取得该项的拥有权。QListWidgetItem * newItem = new QListWidgetItem;newItem->setText(itemText);listWidget->insertItem(row, newItem);对于多个项目,可以使用insertltems()。列表中的项目数量可以通过count()函数找到。
要从列表中移除项目,请使用takeltem()。列表中的当前项可以通过、currentltem()函数找到,并通过`setCurrentltem()、函数进行更改。
用户还可以通过键盘导航或点击不同的项来更改当前项。
当当前项发生变化时,会发出`currentltemChanged()、信号,其中包含新的当前项以及之前处于当前状态的项。*/class Q_WIDGETS_EXPORT QListWidget : public QListView
{Q_OBJECT//This property holds the number of items in the list including any hidden items.Q_PROPERTY(int            count        READ   count) //会计算隐藏的条目在内//This property holds the row of the current item.//Depending on the current selection mode, the row may also be selected.Q_PROPERTY(int            currentRowREAD          currentRowWRITE      setCurrentRowNOTIFY        currentRowChangedUSER          true)/*enum QAbstractItemView::SelectionMode { //定义在基类。NoSelection,SingleSelection,MultiSelection,ExtendedSelection,  //此项功能最强ContiguousSelection};*///此属性表示是否启用排序。默认值为false。经测试,这个排序只有一种,强制从上到下的增序排序。//如果此属性为真,则在列表中启用排序;如果属性为假,则不启用排序。Q_PROPERTY(bool sortingEnabled READ isSortingEnabled WRITE setSortingEnabled)friend class QListWidgetItem;friend class QListModel;private:void setModel(QAbstractItemModel * model) override; //本表格窗体不需要模型了Qt::SortOrder sortOrder() const; //无法从外部调用了,只有增序一个结果,不必查询了。Q_DECLARE_PRIVATE(QListWidget)Q_DISABLE_COPY(QListWidget)Q_PRIVATE_SLOT(d_func(), void _q_emitItemEntered(const QModelIndex & index))Q_PRIVATE_SLOT(d_func(), void _q_emitItemPressed(const QModelIndex & index))Q_PRIVATE_SLOT(d_func(), void _q_emitItemClicked(const QModelIndex & index))Q_PRIVATE_SLOT(d_func(), void _q_emitItemDoubleClicked(const QModelIndex & index))Q_PRIVATE_SLOT(d_func(), void _q_emitItemActivated(const QModelIndex & index))Q_PRIVATE_SLOT(d_func(), void _q_emitItemChanged(const QModelIndex & index))Q_PRIVATE_SLOT(d_func(), void _q_emitCurrentItemChanged(const QModelIndex & previous,const QModelIndex & current))Q_PRIVATE_SLOT(d_func(), void _q_dataChanged(const QModelIndex & topLeft,const QModelIndex & bottomRight))Q_PRIVATE_SLOT(d_func(), void _q_sort())public://Constructs an empty QListWidget with the given parent.explicit QListWidget(QWidget * parent = nullptr);~QListWidget();//Reimplements: QAbstractItemView::s//               etSelectionModel(QItemSelectionModel * selectionModel).void setSelectionModel(QItemSelectionModel * selectionModel) override;//   Q_PROPERTY(int   count    READ   count) //会计算隐藏的条目在内int   count() const;// //This property holds the row of the current item.
// //Depending on the current selection mode, the row may also be selected.
//   Q_PROPERTY(int          currentRow
//              READ         currentRow
//              WRITE     setCurrentRow
//              NOTIFY       currentRowChanged
//              USER         true)int          currentRow(  ) const;void      setCurrentRow(int row);void      setCurrentRow(int row,QItemSelectionModel::SelectionFlags command);
Q_SIGNALS:void         currentRowChanged(int currentRow);public:
// //此属性表示是否启用排序。默认值为false。经测试,这个排序只有一种,强制从上到下的增序排序。
// //如果此属性为真,则在列表中启用排序;如果属性为假,则不启用排序。
//   Q_PROPERTY(bool        sortingEnabled
//              READ      isSortingEnabled
//              WRITE    setSortingEnabled)bool      isSortingEnabled() const;void     setSortingEnabled(bool enable);QListWidgetItem *                item (int row) const;int row(const QListWidgetItem *  item) const;void                       insertItem (int row,       QListWidgetItem * item  );void                       insertItem (int row, const QString         & label );void                       insertItems(int row, const QStringList     & labels);inlinevoid                          addItem (const QString         & label ){   insertItem(count(), label); }inlinevoid                          addItem (      QListWidgetItem * item  ){   insertItem(count(), item); }inlinevoid                          addItems(const QStringList     & labels){   insertItems(count(), labels); }QListWidgetItem *            takeItem (int row);QListWidgetItem *                itemAt(const QPoint & p) const;inlineQListWidgetItem *                itemAt(int x,     int y) const{   return itemAt(QPoint(x, y)); }QRect                      visualItemRect(const QListWidgetItem * item) const;QListWidgetItem *         currentItem() const;void                   setCurrentItem(QListWidgetItem * item);void                   setCurrentItem(QListWidgetItem * item,QItemSelectionModel::SelectionFlags command);void                         sortItems(Qt::SortOrder order = Qt::AscendingOrder);QList<QListWidgetItem *>         items(const QMimeData * data) const;QModelIndex             indexFromItem         (const QListWidgetItem * item ) const;QListWidgetItem *                itemFromIndex(const QModelIndex     & index) const;//Returns a list of all selected items in the list widget.//测试发现,多选后,即使失去光标焦点,表格窗体也依然会维持多选的状态。QList<QListWidgetItem *> selectedItems() const; //本函数没有使用选择模型QList<QListWidgetItem *>     findItems( const QString & text,Qt::MatchFlags  flags) const;//Returns the widget displayed in the given item.QWidget *                        itemWidget(QListWidgetItem * item) const;void                          setItemWidget(QListWidgetItem * item, QWidget * widget);//Sets the widget to be displayed in the given item.//此函数只能用于在列表小部件项目的位置显示静态内容。//如果要显示自定义动态内容或实现自定义编辑器窗口小部件,//  请改用QListView和子类QStyledltemDelegate。inline void                removeItemWidget(QListWidgetItem * item){   setItemWidget(Item, nullptr);  }//Removes the widget set on the given item.//To remove an item (row) from the list entirely,//  either delete the item or use takeItem().//Starts editing the item if it is editable.void                         editItem(QListWidgetItem * item);using  QAbstractItemView::isPersistentEditorOpen;//bool QAbstractItemView::isPersistentEditorOpen(QModelIndex & index) const;bool                      isPersistentEditorOpen(QListWidgetItem * item) const;void                    openPersistentEditor    (QListWidgetItem * item);void                   closePersistentEditor    (QListWidgetItem * item);protected:virtual Qt::DropActions supportedDropActions() const;bool     event(QEvent *e) override;void dropEvent(QDropEvent *event) override;virtual QStringList        mimeTypes() const;virtual QMimeData   *      mimeData(const QList<QListWidgetItem *> & items) const;virtual bool           dropMimeData(int index, const QMimeData * data,Qt::DropAction action);public Q_SLOTS://Scrolls the view if necessary to ensure that the item is visible.//hint specifies where the item should be located after the operation.void   scrollToItem(const QListWidgetItem * item,QAbstractItemView::ScrollHint hint = EnsureVisible);void clear();   //Removes all items and selections in the view.//Warning: All items will be permanently deleted.Q_SIGNALS:void itemEntered  (QListWidgetItem * item); //这几个信号函数关注于鼠标点击的信号void itemPressed  (QListWidgetItem * item);void itemClicked  (QListWidgetItem * item);void itemDoubleClicked(QListWidgetItem * item);void itemActivated(QListWidgetItem * item);//This signal is emitted whenever the data of item has changed.void        itemChanged(QListWidgetItem * item);   //当本条目的内容变化时,调用本函数。void currentTextChanged(const QString & currentText);//This signal is emitted whenever the current item changes.//currentText is the text data in the current item.//If there is no current item, the currentText is invalid.void currentRowChanged (int currentRow);//This signal is emitted whenever the current item changes.//currentRow is the row of the current item.//If there is no current item, the currentRow is -1.void currentItemChanged(QListWidgetItem * current, QListWidgetItem * previous);void itemSelectionChanged();//This signal is emitted whenever the selection changes.}; //完结 class QListWidget : public QListView

(5)

谢谢


文章转载自:

http://uwjYVAmB.ggfdq.cn
http://ouQbBboM.ggfdq.cn
http://IGMJ5dy2.ggfdq.cn
http://5OTk51xS.ggfdq.cn
http://V5qwCe4L.ggfdq.cn
http://q8WFSzCR.ggfdq.cn
http://uE9EOqMa.ggfdq.cn
http://JBgx7lMg.ggfdq.cn
http://SazxTIe9.ggfdq.cn
http://dMYrFRXI.ggfdq.cn
http://qTOoYmfB.ggfdq.cn
http://NYoQ6uOB.ggfdq.cn
http://7wd1Rhq1.ggfdq.cn
http://HwlyZrB6.ggfdq.cn
http://uTEEjeGp.ggfdq.cn
http://YItLC8SP.ggfdq.cn
http://UTz7RNOm.ggfdq.cn
http://c2Ti52zw.ggfdq.cn
http://mjOP0waL.ggfdq.cn
http://JWlDpmFb.ggfdq.cn
http://NV9iOHjp.ggfdq.cn
http://qB3VaoFA.ggfdq.cn
http://L02hrjDB.ggfdq.cn
http://Jnv2SiOi.ggfdq.cn
http://17mhzWlH.ggfdq.cn
http://tAnLMYYm.ggfdq.cn
http://FHp9og5w.ggfdq.cn
http://62sVJoRd.ggfdq.cn
http://LjY52ChM.ggfdq.cn
http://xiwl3U0b.ggfdq.cn
http://www.dtcms.com/wzjs/608436.html

相关文章:

  • 做淘客必须有自己内部网站吗阿里指数查询官网入口
  • 设计网站公司咨询亿企邦中信建设有限责任公司江苏分公司企查查
  • 免费做电子书的网站有哪些汽车可以做哪些广告视频网站有哪些
  • 网站制作需要多少费用wordpress源神
  • 怎么用python做网站深圳工程建设服务网
  • 国外网站服务器地址盘州住房和城乡建设局网站
  • 怎么用vps搭建网站自己的电脑做网站服务器
  • 网站运营优化南庄九江网站建设
  • 大淘客怎么做网站wordpress 导出数据
  • 做网站主流语言广州建设银行招聘网站
  • 十大门户网站有哪些dw制作简单网站
  • 如何下载js做的网站wordpress去除版权
  • 万户做网站好不好上海开展扫黄打非专项检查
  • 网站建设实训室介绍国外WordPress小说主题
  • 刷赞网站推广ks设计素材网站有哪些平台
  • 最少的钱怎么做网站建站工具推荐
  • 怎么自己写网站企业网站开发 流程
  • 可以免费做简历的网站网站建设实训心得体会2000字
  • 建设网站免费河南小学网站建设
  • 合肥网站建设公司排名三好街做网站公司
  • 河北省城乡建设培训网官方网站php网站模板制作工具
  • 网站建设与域名备案wordpress 企业展示
  • 网站模版切换网站建设 丽水
  • 北京网站设计联系方式如何优化网站图片大小
  • 众划算网站开发通化网站建设公司
  • 网站域名验证企业宣传册文案范文
  • element ui页面模板优化落实新十条措施
  • 庆阳定制网站宣传片制作拍摄
  • 域名网站怎么打开中国建设报社门户网站
  • php完整网站开发案例东莞公司高端网站建设