導航:首頁 > 服裝批發 > qstyle女裝店鋪批發

qstyle女裝店鋪批發

發布時間:2021-08-15 20:06:35

① qtableview的單元格怎麼放一個button

#ifndef BUTTONDELEGATE_H
#define BUTTONDELEGATE_H

#include <QItemDelegate>

class ButtonDelegate : public QItemDelegate
{
Q_OBJECT
public:
explicit ButtonDelegate(QObject *parent = 0);

void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index);

signals:

public slots:

private:
QMap<QModelIndex, QStyleOptionButton*> m_btns;

};

#endif // BUTTONDELEGATE_H
#include "buttondelegate.h"

#include <QApplication>
#include <QMouseEvent>
#include <QDialog>
#include <QPainter>
#include <QStyleOption>
#include <QDesktopWidget>

ButtonDelegate::ButtonDelegate(QObject *parent) :
QItemDelegate(parent)
{
}

void ButtonDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionButton* button = m_btns.value(index);
if (!button) {
button = new QStyleOptionButton();
button->rect = option.rect.adjusted(4, 4, -4, -4);
button->text = "X";
button->state |= QStyle::State_Enabled;

(const_cast<ButtonDelegate *>(this))->m_btns.insert(index, button);
}
painter->save();

if (option.state & QStyle::State_Selected) {
painter->fillRect(option.rect, option.palette.highlight());

}
painter->restore();
QApplication::style()->drawControl(QStyle::CE_PushButton, button, painter);

}

bool ButtonDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
{
if (event->type() == QEvent::MouseButtonPress) {

QMouseEvent* e =(QMouseEvent*)event;

if (option.rect.adjusted(4, 4, -4, -4).contains(e->x(), e->y()) && m_btns.contains(index)) {
m_btns.value(index)->state |= QStyle::State_Sunken;
}
}
if (event->type() == QEvent::MouseButtonRelease) {
QMouseEvent* e =(QMouseEvent*)event;

if (option.rect.adjusted(4, 4, -4, -4).contains(e->x(), e->y()) && m_btns.contains(index)) {
m_btns.value(index)->state &= (~QStyle::State_Sunken);

QDialog *d = new QDialog();

d->setGeometry(0, 0, 200, 200);
d->move(QApplication::desktop()->screenGeometry().center() - d->rect().center());
d->show();
}
}
}

② QStyle *style = widget widget->style() : QApplication::style();誰能解釋下這句話是是啥意思啊,QT

widget如果為null,則執行style=QApplication::style(),否則前面那個

③ qstyle女裝淘寶上有嗎

直接到淘寶搜索一下就知道了呀

④ CAD如何不用再彈出 「指定字體給樣式IDQSTYLE」窗口,除了更改CAD的acad.fmp文件之外呢

下載名為hzfs1.shx的字體文件,保存至AutoCAD安裝文件夾里名為Fonts的文件夾就可以徹底解決問題。

⑤ oppo ulike style u529現在成都買好多錢這款手機的功能有哪些覺得這款手機咋樣

屏幕好,像素高,其他的 也沒什麼啦,夠普通用戶使用的,但是上網的話不是很順暢,因為喜歡是非智能的。。

⑥ qstyleoption.h 什麼情況下調用

get和post是請求方式。一般get攜帶的信息量有限制,而且他的內容會在顯示欄裡面出現,不安全。post可攜帶大量數據,並且信息不回出現在顯示欄里比較安全。當實現查詢功能時適合用get。get效率比post高些。

與qstyle女裝店鋪批發相關的資料

熱點內容
牛仔童裝女裝秋天 瀏覽:314
男生卡其風衣搭配什麼褲子 瀏覽:614
濟南童裝加盟品牌有哪些 瀏覽:179
國際品牌針織圍巾 瀏覽:960
南京彩虹中國茶旗袍秀 瀏覽:435
成都哪裡可以買便宜的品牌男裝 瀏覽:183
好看的貴的潮牌 瀏覽:525
男士正裝襯衫裡面搭配背心 瀏覽:594
貌頁怎樣戴棒球帽子好看 瀏覽:958
nba外貿外套批發 瀏覽:456
心齋橋日本本土女裝 瀏覽:213
曼谷童裝在哪裡 瀏覽:272
男士睡衣什麼樣好純棉線的 瀏覽:825
童裝廣告怎麼設計圖片 瀏覽:837
童裝模特圖片女孩小裙 瀏覽:160
男裝潮牌聞柏黑色 瀏覽:449
卡瑪襯衫女長袖排行 瀏覽:19
羽絨服凈胸圍放多少尺寸 瀏覽:766
張家港哪裡有得賣旗袍 瀏覽:378
旗袍裙旗袍裙旗袍裙旗袍裙 瀏覽:787