Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to effect the AreaDrop with "Qt::FramelessWindowHint" flag in Windows

How to effect the AreaDrop with "Qt::FramelessWindowHint" flag in Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 471 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MeowSprite
    wrote on last edited by
    #1

    Hello guys, I am a newer to Qt. I wanna develop a framless application. But AreaDrop in QML doesnot work with the framless application in Windows.
    my code:

    //main.qml
    import QtQuick 2.5
    
    Item {
        visible: true
        width: 640
        height: 480
    
        Rectangle {
            anchors.fill: parent
            width: 640
            height: 480
            color: "green"
    
            DropArea {
                anchors.fill: parent
                width: 640
                height: 480
                onEntered: {
                    console.log("drop enter")
                }
    
                onDropped: {
                    console.log("droped");
                }
            }
        }
    }
    
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QQuickView viewer;
        viewer.setSource(QUrl("qrc:/main.qml"));
        viewer.setFlags(Qt::FramelessWindowHint);
        viewer.setColor(QColor(Qt::transparent));
        viewer.show();
        return app.exec();
    }
    

    This code works fine in the Ubuntu, But in Windows, the file dropping is unacceptable .
    So, how can I drag a file into the frameless application in Windows.
    Thanks!!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved