Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. copy
    Log in to post

    • SOLVED Override default copy/paste from QTextEdit
      General and Desktop • qtextedit qevent copy shortcut shortcutoverrid • • zespy  

      4
      0
      Votes
      4
      Posts
      756
      Views

      Unfortunately, it doesn't seems to work... actions() returns me an empty list. I think I'll go for QTextEdit::createMimeDataFromSelection() because otherwise I won't be able to deal with drag & drop (I didn't think about it :/ ) Thanks anyway!
    • SOLVED Copying a const complex data type
      C++ Gurus • copy const appending • • devDawg  

      11
      0
      Votes
      11
      Posts
      1931
      Views

      @devDawg said in Copying a const complex data type: would the best plan be to declare that data source as a C++ class I would think so, yes
    • SOLVED A custom class, a copy constructor and a warning
      General and Desktop • compiler mingw32 copy warning • • J.Hilk  

      3
      0
      Votes
      3
      Posts
      1063
      Views

      @VRonin Well apparently it is oO. Wasn't ware of that one, I came by it when googled the warning, but gave it not much mind. Thank you!
    • UNSOLVED copy file from resource to disk keeping folder structure (platform independant)
      General and Desktop • qfile qrc resource copy • • CybeX  

      7
      0
      Votes
      7
      Posts
      2323
      Views

      //copy whole <from> directory to the folder <to> void copyDirectoryNested(QString from,QString to) { QDirIterator it(from, QDirIterator::Subdirectories); while (it.hasNext()) { QString file_in = it.next(); QFileInfo file_info = QFileInfo(file_in); QString file_out = file_in; file_out.replace(from,to); if(file_info.isFile()) { //is file copy qDebug() << QFile::copy(file_in, file_out); qDebug() << file_in << "<----" << file_out; } if(file_info.isDir()) { //dir mkdir QDir dir(file_out); if (!dir.exists()) qDebug() << "mkpath"<< dir.mkpath("."); } } } then use above function : copyDirectoryNested(":/<qrc_folder_location>",<writing_location>); copyDirectoryNested(":/DefaultAppData",app_data_location);
    • UNSOLVED How to ensure that an HTML-table in QTextEdit is copied as a table when pasting into for instance Excel?
      General and Desktop • qt5.6 qtextedit html copy • • Jakob  

      5
      0
      Votes
      5
      Posts
      1290
      Views

      @raven-worx Thanx for the suggestion. I think we can go a long way with this, except that we are on Windows and it seems we need some Windows-specific MIME-conversions. We'll try to tinker a bit with that.
    • SOLVED A way to cancel a File's Copy Process
      General and Desktop • qfile copy cancel • • ars1614  

      9
      0
      Votes
      9
      Posts
      3326
      Views

      Thanks to all of you. I have no time to dedicate close to a day to implement and test a method to copy files little by little (although there have to be loads of code parts already implemented I'm sure). By the moment, If the user is copying a large list of files and wants to interrupt the process, the process will finish when it finishes to copy the current file at that moment, and will erase the previous files. If the current file is huge, the user is going to wait until the end of the copy. We know now the behaviour of the Qt copy process, so in the future if it is a problem for somebody, we will have to implement the buffer... Again, thanks!
    • UNSOLVED Copy MainWindow content and interact with it
      General and Desktop • resize mainwindow interface copy • • eduardo_parra  

      2
      0
      Votes
      2
      Posts
      719
      Views

      Hi, No, it's something you'll have to implement yourself. You'll probably have to create an event filter that will re-send any relevant event to your other windows.
    • UNSOLVED QFile::copy creates an empty file
      General and Desktop • linux qfile qt5.5.1 copy files • • Danysan  

      4
      0
      Votes
      4
      Posts
      1687
      Views

      I was having this same problem, turns out I was restarting too soon. The file transfer was so slow that took over a minute to transfer a 2Mb file. I still don't have a good solution, I am using system("cp file1 file2") for Linux as a workaround, but don't have any suggestions for a portable solution.
    • How to copy any part of the image to the other item in QML
      QML and Qt Quick • qml image scale copy opacitymask graptoimage • • Lisbetti  

      2
      0
      Votes
      2
      Posts
      1708
      Views

      Hi @Lisbetti and Welcome, AFAIK you will need some C++ API's as well for cropping the image. Once you grab the image using grapToImage call a C++ function and pass this image to it for further processing. Once you receive it on C++ side you have QImage::copy function to copy the desired part. This function too returns a QImage which you can send it to QML again for displaying. Note: If you are a beginner C++ and QML interaction may sound a bit tedious. Pls refer the fine docs for further explanation: http://doc.qt.io/qt-5/qtqml-cppintegration-topic.html http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html#exposing-methods-including-qt-slots
    • Copy ListModel or complete ListView Component
      QML and Qt Quick • listview listmodel copy • • sk2212  

      5
      0
      Votes
      5
      Posts
      2909
      Views

      Hmmm...okay, I think it works now. I will create "backup.qml" dynamically with Qt.createComponent() and createObject(root, {listModel: ListModel}). After that I access the property listModel in the created component, iterate over the current listModel which should be backuped and append that items in the listModel of the new-created component. At the end I push the new-created component on stack to be able to backup more than one "state" of the model.