导航:首页 > 服装批发 > 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女装店铺批发相关的资料

热点内容
济南童装加盟品牌有哪些 浏览:179
国际品牌针织围巾 浏览:960
南京彩虹中国茶旗袍秀 浏览:435
成都哪里可以买便宜的品牌男装 浏览:183
好看的贵的潮牌 浏览:525
男士正装衬衫里面搭配背心 浏览:594
貌页怎样戴棒球帽子好看 浏览:958
nba外贸外套批发 浏览:456
心斋桥日本本土女装 浏览:213
曼谷童装在哪里 浏览:272
男士睡衣什么样好纯棉线的 浏览:825
童装广告怎么设计图片 浏览:837
童装模特图片女孩小裙 浏览:160
男装潮牌闻柏黑色 浏览:449
卡玛衬衫女长袖排行 浏览:19
羽绒服净胸围放多少尺寸 浏览:766
张家港哪里有得卖旗袍 浏览:378
旗袍裙旗袍裙旗袍裙旗袍裙 浏览:787
欧美亮片男装厂家 浏览:212
孕妇裤子穿在哪个部位 浏览:962