Results 1 to 5 of 5

Thread: confused about QFileDialog in debug and release mode

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Sep 2011
    Posts
    24
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: confused about QFileDialog in debug and release mode

    Qt Code:
    1. void QQTScene::dropEvent(QGraphicsSceneDragDropEvent *event)
    2. {
    3. const QMimeData *mimeData = event->mimeData();
    4. QString text = mimeData->text();
    5.  
    6.  
    7. if(text == tr("文本"))
    8. {
    9. item = new QQTText(text);
    10. connect(qgraphicsitem_cast<QQTText *>(item), SIGNAL(selectedChange(QGraphicsItem*)), this, SIGNAL(itemSelected(QGraphicsItem*)));
    11. }
    12. else if(text == tr("图像"))
    13. {
    14. QString fileName;
    15. fileName = QFileDialog::getOpenFileName(0, tr("打开图片"), "",
    16. tr("Image Files (*.png *.jpg *.bmp)"));
    17.  
    18. if(!fileName.isEmpty()){
    19. QPixmap pixmap(fileName);
    20. item = new QQTImage(pixmap);
    21. QRectF r = item->boundingRect();
    22. if(r.width() > 800)
    23. {
    24. item->scale(0.5, 0.5);
    25. }
    26. //connect(qgraphicsitem_cast<QQTImage *>(item), SIGNAL(resize()), this, SLOT(resize()));
    27. /* 修改当前工作目录,使下次打开图片的时候可以减少重新选择目录的操作 */
    28. QDir::setCurrent(QFileInfo(fileName).absolutePath());
    29. }
    30. else
    31. {
    32. event->setDropAction(Qt::IgnoreAction);
    33. return;
    34. }
    35. }
    36. item->setPos(event->scenePos());
    37. addItem(item);
    38.  
    39. event->setDropAction(Qt::CopyAction);
    40. event->accept();
    41. }
    To copy to clipboard, switch view to plain text mode 
    It crashes at
    Qt Code:
    1. fileName = QFileDialog::getOpenFileName(0, tr("打开图片"), "",
    2. tr("Image Files (*.png *.jpg *.bmp)"));
    To copy to clipboard, switch view to plain text mode 

    I debug it to find that it crashes in system function
    Qt Code:
    1. void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
    2. const uchar *srcPixels, int sbpl,
    3. int w, int h,
    4. int const_alpha)
    To copy to clipboard, switch view to plain text mode 
    at line
    Qt Code:
    1. BLEND_SOURCE_OVER_ARGB32_SSE2(dst, src, w, nullVector, half, one, colorMask, alphaMask);
    To copy to clipboard, switch view to plain text mode 
    Last edited by furskytl; 23rd December 2011 at 11:07.

Similar Threads

  1. Replies: 4
    Last Post: 27th May 2010, 15:18
  2. Debug or Release mode in MAC
    By ssaa in forum Installation and Deployment
    Replies: 6
    Last Post: 9th March 2010, 05:15
  3. Replies: 1
    Last Post: 2nd November 2009, 12:02
  4. Replies: 9
    Last Post: 15th April 2009, 06:23
  5. Replies: 8
    Last Post: 10th October 2007, 18:20

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.