jeudi 24 février 2022

Why is this function of the inherited QWidget class considered private

define a subclass of QWidget which has a public static member function, but when I call it in other classes. clion told me it's private. This is the definition of my class

#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include <thread>
#include <QStandardItem>
#include "ui_MainWindow.h"
#include "V5RPCPP/StrategyServer.h"
#include "strategy/StrategyBase.h"

class MainWindow : public QWidget {
 Q_OBJECT

public:
  explicit MainWindow(QWidget *parent = nullptr);
  QStandardItemModel  item_model;
  static void Log(std::string message, std::string sender, Severity severity);
  void output_log(char* log);;
  static MainWindow* mainwindow;
  static MainWindow* get_mainwindow_ptr();
private:
  StrategyInterface* strategy = nullptr;
  V5RPC::StrategyServer* strategy_server = nullptr;
  Ui_MainWindow ui;
  std::unique_ptr<std::thread> server_thread = nullptr;
  pthread_t server_thread_id;
  bool is_running = false;
  private slots:
  void on_open_file_dialog_btn_clicked();
  void on_log_level_combo_box_currentIndexChanged(int index);
  void on_log_filter_line_edit_textChanged(const QString& text);
  void on_port_test_btn_clicked() const;
  void on_start_stop_btn_clicked();
  void on_side_yellow_check_box_stateChanged(int state);
  void flip_strategy_status();
  void start_strategy_server();
  void stop_strategy_server();
};

#endif

this is my call enter image description here

Aucun commentaire:

Enregistrer un commentaire