Skip to content
  • 0 Votes
    2 Posts
    38 Views
    SGaistS

    Hi,

    GitHub is only a mirror of Qt's sources so what exactly did you install ?
    As for your project are you using something like cmake to manage your project ?

  • 2 Votes
    1 Posts
    34 Views
    No one has replied
  • 0 Votes
    2 Posts
    79 Views
    jeremy_kJ

    I'm minimally familiar with Quick Layouts (anchors FTW!), but the documentation says:

    Likewise, when a vertical layout has its preferred height, all child items will have their preferred heights, and when a vertical layout has its maximum height, all child items will have their maximum heights. This strategy is applied regardless of what the individual stretch factors are. As a consequence of this, stretch factors will only determine the growth rate of child items between the preferredHeight and maximumHeight range.

    Setting Layout.preferredHeight, or the item's implicitHeight, enables use of the verticalStretchFactor.

  • 0 Votes
    6 Posts
    137 Views
    Christian EhrlicherC

    The check in setColor() is not needed - if there is an oom the app will crash.

  • InnerShadow in Qt6

    Unsolved QML and Qt Quick
    1
    0 Votes
    1 Posts
    80 Views
    No one has replied
  • 0 Votes
    1 Posts
    96 Views
    No one has replied
  • 0 Votes
    6 Posts
    222 Views
    S

    @jsulm the only query i have is if OpenGL is still supported why am i observing kind of jagged lines when i use Opengl? Also am i setting the backend properly like i stated in my code above?

  • 0 Votes
    3 Posts
    101 Views
    J

    Ah yes, of course, thats makes a lot of sense.
    I'll set the item as selected, and change the way i draw a selected item to match that of a hovered item.

    Thank you i think i was trying to overcomplicate things.

  • 0 Votes
    1 Posts
    104 Views
    No one has replied
  • 0 Votes
    1 Posts
    101 Views
    No one has replied
  • 0 Votes
    1 Posts
    555 Views
    No one has replied
  • 0 Votes
    3 Posts
    557 Views
    A

    @cristian-adam Thanks for the explanation. Since it works well, I'll just leave it as is.

  • 0 Votes
    1 Posts
    184 Views
    No one has replied
  • 0 Votes
    5 Posts
    193 Views
    E

    @JonB Thanks for the explanation.

  • 0 Votes
    26 Posts
    2k Views
    A

    @jsulm it worked, thanks

  • 0 Votes
    2 Posts
    308 Views
    bibasmallB

    I have found out that this problem is mainly related to WinAPI + framelessness, not to Qt. I didn't manage to find any working WinAPI solution, for example, I've tried this one: melak47's solution. So I've chosen Qt way. This approach is not as concise as I expected from the WinAPI approach, but it works.
    Here is a code snippet describing only the necessary parts.

    .hpp

    class FramelessWindow : public QQuickWindow { Q_OBJECT QML_ELEMENT Q_PROPERTY(bool isMaximized READ isMaximized NOTIFY isMaximizedChanged) signals: void isMaximizedChanged(); public: FramelessWindow() noexcept; Q_INVOKABLE void showNormal() noexcept; Q_INVOKABLE void showMaximized() noexcept; bool isMaximized() const noexcept; private: bool eventFilter(QObject* watched, QEvent* event) override; bool nativeEvent(const QByteArray& eventType, void* message, qintptr* result) override; QRect restoredGeometry_; bool isMaximized_; };

    .cpp

    FramelessWindow::FramelessWindow() noexcept : isMaximized_ { false } { setFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMaximizeButtonHint); installEventFilter(this); SetWindowLongPtr((HWND)winId(), GWL_STYLE, WS_POPUP | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX); } void FramelessWindow::showNormal() noexcept { setGeometry(restoredGeometry_); isMaximized_ = false; emit isMaximizedChanged(); } void FramelessWindow::showMaximized() noexcept { restoredGeometry_ = geometry(); setGeometry(screen()->availableGeometry()); isMaximized_ = true; emit isMaximizedChanged(); } bool FramelessWindow::isMaximized() const noexcept { return isMaximized_; } bool FramelessWindow::eventFilter(QObject* watched, QEvent* event) { QPoint cursorPos = QCursor::pos(); qreal dpr = devicePixelRatio(); QRect draggingArea = geometry(); draggingArea.setHeight(32 * dpr); draggingArea.setY(draggingArea.y() + dpr * ResizeBorderWidth); if (draggingArea.contains(cursorPos)) { if (event->type() == QEvent::MouseButtonPress) { if (isMaximized_) { restoredGeometry_.moveTo({ QCursor::pos().x() - restoredGeometry_.width() / 2, QCursor::pos().y() - 10 }); showNormal(); } startSystemMove(); return true; } else if (isResizable_ && event->type() == QEvent::MouseButtonDblClick) { if (draggingArea.contains(cursorPos)) { if (isMaximized_) { showNormal(); } else { showMaximized(); } return true; } } else if (event->type() == QEvent::WindowStateChange && QWindow::visibility() == QWindow::Maximized) { setGeometry(screen()->availableGeometry()); isMaximized_ = true; emit isMaximizedChanged(); return true; } } return QQuickWindow::eventFilter(watched, event); } bool FramelessWindow::nativeEvent(const QByteArray& eventType, void* message, qintptr* result) { if (auto* msg = static_cast<MSG*>(message); msg->message == WM_NCCALCSIZE) { NCCALCSIZE_PARAMS& params = *reinterpret_cast<NCCALCSIZE_PARAMS*>(msg->lParam); if (params.rgrc[0].top != 0) { --params.rgrc[0].top; } *result = 0; return true; } return QQuickWindow::nativeEvent(eventType, message, result); }
  • 0 Votes
    19 Posts
    2k Views
    K
    Attempt # 10 for building on windows [SUCCESS!!]

    Started from scratch by re-downloading the source and used the subst command to make a new path to build with.

    Created a virtual drive to avoid the PATH length limit: subst a: .\qt-everywhere-src-6.6.2\ created the build folder and ran the configure.bat like the following: PS a:\build> ..\configure.bat

    Ran the command cmake --build . --parallel

    Ran the install command afterwards

    PS a:\build> cmake --build . --parallel

    No issues and everything was installed.

  • 0 Votes
    3 Posts
    231 Views
    JonBJ

    @Basile_Starynkevitch
    I don't know what your command is or how you are presently sending it to QProcess as you do not show these.

    You can normally leave the correct quoting to QProcess with an argument list. If, for some reason, you have a string and want to split it into arguments for QProcess you can use QStringList QProcess::splitCommand(QStringView command). Also void QProcess::startCommand(const QString &command, QIODeviceBase::OpenMode mode = ReadWrite) presumably uses that internally.

    Note however that you reference https://docs.gtk.org/glib/func.shell_quote.html and that says

    Quotes a string so that the shell (/bin/sh) will interpret the quoted string to mean unquoted_string.

    Quoting to a shell like /bin/sh can have its own rules. For example, echo '$HOME' and echo "$HOME" behave differently. I don't know how/whether you deal with that. And your GLib shell_quote ignores this.

  • syntax error

    Unsolved General and Desktop
    6
    0 Votes
    6 Posts
    409 Views
    JonBJ

    @a_coder
    I don't claim to understand what you are trying to achieve, but let's assume this is the way you want to go. Then I can see why the control class might need to know about the mainwindow class. But I cannot see why the latter would then need to know about the former, or what you are passing/sharing between them. If you got rid of that dependency direction you might not need your mutual references.