Forum
Sign Up

Floating windows has an additional title bar partially visible

2 years 10 months ago #1 by kmbar13
I'm using docking 3.8.0 (built with msvc2019 64 bit) and when my docks are floating the min/max/close buttons are visible above the floating dock's title bar.

I have tried setting my underlying widget with Qt::FramelessWindowHint, but it's still visible. What are the steps to make this invisible?

See attached image.
Attachments:

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #2 by Developer Machines
Could you attach screenshot what buttons you need to hide and code snippet that you tried?

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #3 by kmbar13
See the original message for the attached screenshot with a red arrow pointing the min/max/close buttons they are cut off but they are visible.

For the underlying dock's widget I used:
setWindowFlags(Qt::Window | Qt::FramelessWindowHint);

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #4 by Developer Machines
I meant what object are you using to apply this flag and how do you get it - DockMainWindow, DockWindow, DockWidgetPanel?

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #5 by kmbar13
I have a function that passes in the custom QWidget when it is loaded/started. In the constructor of the custom QWidget I'd call setWindowFlags(...).

DockWidgetPanel* panel = nullptr;

panel = m_dockPanelManager->addDockPanel(name, Qtitan::InsideDockPanelArea, nullptr);
panel->setWidget(widget);

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago - 2 years 10 months ago #6 by Developer Machines
DockWidgetPanel it is not a top level window that can holds this flag. As far as i understand the task, you need to customize the titlebar of the dock panel. There is a method for this: DockWidgetPanel::setTitleBar(anyQWidget);

Use the code below to create a custom title bar:
class CustomTitleBar : public QWidget
{
public:
    CustomTitleBar() : QWidget() {
        QHBoxLayout* layout = new QHBoxLayout(this);
        QPushButton* b = new QPushButton();
        b->setText(tr("New Button"));
        layout->addWidget(b, 1, Qt::AlignRight);
        layout->addSpacing(0);
        layout->setContentsMargins(QMargins());
    }
    
    virtual QSize minimumSizeHint() const
    {
        return QSize(30, 30);
    }
private:
protected:
};

DockWidgetPanel* panel1 = dockPanelManager()->addDockPanel(tr("Panel 1"), Qtitan::LeftDockPanelArea);
QWidget* anyWidget = new CustomTitleBar();
panel1->setTitleBar(anyWidget);



I think it should help.
Attachments:
Last edit: 2 years 10 months ago by Developer Machines.

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.182 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )