Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 设置qt c++;主窗口始终位于底部mac osx_C++_Macos_Qt_Window - Fatal编程技术网

C++ 设置qt c++;主窗口始终位于底部mac osx

C++ 设置qt c++;主窗口始终位于底部mac osx,c++,macos,qt,window,C++,Macos,Qt,Window,所以我试图在qt中将这个窗口/主窗口/应用程序设置为始终位于底部(就像始终位于底部的窗口一样)(所以rainmeter通过它们的小部件不知何故做到了这一点),但我甚至无法让MacOSX做这样的事情。 我试了整个过程 这->设置窗口标志(Qt::WindowStaysOnBottomHint) 但是没有任何运气。有什么提示吗?示例代码令人惊讶。得到了坏消息和好消息。坏消息是它根本没有实现 好消息是:由于Qt是开源的,所以您可以打开它并了解这一点。如果有bug,您可以提交修复。这里是交易,在中的QW

所以我试图在qt中将这个窗口/主窗口/应用程序设置为始终位于底部(就像始终位于底部的窗口一样)(所以rainmeter通过它们的小部件不知何故做到了这一点),但我甚至无法让MacOSX做这样的事情。 我试了整个过程

这->设置窗口标志(Qt::WindowStaysOnBottomHint)


但是没有任何运气。有什么提示吗?示例代码令人惊讶。

得到了坏消息和好消息。坏消息是它根本没有实现

好消息是:由于Qt是开源的,所以您可以打开它并了解这一点。如果有bug,您可以提交修复。这里是交易,在中的
QWidget::setWindowFlags
的通用代码中 你有这个:

void QWidget::setWindowFlags(Qt::WindowFlags flags)
{
    if (data->window_flags == flags)
        return;

    Q_D(QWidget);

    if ((data->window_flags | flags) & Qt::Window) {
        // the old type was a window and/or the new type is a window
        QPoint oldPos = pos();
        bool visible = isVisible();
        setParent(parentWidget(), flags);

        // if both types are windows or neither of them are, we restore
        // the old position
        if (!((data->window_flags ^ flags) & Qt::Window)
            && (visible || testAttribute(Qt::WA_Moved))) {
            move(oldPos);
        }
        // for backward-compatibility we change Qt::WA_QuitOnClose attribute value only when the window was recreated.
        d->adjustQuitOnCloseAttribute();
    } else {
        data->window_flags = flags;
    }
}
所以本质上,它只是设置
窗口标志
。QWidget的mac行为在中

您将在该文件中找不到对
Qt::WindowStaysOnBottomHint
的引用。(您会发现
Qt::WindowStaysOnTopHint
但是…)

我将不再说“不可能,除非你要么修补Qt,要么在Qt之下”


打补丁
qwidget_mac.mm
留给读者作为练习。:-)

糟透了。但是,在Qt的辩护中,我要指出,它确实说了“提示”。这是一种表达“如果可能的话,我希望这是真的”。。。