色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

如何在QLineEdit上添加刪除按鈕?

錢良釵2年前15瀏覽0評論

展開全部

m_btnSearch=newQPushButton(this);

QIconsearchIcon(":/CJWidgt/Resources/search.png");

m_btnSearch->setStyleSheet("border-style:solid");

m_btnSearch->setFlat(true);

m_btnSearch->setIcon(searchIcon);

m_btnSearch->setIconSize(QSize(24,24));

m_btnSearch->setCursor(Qt::PointingHandCursor);

m_btnSearch->setFixedSize(24,24);

m_btnSearch->setToolTip(QStringLiteral("查詢"));

//防止文本框輸入內(nèi)容位于按鈕之下

QMarginsmargins=ui.lineSearchContent->textMargins();

ui.lineSearchContent->setTextMargins(margins.left(),margins.top(),m_btnSearch->width(),margins.bottom());

QHBoxLayout*pSearchLayout=newQHBoxLayout();

pSearchLayout->addStretch();

pSearchLayout->addWidget(m_btnSearch);

pSearchLayout->setSpacing(0);

pSearchLayout->setContentsMargins(0,0,0,0);

ui.lineSearchContent

->setLayout(pSearchLayout);