中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

昆明seo搜索引擎優(yōu)化的簡稱是

昆明seo,搜索引擎優(yōu)化的簡稱是,旅游電子商務(wù)網(wǎng)站建設(shè)費用,做網(wǎng)站推廣需要什么寫在前面 這里自定義一個搜索控件,通過自定義LineEdit的textChange信號,搜索指定內(nèi)容,并以QCheckBox的方式顯示在QListWidget中。 開發(fā)版本 Qt: 5.15.2 Qt: Creator10.0.2 編譯環(huán)境:msvc2019_64bit release 效果 代碼 自定義…

寫在前面

這里自定義一個搜索控件,通過自定義LineEdit的textChange信號,搜索指定內(nèi)容,并以QCheckBox的方式顯示在QListWidget中。

開發(fā)版本

Qt: 5.15.2
Qt: Creator10.0.2

編譯環(huán)境:msvc2019_64bit release

效果

1

代碼

自定義LineEdit,帶前綴圖標(biāo)。

//MLineEdit.h
#ifndef MLINEEDIT_H
#define MLINEEDIT_H#include <QLineEdit>
#include <QHBoxLayout>class MLineEdit : public QLineEdit
{Q_OBJECT
public:explicit MLineEdit(QWidget *parent = nullptr);signals:private:QHBoxLayout* layout;};#endif // MLINEEDIT_H
//MLineEdit.cpp
#include "mlineedit.h"
#include <QLabel>
#include <QDebug>MLineEdit::MLineEdit(QWidget *parent): QLineEdit{parent}
{layout = new QHBoxLayout(this);QLabel* prefixIcon = new QLabel(this);QPixmap pix(":/icons/search.svg");prefixIcon->setPixmap(pix);prefixIcon->setFixedSize(pix.size());layout->addWidget(prefixIcon);layout->setContentsMargins(1, 1, 1, 1);layout->addStretch();layout->setDirection(QBoxLayout::LeftToRight);qDebug() << font();setFont(QFont("SimSun", 15));setTextMargins(prefixIcon->width(), 1, 1, 1);QString qss = QString("QLineEdit{border:1px solid gray;border-radius:10px;}");setStyleSheet(qss);
}

應(yīng)用實現(xiàn):

//MyWidgets.h
#ifndef MYWIDGETS_H
#define MYWIDGETS_H#include <QWidget>QT_BEGIN_NAMESPACE
namespace Ui { class MyWidgets; }
QT_END_NAMESPACEclass MyWidgets : public QWidget
{Q_OBJECTpublic:MyWidgets(QWidget *parent = nullptr);~MyWidgets();public slots:void textChangeSlot(const QString& text);private:Ui::MyWidgets *ui;QStringList qlCheck;
};
#endif // MYWIDGETS_H
//MyWidgets.cpp
#include "mywidgets.h"
#include "ui_mywidgets.h"#include <QPushButton>
#include <QIcon>
#include <QCheckBox>
#include <QDebug>
#include <QListWidgetItem>
#include "mlineedit.h"MyWidgets::MyWidgets(QWidget *parent): QWidget(parent), ui(new Ui::MyWidgets)
{ui->setupUi(this);qlCheck << tr("whatsApp") << tr("weChat") << tr("QQ") << tr("Telegram") << tr("twitter");connect(ui->lineEdit, &QLineEdit::textChanged, this, &MyWidgets::textChangeSlot);
}MyWidgets::~MyWidgets()
{delete ui;
}void MyWidgets::textChangeSlot(const QString& text)
{QString qsInput = ui->lineEdit->text();qDebug() << qsInput;ui->listWidget->clear();if (qsInput.isEmpty()){return;}for (QString qs : qlCheck){if (qs.contains(qsInput, Qt::CaseInsensitive)){QCheckBox* checkBox = new QCheckBox(this);checkBox->setText(qs);QListWidgetItem* listItem = new QListWidgetItem();ui->listWidget->addItem(listItem);ui->listWidget->setItemWidget(listItem, checkBox);}}
}

ui布局及完整代碼可見github倉庫:https://github.com/SNAKEpg12138/SearchWidget

總結(jié)

使用樣式表實現(xiàn)帶前綴圖標(biāo)的LineEdit,并通過一個簡單的搜索控件應(yīng)用。

http://m.risenshineclean.com/news/62870.html

相關(guān)文章:

  • 四川企業(yè)品牌網(wǎng)站建設(shè)愛站工具下載
  • 英文網(wǎng)站建設(shè)官網(wǎng)優(yōu)化搜索引擎的方法
  • 做色情網(wǎng)站需要多少錢企業(yè)網(wǎng)站建設(shè)案例
  • 成交型網(wǎng)站建設(shè)app營銷策略
  • 電子商務(wù)網(wǎng)站的作用有哪些泰安網(wǎng)站優(yōu)化公司
  • 網(wǎng)站中插入視頻代碼佛山疫情最新消息
  • 做b2b專業(yè)網(wǎng)站一般有效果嗎怎么給客戶推廣自己的產(chǎn)品
  • 深圳快速網(wǎng)站制作如何利用互聯(lián)網(wǎng)宣傳與推廣
  • 無錫做網(wǎng)站選優(yōu)易信定制網(wǎng)站建設(shè)電話
  • 網(wǎng)站建設(shè)與管理讀書心得推廣品牌的方法
  • 注冊網(wǎng)站域名需要什么資料醫(yī)療器械排名優(yōu)化seo
  • 制作網(wǎng)站 優(yōu)幫云網(wǎng)絡(luò)營銷專業(yè)學(xué)什么
  • 滄浪網(wǎng)站建設(shè)方案今日軍事新聞最新消息新聞報道
  • 江西建設(shè)銀行招聘網(wǎng)站加強(qiáng)服務(wù)保障滿足群眾急需i
  • 鄭州制作網(wǎng)站公司寧波網(wǎng)站關(guān)鍵詞優(yōu)化排名
  • 做視頻后期的網(wǎng)站推廣app接單網(wǎng)
  • wordpress手機(jī)編輯器插件下載seo專業(yè)培訓(xùn)班
  • 青島模板自助建站李勇seo的博客
  • 上海做網(wǎng)站建設(shè)的公司南京seo排名優(yōu)化
  • 公司網(wǎng)站首頁大圖怎么做深圳專業(yè)seo
  • wordpress與phpstudy安裝優(yōu)化關(guān)鍵詞有哪些方法
  • 中國建設(shè)銀行官方網(wǎng)站e路航下載網(wǎng)站查詢是否安全
  • 加盟裝修公司怎么合作谷歌推廣seo
  • 做網(wǎng)站有發(fā)票嗎站長工具whois查詢
  • 網(wǎng)站開發(fā)初學(xué)網(wǎng)絡(luò)推廣的重要性與好處
  • 東營做營銷型網(wǎng)站建設(shè)小程序推廣方案
  • 禮品網(wǎng)站模板sem推廣競價
  • 網(wǎng)站建設(shè)資質(zhì)百度app下載最新版本
  • 做相框的網(wǎng)站app優(yōu)化網(wǎng)站
  • 公司做網(wǎng)站費用和人員配備天津百度網(wǎng)絡(luò)推廣