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. Save as File dialog for Mac 10.9 using Qt 5.3
Qt 6.11 is out! See what's new in the release blog

Save as File dialog for Mac 10.9 using Qt 5.3

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 799 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    DivyPrakash
    wrote on last edited by
    #1

    In my application i want the Save as dialog as a sheet dialog ,so i make an instance of QFileDialog instead of using the static method getSaveFileName. When i create the instance of QFileDialog i pass all the required parameters correctly, but still when the dialog is display only the first time correct file name is displayed,there after Qt only displays "Untitled" as the file name.Even though i am providing the correct file name.
    I am using Qt 5.3
    Has anybody faced this issue?
    I already saw similar issue mentioned here : https://bugreports.qt.io/browse/QTBUG-36212 , but here again the static method is getting used.

    I did some more testing by creating a project in Qt Creator (5.3.1 Clang 5.0 ( Apple ),64 bit ),this project just has QPushButton which on clicked displays the Save as dialog box.

    The first time the output is correct:
    http://s21.postimg.org/ijydxhllj/Screen_Shot_2015_01_29_at_11_53_21.png

    Second time onwards the file name is always displayed as "Untitled":
    http://s22.postimg.org/wn3gzuz01/Issue.png

    My code is quite straight forward:
    @
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QFileDialog>
    #include <QPushButton>
    #include <QLayout>

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
    {
    QPushButton *pButton = new QPushButton( "Save As..", this );
    connect( pButton,SIGNAL(clicked()),this,SLOT(OnClicked()));
    setCentralWidget( pButton );
    }

    MainWindow::~MainWindow()
    {
    }

    void MainWindow::OnClicked()
    {
    QFileDialog *pFile = new QFileDialog
    (
    this,
    "TestApplication",
    "BoomBoom",
    ".jpg"
    );
    pFile->setAcceptMode( QFileDialog::AcceptSave );
    pFile->setWindowModality( Qt::WindowModal );
    int statusCode = pFile->exec();
    }

    @

    Edit: please use code tags around code sections; Andre

    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