回覆列表
  • 1 # 厚德載物17837

    m_btnSearch = new QPushButton(this);QIcon searchIcon(":/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("查詢"));//防止文字框輸入內容位於按鈕之下QMargins margins = ui.lineSearchContent->textMargins();ui.lineSearchContent->setTextMargins(margins.left(), margins.top(), m_btnSearch->width(), margins.bottom());QHBoxLayout *pSearchLayout = new QHBoxLayout();pSearchLayout->addStretch();pSearchLayout->addWidget(m_btnSearch);pSearchLayout->setSpacing(0);pSearchLayout->setContentsMargins(0, 0, 0, 0);ui.lineSearchContent ->setLayout(pSearchLayout);

  • 2 # 小胖砸你別跑

    m_btnSearch = new QPushButton(this);QIcon searchIcon(":/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("查詢"));//防止文字框輸入內容位於按鈕之下QMargins margins = ui.lineSearchContent->textMargins();ui.lineSearchContent->setTextMargins(margins.left(), margins.top(), m_btnSearch->width(), margins.bottom());QHBoxLayout *pSearchLayout = new QHBoxLayout();pSearchLayout->addStretch();pSearchLayout->addWidget(m_btnSearch);pSearchLayout->setSpacing(0);pSearchLayout->setContentsMargins(0, 0, 0, 0);

    ui.lineSearchContent

    ->setLayout(pSearchLayout);

  • 3 # 使用者6149685759706

    展開全部

    m_btnSearch = new QPushButton(this);

    QIcon searchIcon(":/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("查詢"));

    QMargins margins = ui.lineSearchContent->textMargins();

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

    QHBoxLayout *pSearchLayout = new QHBoxLayout();

    pSearchLayout->addStretch();

    pSearchLayout->addWidget(m_btnSearch);

    pSearchLayout->setSpacing(0);

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

    ui.lineSearchContent

    ->setLayout(pSearchLayout);

  • 中秋節和大豐收的關聯?
  • 詩經裡形容女子的詩句?