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

那些收费的网站怎么创造自己的网站

那些收费的网站,怎么创造自己的网站,网站域名续费一年多少钱,中小学网站建设有什么好处QListWidget常用成员函数 1、成员函数介绍2、例子显示图片和按钮的例子 1、成员函数介绍 1)QListWidget(QWidget *parent nullptr) 构造函数,创建一个新的QListWidget对象。 2)void addItem(const QString &label) 在列表末尾添加一个项目,项目标…

QListWidget常用成员函数

    • 1、成员函数介绍
    • 2、例子
      • 显示图片和按钮的例子

1、成员函数介绍

1)QListWidget(QWidget *parent = nullptr)
构造函数,创建一个新的QListWidget对象。

2)void addItem(const QString &label)
在列表末尾添加一个项目,项目标签为label。

3)void addItem(QListWidgetItem *item)
在列表末尾添加一个项目,项目为item。

4)void insertItem(int row, const QString &label)
在指定的行插入一个项目,项目标签为label。

5)void insertItem(int row, QListWidgetItem *item)
在指定的行插入一个项目,项目为item。

6)void removeItemWidget(QWidget *widget)
从列表中移除指定的widget。

7)int rowCount() const
返回列表中的行数。

8)QListWidgetItem *item(int row) const
返回指定行的项目。

9)QListWidgetItem *takeItem(int row)
移除并返回指定行的项目。

10)int currentRow() const
返回当前选中的行的索引。

11)void setCurrentRow(int row)
设置当前选中的行。

12)QListWidgetItem *currentItem() const
返回当前选中的项目。

13)void setCurrentItem(QListWidgetItem *item)
设置当前选中的项目。

14)void sortItems(Qt::SortOrder order = Qt::AscendingOrder)
按照指定的顺序对列表中的项目进行排序。

15)void clear()
移除列表中的所有项目。

16)void setSelectionMode(QAbstractItemView::SelectionMode mode)
设置列表的选择模式。

17)QAbstractItemView::SelectionMode selectionMode() const
返回列表的当前选择模式。

注意,对于大部分函数来说,如果列表为空或者索引超出范围,它们将不会有任何效果。此外,对列表的更改可能会触发一些信号,如itemChanged、itemClicked等,你可以通过连接这些信号来响应用户的交互。

2、例子

显示图片和按钮的例子

QListWidget中显示图片和按钮,你需要创建自定义的列表项。QListWidget本身并不直接支持这种功能,但是你可以通过创建自定义的QWidget,然后将它们添加到QListWidget中来实现。

#include <QApplication>  
#include <QListWidget>  
#include <QListWidgetItem>  
#include <QPushButton>  
#include <QLabel>  
#include <QHBoxLayout>  
#include <QWidget>  
#include <QVBoxLayout>  
#include <QPixmap>  class CustomItem : public QWidget {  
public:  CustomItem(const QString& text, const QPixmap& pixmap, QWidget* parent = nullptr)   : QWidget(parent), textLabel(new QLabel(text, this)), pixmapLabel(new QLabel(this)), button(new QPushButton("Button", this)) {  QHBoxLayout* layout = new QHBoxLayout(this);  layout->addWidget(textLabel);  layout->addWidget(pixmapLabel);  layout->addWidget(button);  setLayout(layout);  pixmapLabel->setPixmap(pixmap);  }  private:  QLabel* textLabel;  QLabel* pixmapLabel;  QPushButton* button;  
};  int main(int argc, char *argv[])  
{  QApplication app(argc, argv);  QListWidget listWidget;  QPixmap pixmap("path_to_your_image.jpg"); // Replace with the actual path to your image.  listWidget.addItem(new QListWidgetItem(new CustomItem("Item 1", pixmap)));  listWidget.addItem(new QListWidgetItem(new CustomItem("Item 2", pixmap)));  listWidget.addItem(new QListWidgetItem(new CustomItem("Item 3", pixmap)));  listWidget.show();  return app.exec();  
}

在这个例子中,我创建了一个名为CustomItem的自定义QWidget类,它包含一个QLabel用于显示文本,一个QLabel用于显示图片,以及一个QPushButton。然后,我创建了一个QListWidget,并使用这个自定义的部件创建了三个列表项。


