QString problem
Unsolved
General and Desktop
-
Hello,
This codes for my load button. I can use QString index10 in void MainWindow::on_load_clicked.void MainWindow::on_load_clicked() { QListWidgetItem *item10 = ui->listWidget_9->currentItem(); // process url QString index10 = ui->listWidget_9->item(sira.toDouble())->text(); ui->label_3->setText(index10); }
How can I use QString index10 here ? I want use QString index10 every where.
DWORD MainWindow::injector()
{
here
} -
@VRonin I did but still not working. Sorry Im beginner can you help me please with team wiever ?
@jondoe
Hi
put
QString index10;
in mainwinindow.hclass QListWidgetItem; // new <<<<< class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); xxxxxxx QListWidgetItem *item10; // new <<<<< private: Ui::MainWindow *ui; }; void MainWindow::on_load_clicked() { QListWidgetItem* item10 = ui->listWidget_9->currentItem(); // process url index10 = ui->listWidget_9->item(sira.toDouble())->text();// new <<<<<< ui->label_3->setText(index10); } DWORD MainWindow::injector() { index10 is known here now }
-
@VRonin I did but still not working. Sorry Im beginner can you help me please with team wiever ?
-
@jondoe Hi,
I will suggest that you learn at least the basics of C++ before using Qt.
Anyway, about your issue, in you case you can simply get the text from your label_3 control.
DWORD MainWindow::injector() { QString index10 = ui->label_3->text(); }
-
Just for update:
It crashed as mainwindow member was
used with native API CreateThread
as callback. Which never works.