KM
Katty MisikSept. 17, 2020, 8:51 a.m.
не знаю что писать в cpp
пытаюсь понять как работатет наследование
класс экшион будет показывать елекменты
проблемы в создании сpp (action)
в этой строчке:
"MenuElement()"
actionn.h
#ifndef ACTIONN_H #define ACTIONN_H #include <QWidget> #include "menuelement.h" namespace Ui { class Actionn; } class Actionn:public MenuElement, public QWidget { Q_OBJECT public: explicit Actionn(QWidget *parent = nullptr); ~Actionn(); private: Ui::Actionn *ui; }; #endif // ACTIONN_H
actionn cpp:
#ifndef ACTIONN_H #define ACTIONN_H #include <QWidget> #include "menuelement.h" namespace Ui { class Actionn; } class Actionn:public MenuElement, public QWidget { Q_OBJECT public: explicit Actionn(QWidget *parent = nullptr); ~Actionn(); private: Ui::Actionn *ui; }; #endif // ACTIONN_H
вот мой
menuelement cpp
#include "menuelement.h" QPushButton *MenuElement::getBtn() { return btn; } MenuElement::MenuElement(const QString &name, QWidget* prnt) { btn = new QPushButton(name,prnt); btn->connect(btn, &QPushButton::clicked,[=]() {doCmd();}); }
и menuelement.h
#ifndef MENUELEMENT_H #define MENUELEMENT_H #include <QPushButton> class MenuElement { QPushButton* btn; public: MenuElement(const QString& name, QWidget* prnt); virtual void doCmd()=0; QPushButton *getBtn(); }; #endif // MENUELEMENT_H
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.Do you like it? Share on social networks!
AD
- Akiv Doros
- Nov. 11, 2024, 2:58 p.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:50points,
- Rating points-4
m
- molni99
- Oct. 26, 2024, 1:37 a.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:80points,
- Rating points4
m
- molni99
- Oct. 26, 2024, 1:29 a.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:20points,
- Rating points-10
Last comments
Django - Tutorial 055. How to write auto populate field functionality Freckles because of several brand names retin a, atralin buy generic priligy
QML - Tutorial 035. Using enumerations in QML without C ++ priligy cvs 24 Together with antibiotics such as amphotericin B 10, griseofulvin 11 and streptomycin 12, chloramphenicol 9 is in the World Health Organisation s List of Essential Medici…
Qt/C++ - Lesson 052. Customization Qt Audio player in the style of AIMP It decreases stress, supports hormone balance, and regulates and increases blood flow to the reproductive organs buy priligy online safe Promising data were reported in a PDX model re…
Heap sorting algorithm The role of raloxifene in preventing breast cancer priligy precio
PyQt5 - Lesson 006. Work with QTableWidget buy priligy 60 mg 53 have been reported by Javanovic Santa et al
Now discuss on the forum
добавить qlineseries в функции buy priligy senior brother Chu He, whom he had known for many years
Всё ещё разбираюсь с кешем. priligy walgreens levitra dulcolax carbs The third ring was found to be made up of ultra relativistic electrons, which are also present in both the outer and inner rings
IscanderCheOct. 31, 2024, 3:43 p.m.
Машина тьюринга // Начальное состояние 0 0, ,<,1 // Переход в состояние 1 при пустом символе 0,0,>,0 // Остаемся в состоянии 0, двигаясь вправо при встрече 0 0,1,>…
ИМ
Реализация навигации по разделам Спасибо Евгений!
Игорь МаксимовOct. 3, 2024, 4:05 a.m.
В actionn.cpp что-то типа этого:
почти Actionn::Actionn(const QString& name, QWidget *parent) : //lista inicjalizacyjna
MenuElement(name,parent),
QWidget(parent),
ui(new Ui::Actionn)
еще лучше сначала идет QWidget потом meny element