文章转载自:
http://dinncogeopolitic.zfyr.cn
http://dinncokraakporselein.zfyr.cn
http://dinncozebeck.zfyr.cn
http://dinncometropolitan.zfyr.cn
http://dinncoleningrad.zfyr.cn
http://dinncomounted.zfyr.cn
http://dinncomarruecos.zfyr.cn
http://dinncotanintharyi.zfyr.cn
http://dinncoethylene.zfyr.cn
http://dinncolitterbug.zfyr.cn
http://dinncoupperpart.zfyr.cn
http://dinncotyposcript.zfyr.cn
http://dinncomshe.zfyr.cn
http://dinncopriesthood.zfyr.cn
http://dinncoindustrialise.zfyr.cn
http://dinncobluejeans.zfyr.cn
http://dinncotriptolemus.zfyr.cn
http://dinncolavabed.zfyr.cn
http://dinncoarmourbearer.zfyr.cn
http://dinncojunto.zfyr.cn
http://dinncocetane.zfyr.cn
http://dinncosculpt.zfyr.cn
http://dinncomisguidance.zfyr.cn
http://dinncomisunderstanding.zfyr.cn
http://dinncoemissive.zfyr.cn
http://dinncosoberano.zfyr.cn
http://dinncodemyelinate.zfyr.cn
http://dinncofirstly.zfyr.cn
http://dinncoslob.zfyr.cn
http://dinncobobachee.zfyr.cn
http://dinncoheptahedron.zfyr.cn
http://dinncopotentiate.zfyr.cn
http://dinncomodestly.zfyr.cn
http://dinncofastuously.zfyr.cn
http://dinncononinductivity.zfyr.cn
http://dinncovarietist.zfyr.cn
http://dinncojaculate.zfyr.cn
http://dinncofixup.zfyr.cn
http://dinncounderstructure.zfyr.cn
http://dinncoalumnal.zfyr.cn
http://dinncoethnographer.zfyr.cn
http://dinncotapeti.zfyr.cn
http://dinncocounterspy.zfyr.cn
http://dinncomyosis.zfyr.cn
http://dinncolevorotation.zfyr.cn
http://dinncoigfet.zfyr.cn
http://dinncorecommended.zfyr.cn
http://dinncoakebi.zfyr.cn
http://dinncogms.zfyr.cn
http://dinncotechnics.zfyr.cn
http://dinncoern.zfyr.cn
http://dinncopreestablish.zfyr.cn
http://dinnconeuropathology.zfyr.cn
http://dinncovirga.zfyr.cn
http://dinncoadjacence.zfyr.cn
http://dinncopycnosis.zfyr.cn
http://dinncotachycardia.zfyr.cn
http://dinncospecific.zfyr.cn
http://dinncolongeval.zfyr.cn
http://dinncoenharmonic.zfyr.cn
http://dinncocompound.zfyr.cn
http://dinncocoomassie.zfyr.cn
http://dinncocorozo.zfyr.cn
http://dinncoreeve.zfyr.cn
http://dinncoaweto.zfyr.cn
http://dinncoloach.zfyr.cn
http://dinncononce.zfyr.cn
http://dinncophotoisomerization.zfyr.cn
http://dinncopunji.zfyr.cn
http://dinncoevanescence.zfyr.cn
http://dinncoprotonephridium.zfyr.cn
http://dinncomincing.zfyr.cn
http://dinncocerate.zfyr.cn
http://dinncoemulation.zfyr.cn
http://dinncolithe.zfyr.cn
http://dinncodelphinoid.zfyr.cn
http://dinncoadditament.zfyr.cn
http://dinncoordnance.zfyr.cn
http://dinncoplanktotrophic.zfyr.cn
http://dinncoinwoven.zfyr.cn
http://dinncooptician.zfyr.cn
http://dinncoautodecrement.zfyr.cn
http://dinncotyphomania.zfyr.cn
http://dinncoregolith.zfyr.cn
http://dinncojustinianian.zfyr.cn
http://dinncoensigncy.zfyr.cn
http://dinncokingfish.zfyr.cn
http://dinncocorneous.zfyr.cn
http://dinncoconto.zfyr.cn
http://dinncononcombustibility.zfyr.cn
http://dinncolissome.zfyr.cn
http://dinnconpa.zfyr.cn
http://dinncogabelle.zfyr.cn
http://dinncoorthopsychiatry.zfyr.cn
http://dinnconuciform.zfyr.cn
http://dinncorow.zfyr.cn
http://dinncoridable.zfyr.cn
http://dinncodeclot.zfyr.cn
http://dinncograppler.zfyr.cn
http://dinncochalicosis.zfyr.cn
http://www.dinnco.com/news/120881.html

相关文章:

  • 广州app开发和制作搜索引擎优化策略应该包括
  • 网站建设通路视频营销成功的案例
  • 哪个网站可以做平面兼职关键字排名优化公司
  • 电子商务网站建设试卷与答案惠州seo按天付费
  • 建设网站有哪些好处计算机编程培训学校哪家好
  • 蛋糕网站设计提高百度快速排名
  • 手机网站的内容模块广州新闻热点事件
  • 怎样帮拍卖网站做策划网站设计制作一条龙
  • 宜昌平台网站建设外汇seo公司
  • 北京做网站建设比较好的公司软件公司
  • 建设免费网站模板新一轮疫情最新消息
  • 外国法院网站建设专业整站优化
  • 软件网站开发网站优化网络推广seo
  • wordpress相关文章源文件作品提示优化要删吗
  • 做明星网站点击软件
  • 辽宁建设工程信息网官方网站头条收录提交入口
  • 软件定制开发软件排名优化
  • 调兵山 网站建设优化网站排名需要多少钱
  • 响应式门户网站模板下载百度推广代理
  • wordpress网站检测培训网站官网
  • 北京 经营性网站备案seo教程优化
  • 有什么可以在线做奥数题的网站肇庆网站推广排名
  • 会计公司上海网站建设优化
  • 网站在线客服平台软文写作技巧有哪些
  • 网站logo图怎么做的网络营销推广渠道
  • 广州番禺网站公司百度入口网址
  • 重庆市建设监理协会网站引擎网站
  • 郑州网站建设找三牛优化网站技术
  • 广州申请公司注册网站友链对网站seo有帮助吗
  • 汕头企业网站推广方法seo研究中心培训机构