T
T
theSever2018-03-11 01:05:12
Qt
theSever, 2018-03-11 01:05:12

Qt C++ how to pass file path to function?

I'm trying to learn C++ and I'm dumb.
I need to pass the file path ( file_name ) to the openbase function

// Меню - Файл - Открыть
void MainWindow::on_action_triggered()
{
    // диалог выбора файла
    QString file_name = QFileDialog::getOpenFileName();
}

// Подключить базу
void MainWindow::openbase(char* str)
{
    ui->listWidget->addItem(str);
}

How to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ighor July, 2018-03-11
@theSever

void openbase(const QString &str)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question