[Qt-creator] Odd QtCreator hang

André Hartmann andre.hartmann at iseg-hv.de
Tue Apr 17 08:17:31 CEST 2018


Hi Sean,

> I've got an odd hang with QtCreator when debugging my software.
Oh, as you are on Windows, that's the third platform that show 
clipboard-related strage effects.

We already have QTCREATORBUG-20262 and QTBUG-67729. Can you please check 
these?

Regards,
André

[1] https://bugreports.qt.io/browse/QTCREATORBUG-20262
[2] https://bugreports.qt.io/browse/QTBUG-67729

> 
> I've got the following function where I'm trying to copy the data out of a QTableView to the clipboard in a format that will allow the resulting data to be pasted directly into an Excel spreadsheet. Here's the function:
> void plotContainerWidget::slotCopyTableToClipboard()
> {
>      // select everything in table copy it to text string with
>      // '\t' separating columns and '\n' separating rows
>      if(mModel == 0)
>      {
>          return;
>      }
> 
>      int rows = mModel->rowCount();
>      int cols = mModel->columnCount();
> 
>      QString tableString;
>      for(int i=0; i < cols; ++i)
>      {
>          tableString += mModel->headerData(i, Qt::Horizontal).toString();
>          tableString += "\t";
>      }
>      tableString.chop(1); // remove extraneous tab
>      tableString += "\n";
> 
>      for(int i=0; i < rows; ++i)
>      {
>          for(int j=0; j < cols; ++j)
>          {
>              tableString += mModel->data(mModel->index(i, j), Qt::DisplayRole).toString();
>              tableString += "\t";
>          }
>          tableString.chop(1); // remove extraneous tab
>          tableString += "\n";
>      }
>      tableString.chop(1); // remove extraneous newline
>      qDebug() << tableString;
>      QClipboard* clippy = QApplication::clipboard();
>      if (!clippy)
>      {
>          return;
>      }
>      clippy->setText(tableString); // *** QT CREATOR HANGS HERE ***
>      qDebug() << "copied table to clipboard";
> }
> 
> When I execute this chunk of code within the debugger, it hangs at that QClipboard::setText() line. I first encountered it executing my code within the debugger, but without any breakpoints set. During that session, Qt Creator hung, and I had to force quit. After re-launching QtCreator, I set a breakpoint in this function and stepped through my code. The parsing is fine up until that line, the string looks good, but then Qt Creator hangs when that line setText() is executed. So this issue seems to happen whether I have any breakpoints set or not and interestingly this code does NOT hang when I choose "Run" from within Qt Creator, only when I choose "Start Debugging", even though that should still be executing the debug build of my application, just not running inside the debugger.
> 
> Qt version 5.3.2 (yes, I know this is ancient...)
> Qt Creator 4.5.2 (at least this isn't!)
> Windows 7 64-bit
> 
> Any ideas?
> Sean
> 
> 
> This message has been scanned for malware by Forcepoint. www.forcepoint.com
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
> 
> 


-- 
Dipl.-Ing. (FH) André Hartmann
Softwareentwicklung / Software Development

E-Mail: andre.hartmann at iseg-hv.de | Tel: +49 351 26996-43 | Fax: +49 351 
26996-21

iseg Spezialelektronik GmbH - HIGH VOLTAGE. EXACTLY.
iseg-hv.de | iseg-hv.com | download.iseg-hv.com

Bautzner Landstr. 23, 01454 Radeberg / Rossendorf, Germany
Geschäftsführer / Managing directors: Dr. Frank Gleisberg, Dr. Joachim 
Pöthig
Amtsgericht / Lower district court: Dresden HRB 16250
Umsatzsteuer-Id: / VAT-ID: DE812508942

News / Information
https://iseg-hv.com/en/products/control#isegControl2 isegControl2 - 
Unified Control Software
https://iseg-hv.com/en/products/detail/EHS EHS FLEX - Customize and keep 
the price
https://iseg-hv.com/en/products/detail/EHS EHS STACK - Perfect for GEM 
Detectors
https://iseg-hv.com/files/iseg-high-voltage-power-supplies.pdf NEW! 
Product catalog 2017 / 2018 released
https://iseg-hv.com/en/products/detail/NHR NHR - NIM HV-Supply with 
reversible polarity

Links
https://www.linkedin.com/company/12726924 iseg on LINKEDIN | Let's stay 
connected!
https://www.youtube.com/channel/UC5AL-ZgOqSim_1gYNnndyzQ iseg on YOUTUBE 
| Tutorials and more ...
https://www.twitter.com/iseg_hv iseg on TWITTER | please follow!
https://iseg-hv.com/files/iseg-high-voltage-power-supplies.pdf iseg 
CATALOG | download product catalog as PDF
http://download.iseg-hv.com/ iseg DOWNLOADS | manuals, software, 
firmware and more...

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte 
Informationen. Wenn Sie nicht der richtige
Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren 
Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte 
Weitergabe dieser Mail ist nicht
gestattet.

This e-mail may contain confidential and/or privileged information. If 
you are not the intended recipient
(or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the material in 
this e-mail is strictly forbidden.



More information about the Qt-creator mailing list