We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
我的代码如下:
Widget::Widget(QWidget *parent) : QMainWindow(parent) , ui(new Ui::OPLoginWidget) { ui->setupUi(this); setWindowFlag(Qt::WindowMaximizeButtonHint, false); initTitleBar(); } Widget::~Widget() { delete ui; } void Widget::initTitleBar() { auto agent = new QWK::WidgetWindowAgent(this); agent->setup(this); auto titleBar = new QWK::WindowBar(this); titleBar->setAutoFillBackground(true); auto pal = titleBar->palette(); pal.setColor(QPalette::Window, QColor::fromString("#f4f4f4")); titleBar->setPalette(pal); // title auto titleLabel = new QLabel(windowTitle(), titleBar); titleLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); auto font = titleLabel->font(); font.setPointSize(10); titleLabel->setFont(font); titleBar->setTitleLabel(titleLabel); // icon auto iconBtn = new QWK::WindowButton(); iconBtn->setObjectName("icon-button"); iconBtn->setIcon(windowIcon()); titleBar->setIconButton(iconBtn); // min, close buttons auto minBtn = new QWK::WindowButton(); minBtn->setObjectName("min-button"); titleBar->setMinButton(minBtn); auto closeBtn = new QWK::WindowButton(); closeBtn->setObjectName("close-button"); titleBar->setCloseButton(closeBtn); titleBar->setHostWidget(this); connect(titleBar, &QWK::WindowBar::closeRequested, this, &OPLoginWidget::close); connect(titleBar, &QWK::WindowBar::minimizeRequested, this, &OPLoginWidget::showMinimized); agent->setTitleBar(titleBar); agent->setSystemButton(QWK::WidgetWindowAgent::WindowIcon, iconBtn); agent->setSystemButton(QWK::WidgetWindowAgent::Minimize, minBtn); agent->setSystemButton(QWK::WidgetWindowAgent::Close, closeBtn); setMenuWidget(titleBar); StyleLoader().prefix("styles").fileName("common.qss").load(titleBar);// 加载qss文件 }
可以发现自定义标题栏的图标按钮按下后弹出的菜单的最大化一栏并没有被禁用,导致用户仍然可以通过这个来最大化窗口
The text was updated successfully, but these errors were encountered:
嗯,感谢报告,估计是内部忘记判断相关flag了
Sorry, something went wrong.
Fix #163
7fdfa6f
3e942c3
wangwenx190
No branches or pull requests
我的代码如下:
The text was updated successfully, but these errors were encountered: