Skip to content
  • 0 Votes
    2 Posts
    147 Views
    Pl45m4P

    @Joe-von-Habsburg said in Add ready widget into widget:

    I am leaving an example

    QtCreator Preferences is your example?!
    So you want something similar?!

    You could dig into QtCreator source code and check out how it's done.
    For this I would use QToolButton to populate the "menu bar" on the left and a QStackedWidget to display the content pages on the right. Actually the QStackedWidget is more like centered, as the whole window you see is divided into two sections (~15% / ~85%) for the menu and the "rest" (the QStackedWidget for the content).

    Is it Qt designer form class (.cpp && .h && .ui)?

    The "right side" is the content widget... In case of QtCreator a custom QWidget containing a QTabWidget for the Text Editor settings among many other things.
    The parent of all this is probably a QStackedWidget as I presumed above.

    What approach (with or without Designer Form) you pick to implement this has nothing to do with how it works.
    Both ways are possible.

  • 0 Votes
    5 Posts
    378 Views
    T

    Thank you all ! I think @JonB 's suggestion will do the job since my goal is more comprehensive.

  • 0 Votes
    7 Posts
    270 Views
    timob256T

    i mace this :)

    #include "dialogokno.h" DialogOkno::DialogOkno(QWidget *parent) : QWidget(parent) { // обявл элементы gl_layaout[0] = new QGridLayout(parent); gl_layaout[1] = new QGridLayout(parent); gl_layaout[2] = new QGridLayout(parent); gl_layaout[3] = new QGridLayout(parent); l_label[0] = new QLabel(parent); l_label[1] = new QLabel(parent); l_label[2] = new QLabel(parent); le_edit[0] = new QLineEdit(parent); le_edit[1] = new QLineEdit(parent); le_edit[2] = new QLineEdit(parent); le_edit[3] = new QLineEdit(parent); le_edit[4] = new QLineEdit(parent); le_edit[5] = new QLineEdit(parent); le_edit[6] = new QLineEdit(parent); // настройки элеметов (стилизация) // заполнение элементов l_label[0]->setText("hla_global"); l_label[1]->setText("hla_local"); l_label[2]->setText("logger"); le_edit[0]->setText("server_ip_global"); le_edit[1]->setText("server_port_global"); le_edit[2]->setText("server_port_local"); le_edit[3]->setText("server_port_local"); le_edit[4]->setText("log"); le_edit[5]->setText("log_period_ms"); le_edit[6]->setText("log_size_in_mb"); //разложение элементов по группам gl_layaout[0]->addWidget(l_label[0], 0, 0, 1, 1); gl_layaout[0]->addWidget(le_edit[0], 1, 0, 1, 1); gl_layaout[0]->addWidget(le_edit[1], 2, 0, 1, 1); gl_layaout[1]->addWidget(l_label[1], 0, 0, 1, 1); gl_layaout[1]->addWidget(le_edit[2], 1, 0, 1, 1); gl_layaout[1]->addWidget(le_edit[3], 2, 0, 1, 1); gl_layaout[2]->addWidget(l_label[2], 0, 0, 1, 1); gl_layaout[2]->addWidget(le_edit[4], 1, 0, 1, 1); gl_layaout[2]->addWidget(le_edit[5], 2, 0, 1, 1); gl_layaout[2]->addWidget(le_edit[6], 3, 0, 1, 1); gl_layaout[3]->addLayout(gl_layaout[0], 0,0); si_spacer[0] = new QSpacerItem(120, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); gl_layaout[3]->addItem(si_spacer[0],0,1); gl_layaout[3]->addLayout(gl_layaout[1], 0,2); si_spacer[1] = new QSpacerItem(120, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); gl_layaout[3]->addItem(si_spacer[1], 0, 3); si_spacer[2] = new QSpacerItem(20, 82, QSizePolicy::Minimum, QSizePolicy::Expanding); gl_layaout[3]->addItem(si_spacer[2],1,0); gl_layaout[3]->addLayout(gl_layaout[2], 2,0); si_spacer[3] = new QSpacerItem(20, 82, QSizePolicy::Minimum, QSizePolicy::Expanding); gl_layaout[3]->addItem(si_spacer[3],3,0); this->setLayout(gl_layaout[3]); } DialogOkno::~DialogOkno() { }

    Screenshot_20211126_185726.png

  • 0 Votes
    9 Posts
    2k Views
    R

    @kshegunov Thanks for the correct query! I've researched the links you stated and I think my problem is before theirs.
    That is why I created a new bug report -> https://bugreports.qt.io/browse/QTCREATORBUG-25686
    I hope I have made myself clear enough so they will understand the problem.

  • 0 Votes
    7 Posts
    2k Views
    P

    Are DLL(s) that are meant to be "optional plugins" that the EXE is designed to open with dlopen or (on windows) GetModuleHandle or LoadLibrary.... are those sorts of plugins suitable for use in injectors?

    Nop

    But that supposes the that executable in question is a Qt-dependent executable in the first place.
    I guess you didn't explicitly mention that yet....
    The process into which you attempt the injection... is that process any kind of Qt executable?

    Nop, it was not made with Qt.

    If not, then your injected code would (I believe) need to run a Qt event loop. Normally that would be done in the application's main.

    Im really really dumb with Qt, but i will try to do something with this information. It's just sad because i can't find any example of what i want :(

    Thanks