Searching Button Text



  • Hey all,

    New to the forums, and hope I can be of some assistance in the near future. Thank you all for having a place for development questions.

    I am making a small program where I can just have all my executables in one place. So basically I have an icon for the exe and then the button that you click to open the program on the computer.

    Question is how can I put a search feature so that when I type into the text edit line, it will find the program I am searching for? If that makes any sense anyway...

    Thank you for any help.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You can assign an object name to each of your button and search for it with QObject::findChild



  • @SGaist said in Searching Button Text:

    Hi and welcome to devnet,

    You can assign an object name to each of your button and search for it with QObject::findChild

    Thanks for the quick response. I'm very new to this, so any help is good. TYTYTY.

    void MainWindow::on_winzip_2_objectNameChanged(const QString &objectName)
    {
    QPushButton *button = parentWidget->findChild<QPushButton *>("winzip");
    }

    Does that look about close? lol... It doesn't do anything but throw an error, so I guess not. winzip is the program to be open and the object name of the button is winzip. Also, I have it in a scroll area, not a widget?


  • Moderators

    @Epiales666 Assuming you have a vector of some sort holding all your buttons, here is a simple example of searching their text:

    QPushButton *findButtonByText(const QString &search)
    {
       QList<QPushButton *> buttons; // this would be your list of 
    QPushButtons
    
        foreach (QPushButton *b, buttons)
       {
          if (b->text().contains(search, Qt::CaseInsensitive))
             return b;
       }
    
       return nullptr;
    }
    

    There are limitations to this so I wouldn't necessarily use it as is.

    1. It only returns the first button it finds that matches the text. This won't work if you have 2 buttons that contain the "search" term. It will only get the first.
    2. It searches not exact but if it contains the text, i.e. "Some Game" is the button name, and you search "game" it will match, but it will also match "me", etc.
    3. Don't just use the buttons array, it's there for example, that would be something you had to pass in or something that was declared in your class.

    This should give you enough of idea how to do it yourself. :)



  • @ambershark

    Well, spent last hour or so messing with it and hunting online. I have this so far, but probably way off course lol...

    void MainWindow::on_lineEdit_objectNameChanged(const QString &scrollArea)
    {
    QPushButton *findButtonByText(const QString &search)
    {
    QList<QPushButton *> buttons; // this would be your list of
    QPushButton *button = new QPushButton("aaalogo");
    QPushButton *button = new QPushButton("advancedinstaller");
    QPushButton *button = new QPushButton("microsoftword");
    QPushButton *button = new QPushButton("winrar");
    QPushButton *button = new QPushButton("winzip");

        foreach (QPushButton *b, buttons)
       {
          if (b->text().contains(search, Qt::CaseInsensitive))
             return b;
       }
    
       return nullptr;
    }
    

    on_lineEdit_objectNameChanged - The text area for the search
    scrollarea - The holder that holds all the buttons

    Not sure if the findbuttonbytext is a name or some function. Couldn't find anything about it. I'll do some more hunting. If someone has time to respond, thank you. If not, I'm patient and will search all night to find out how to get it working if I need to lol. Thanks all!


  • Moderators

    @Epiales666 Ok well you are creating new buttons inside the function I gave you which won't work. You should have those buttons already created by now. Probably stored in a QList or QVector or something?

    So basically you are going to search your list of buttons, check their text, compare it to your search term, then get the button if it matches.

    So you need an existing list of your buttons to search. You don't need to do the object name stuff because you are just searching based on text, not name. So you can drop that part.

    If you want later on I can write up a quick example that does it for you, or if you share your mainwindow code I can fix it for you later on tonight.



  • @ambershark said in Searching Button Text:

    @Epiales666 Ok well you are creating new buttons inside the function I gave you which won't work. You should have those buttons already created by now. Probably stored in a QList or QVector or something?

    So basically you are going to search your list of buttons, check their text, compare it to your search term, then get the button if it matches.

    So you need an existing list of your buttons to search. You don't need to do the object name stuff because you are just searching based on text, not name. So you can drop that part.

    If you want later on I can write up a quick example that does it for you, or if you share your mainwindow code I can fix it for you later on tonight.

    That would be great. Here is my mainwindow code

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QPushButton>
    #include <QtCore>
    #include <QtGui>
    
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    
    
    
        setMinimumSize(QSize(357,670));
        setMaximumSize(QSize(357,670));
    
        this->setWindowTitle("Application Pick By ME lol");
    
        QPixmap pix1("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/qtcommunity2.jpg");
        ui->qtcommunity->setPixmap(pix1);
    
        QPixmap pix2("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/qtcommunity1.jpe");
        ui->qtcommunity1_5->setPixmap(pix2);
    
        QPixmap pix3("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/microsoftword.jpe");
        ui->microsoftword->setPixmap(pix3);
    
        QPixmap pix4("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/aaalogocreator.jpe");
        ui->aaalogocreator->setPixmap(pix4);
    
        QPixmap pix5("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/imageready.jpe");
        ui->imageready->setPixmap(pix5);
    
        QPixmap pix6("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/photoshop.jpe");
        ui->photoshop->setPixmap(pix6);
    
        QPixmap pix7("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/advinstaller.jpg");
        ui->advinstaller->setPixmap(pix7);
    
        QPixmap pix8("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/advsystemcare.jpe");
        ui->advsystemcare->setPixmap(pix8);
    
        QPixmap pix9("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/apowersoftaudiorec.jpe");
        ui->apowersoftaudiorec->setPixmap(pix9);
    
        QPixmap pix10("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/autohotkey.jpe");
        ui->autohotkey->setPixmap(pix10);
    
        QPixmap pix11("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/blender.jpe");
        ui->blender->setPixmap(pix11);
    
        QPixmap pix12("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/Calendar.jpg");
        ui->Calendar->setPixmap(pix12);
    
        QPixmap pix13("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/Camera.jpe");
        ui->Camera->setPixmap(pix13);
    
        QPixmap pix14("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/Calculator.jpe");
        ui->Calculator->setPixmap(pix14);
    
        QPixmap pix15("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/animfx.jpe");
        ui->animfx->setPixmap(pix15);
    
        QPixmap pix16("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/camstudio.jpe");
        ui->camstudio->setPixmap(pix16);
    
        QPixmap pix17("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/cheatengine.jpe");
        ui->cheatengine->setPixmap(pix17);
    
        QPixmap pix18("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/clipgrab.jpe");
        ui->clipgrab->setPixmap(pix18);
    
        QPixmap pix19("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/codeblocks.jpe");
        ui->codeblocks->setPixmap(pix19);
    
        QPixmap pix20("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/daemontools.jpe");
        ui->daemontools->setPixmap(pix20);
    
        QPixmap pix21("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/datecracker.jpg");
        ui->datecracker->setPixmap(pix21);
    
        QPixmap pix22("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/chrome.jpe");
        ui->googlechrome->setPixmap(pix22);
    
        QPixmap pix23("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/xilsoft.jpg");
        ui->xilsoftavi->setPixmap(pix23);
    
        QPixmap pix24("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/xilsoft2.jpe");
        ui->xilsoftdvd->setPixmap(pix24);
    
        QPixmap pix25("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/winrar.jpe");
        ui->winrar->setPixmap(pix25);
    
        QPixmap pix26("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/winzip.jpe");
        ui->winzip->setPixmap(pix26);
    
        QPixmap pix27("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/autohotkey.jpe");
        ui->troubleshooting->setPixmap(pix27);
    
        QPixmap pix28("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/microsoftexcel.jpe");
        ui->microsoftexcel_2->setPixmap(pix28);
    
        QPixmap pix29("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/microsoftfrontpage.jpe");
        ui->microsoftfrontpage_2->setPixmap(pix29);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    
    
    
    void MainWindow::on_aaalogo_clicked()
    {
    
        system("C:/MyApps/AAAlogo.ahk");
    }
    
    void MainWindow::on_adobeimageready_clicked()
    {
        system("C:/MyApps/adobeimageready.ahk");
    }
    
    void MainWindow::on_troubleshooting_2_clicked()
    {
        system("C:/MyApps/TROUBLESHOOTING.ahk");
    }
    
    void MainWindow::on_photoshop_2_clicked()
    {
        system("C:/MyApps/adobephotoshop.ahk");
    }
    
    void MainWindow::on_qtcommunity1_clicked()
    {
        system("C:/MyApps/QTCommunity.ahk");
    }
    
    void MainWindow::on_googlechrome_2_clicked()
    {
        system("C:/MyApps/googlechrome.ahk");
    }
    
    void MainWindow::on_advancedinstall_clicked()
    {
        system("C:/MyApps/advancedinstall.ahk");
    }
    
    void MainWindow::on_winrar_2_clicked()
    {
        system("C:/MyApps/winrar.ahk");
    }
    
    void MainWindow::on_winzip_2_clicked()
    {
        system("C:/MyApps/winzip.ahk");
    }
    
    void MainWindow::on_avi2dvd_clicked()
    {
        system("C:/MyApps/xilsoftavi2dvd.ahk");
    }
    
    void MainWindow::on_dvd2mp4_clicked()
    {
        system("C:/MyApps/xilsoftdvd2mp4.ahk");
    }
    
    void MainWindow::on_microsoftword_2_clicked()
    {
        system("C:/MyApps/microsoftword.ahk");
    }
    
    void MainWindow::on_microsoftexcel_clicked()
    {
        system("C:/MyApps/microsoftexcel.ahk");
    }
    
    void MainWindow::on_microsoftfrontpage_clicked()
    {
        system("C:/MyApps/microsoftfrontpage.ahk");
    }
    
    void MainWindow::on_pushButton_13_clicked()
    {
        system("C:/MyApps/advancedsystemcare.ahk");
    }
    
    void MainWindow::on_animfx_2_clicked()
    {
        system("C:/MyApps/animfx.ahk");
    }
    
    void MainWindow::on_apowersoftaudiorec_2_clicked()
    {
        system("C:/MyApps/apowersoftaudiorec.ahk");
    }
    

    I was never able to get the code to work with the WHITE spaces... so I have to go through autohotkey program in order to run the exe programs. Frustrating to say the least. And eventually I would like to just be able to ADD the programs instead of manually having to do it, but can't do it that way if the white spaces aren't working correctly. So I'm stuck with manually adding my programs. For me I guess it works.

    Thanks again

    @ambershark edit: added code tags



  • So you can see what I"m doing...

    https://gyazo.com/a2269e3d2e7ba057b06d902c30ee9ca7



  • @ambershark

    kk, I'm up and at em. I'll still look around for examples and getter figured out. Thanks for giving me info and ways to go about it.


  • Lifetime Qt Champion

    Since you made your application with Designer, here's a variation on the suggestion of @ambershark using findChildren

    QPushButton *findButtonByText(const QString &search)
    {
    QList<QPushButton *> buttons = findChildren<QPushButton *>();
        foreach (QPushButton *b, buttons)
       {
          if (b->text().contains(search, Qt::CaseInsensitive))
             return b;
       }
    
       return nullptr;
    }
    

    You can also use the QRegularExpression overload in order for the find to be more precise but that can done later as an optimisation step.



  • @SGaist

    Thank you much. I think the problem I'm having is getting it connected to the actual interface. When I right click on the line edit, where the text would be typed to search, and then pick go to slot? Then choose the object change? Since each button has an object name.

    Trying it that way, it gives me local function definitions are illegal on the findtextbyname. As stated, I'm pretty new to all of this, but always wanted to learn. Thanks again for taking the time to reply to the question. You both have been very gracious.


  • Lifetime Qt Champion

    QLineEdit::textChanged would likely be a better signal to connect to.



  • @SGaist

    When I try it previous example:

    QPushButton *on_lineEdit_textChanged(const QString &search)
    {
    QList<QPushButton *> buttons;

    QPushButton ("aaalogo");
    
    
        foreach (QPushButton *b, buttons)
       {
          if (b->text().contains(search, Qt::CaseInsensitive))
             return b;
       }
    
       return nullptr;
    }
    

    moc_mainwindow.obj:-1: error: LNK2019: unresolved external symbol "private: void __cdecl MainWindow::on_lineEdit_textChanged(class QString const &)" (?on_lineEdit_textChanged@MainWindow@@AEAAXAEBVQString@@@Z) referenced in function "private: static void __cdecl MainWindow::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@MainWindow@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z)

    When I try it your way I have to put the void findChildren(); with it...

    void findChildren();

    QPushButton *on_lineEdit_textChanged(const QString &search)
    {
    QList<QPushButton *> buttons = findChildren<QPushButton *>();

    QPushButton ("aaalogo");
    
        foreach (QPushButton *b, buttons)
       {
          if (b->text().contains(search, Qt::CaseInsensitive))
             return b;
       }
    
       return nullptr;
    

    ERROR:

    C:\Users\dclar.DESKTOP-JTNNAGR\Desktop\test\ApplicationPicker\mainwindow.cpp:447: error: C2059: syntax error : '>'


  • Lifetime Qt Champion

    You are missing MainWindow:: in front of on_lineEdit_textChanged.



  • @SGaist

    LOL, yeah, that makes sense. Didn't notice that. tyty! As stated, I"m new to all of this. Learn Learn Learn :D

    Error

    cannot convert from 'QPushButton *' to 'MainWindow *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

    Headed to google now... Thanks for all!



  • @SGaist

    error: C2440: 'return' : cannot convert from 'QPushButton *' to 'MainWindow *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

    Sorry, didn't post all error.... Apparently something wrong with the return YAY ME lol... <sigh>


  • Moderators

    @Epiales666 Here's what you need for your definition:

    QPushButton *MainWindow::on_lineEdit_textChanged(const QString &search)

    You added MainWindow but removed the return type of QPushButton* which caused the new problem.



  • @ambershark

    Okay, I have this in my Header

    void MainWindow::on_lineEdit_textChanged(const QString &search);
    

    error on this:
    C:\Users\dclar.DESKTOP-JTNNAGR\Desktop\test\ApplicationPicker\mainwindow.h:123: warning: Function declaration MainWindow::on_lineEdit_textChanged contains extra qualification. Ignoring as signal or slot.

    Then I changed to add the qpushbutton back that I had removed in the cpp file. Thank you for that.

    QPushButton *MainWindow::on_lineEdit_textChanged(const QString &search)

    {
    QList<QPushButton *> buttons;

    QPushButton ("aaalogo");
    
    
        foreach (QPushButton *b, buttons)
       {
          if (b->text().contains(search, Qt::CaseInsensitive))
             return b;
       }
    
       return nullptr;
    }
    

    Errors:

    C:\Users\dclar.DESKTOP-JTNNAGR\Desktop\test\ApplicationPicker\mainwindow.cpp:448: error: C2556: 'QPushButton *MainWindow::on_lineEdit_textChanged(const QString &)' : overloaded function differs only by return type from 'void MainWindow::on_lineEdit_textChanged(const QString &)'

    C:\Users\dclar.DESKTOP-JTNNAGR\Desktop\test\ApplicationPicker\mainwindow.cpp:448: error: C2373: 'MainWindow::on_lineEdit_textChanged' : redefinition; different type modifiers

    Then I got to thinking, maybe I need it all in the header file? lol.... so I tried it that way and got this error:

    C:\Users\dclar.DESKTOP-JTNNAGR\Desktop\test\ApplicationPicker\mainwindow.h:138: warning: Function declaration MainWindow::on_lineEdit_textChanged contains extra qualification. Ignoring as signal or slot.

    I know I'm being dumb here, but I don't know much about coding. I am wanting to learn to do so, thus I"m a complete noob. This is a start though, and I do appreciate you both very much.


  • Moderators

    @Epiales666 Ok so it sounds like you are trying to put a return type that isn't void in a slot. That won't work.

    So your definition needs to be:

    void MainWindow::on_lineEdit_textChanged(const QString &search)

    Now your function needs to change because it can't return buttons so you would need to do whatever you want with those buttons inside that slot, or call a subsequent function to do what you need from the slot handler. When I wrote that example function it was not supposed to be a slot but rather something you called when you need to find a button based on search text.

    It's ok to be new, we all were at some point. :) It does sound like you don't know C++ at all yet though. You should probably start there before tackling something like Qt. I would recommend getting a good handle on C++ before complicating it with a huge library like Qt.


  • Moderators

    Also give me a little bit and I'll try to write up a function that will do your search and filter for you. Now that I see your code and what you are trying to do (with that screenshot).


  • Moderators

    Ok here ya go, this function should do what you need:

    void MainWindow::on_lineEdit_textChanged(const QString &search)
    {
        QList<QPushButton *> buttons = findChildren<QPushButton *>();
    
        // handle empty search by showing all buttons and exiting
        if (search.isEmpty())
        {
            foreach (QPushButton *b, buttons)
                b->show();
    
            return;
        }
    
        // search buttons for any matching "search" and hide everything not matching
        foreach (QPushButton *b, buttons)
        {
            if (b->text().contains(search, Qt::CaseInsensitive))
                b->show();
            else
                b->hide();
        }
    }
    


  • @ambershark

    Okay... Thx again hon!

    I tried the example that @SGaist gave me and got this error... why I went back to yours...

    QList<QPushButton *> buttons = findChildren<QPushButton *>();
    

    C:\Users\dclar.DESKTOP-JTNNAGR\Desktop\test\ApplicationPicker\mainwindow.cpp:191: error: C2059: syntax error : '>'

    It throws an error on the > for some reason...

    I put void findChildren(); in the header file to remove another error...

    Then new code in the CPP file placed:

    void MainWindow::on_lineEdit_textChanged(const QString &search)
    {
    QList<QPushButton *> buttons = findChildren<QPushButton *>();

    // handle empty search by showing all buttons and exiting
    if (search.isEmpty())
    {
        foreach (QPushButton *b, buttons)
            b->show();
    
        return;
    }
    
    // search buttons for any matching "search" and hide everything not matching
    foreach (QPushButton *b, buttons)
    {
        if (b->text().contains(search, Qt::CaseInsensitive))
            b->show();
        else
            b->hide();
    }
    

    }

    Now throws these errors:

    C:\Users\dclar.DESKTOP-JTNNAGR\Desktop\test\ApplicationPicker\mainwindow.cpp:190: error: C2511: 'void MainWindow::on_lineEdit_textChanged(const QString &)' : overloaded member function not found in 'MainWindow'c:\users\dclar.desktop-jtnnagr\desktop\test\applicationpicker\mainwindow.h:11:

    see declaration of 'MainWindow'

    Sorry if u're getting a headache :( I know I'm difficult... but thanks! I will be doing some C++ research as soon as I figure this thing out lol..


  • Moderators

    @Epiales666 Lol, no worries.. we'll get it working for you. Here's what I need at this point, paste the mainwindow.h and mainwindow.cpp files here for me. Use source quoting which is 3 backticks in a row at the start and end of the source code. Backticks are these `. You will need 3 to start and 3 to end.

    Then I'll see what the problem is and help you fix it.

    Also I'll check into the > error on that findChildren.



  • @ambershark

    Here's my CPP again. You guys are awesome... tytytyty I wish the forum had a code view... be much easier to ready and paste... Still trying to figure out my header file too, but I think it's just a list of voids of each of the buttons clicked...

    CPP File

    #include "ui_mainwindow.h"
    #include <QPushButton>
    #include <QtCore>
    #include <QtGui>
    #include <QObject>
    #include <QObjectList>
    
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    
        setMinimumSize(QSize(330,670));
        setMaximumSize(QSize(330,670));
    
        this->setWindowTitle("Application Pick By Epiales666");
    
        QPixmap pix1("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/qtcommunity2.jpg");
        ui->qtcommunity->setPixmap(pix1);
    
        QPixmap pix2("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/qtcommunity1.jpe");
        ui->qtcommunity1_5->setPixmap(pix2);
    
        QPixmap pix3("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/microsoftword.jpe");
        ui->microsoftword->setPixmap(pix3);
    
        QPixmap pix4("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/aaalogocreator.jpg");
        ui->aaalogocreator->setPixmap(pix4);
    
        QPixmap pix5("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/imageready.jpe");
        ui->imageready->setPixmap(pix5);
    
        QPixmap pix6("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/photoshop.jpe");
        ui->photoshop->setPixmap(pix6);
    
        QPixmap pix7("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/advinstaller.jpg");
        ui->advinstaller->setPixmap(pix7);
    
        QPixmap pix8("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/advsystemcare.jpe");
        ui->advsystemcare->setPixmap(pix8);
    
        QPixmap pix9("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/apowersoftaudiorec.jpe");
        ui->apowersoftaudiorec->setPixmap(pix9);
    
        QPixmap pix10("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/autohotkey.jpe");
        ui->autohotkey->setPixmap(pix10);
    
        QPixmap pix11("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/blender.jpe");
        ui->blender->setPixmap(pix11);
    
        QPixmap pix12("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/Calendar.jpg");
        ui->Calendar->setPixmap(pix12);
    
        QPixmap pix13("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/Camera.jpe");
        ui->Camera->setPixmap(pix13);
    
        QPixmap pix14("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/Calculator.jpe");
        ui->Calculator->setPixmap(pix14);
    
        QPixmap pix15("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/animfx.jpe");
        ui->animfx->setPixmap(pix15);
    
        QPixmap pix16("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/camstudio.jpe");
        ui->camstudio->setPixmap(pix16);
    
        QPixmap pix17("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/cheatengine.jpe");
        ui->cheatengine->setPixmap(pix17);
    
        QPixmap pix18("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/clipgrab.jpe");
        ui->clipgrab->setPixmap(pix18);
    
        QPixmap pix19("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/codeblocks.jpg");
        ui->codeblocks->setPixmap(pix19);
    
        QPixmap pix20("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/daemontools.jpe");
        ui->daemontools->setPixmap(pix20);
    
        QPixmap pix21("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/datecracker.jpg");
        ui->datecracker->setPixmap(pix21);
    
        QPixmap pix22("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/chrome.jpe");
        ui->googlechrome->setPixmap(pix22);
    
        QPixmap pix23("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/xilsoft.jpg");
        ui->xilsoftavi->setPixmap(pix23);
    
        QPixmap pix24("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/xilsoft2.jpe");
        ui->xilsoftdvd->setPixmap(pix24);
    
        QPixmap pix25("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/winrar.jpe");
        ui->winrar->setPixmap(pix25);
    
        QPixmap pix26("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/winzip.jpe");
        ui->winzip->setPixmap(pix26);
    
        QPixmap pix27("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/autohotkey.jpe");
        ui->troubleshooting->setPixmap(pix27);
    
        QPixmap pix28("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/microsoftexcel.jpe");
        ui->microsoftexcel_2->setPixmap(pix28);
    
        QPixmap pix29("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/microsoftfrontpage.jpe");
        ui->microsoftfrontpage_2->setPixmap(pix29);
    
        QPixmap pix30("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/commandprompt.jpe");
        ui->commandprompt->setPixmap(pix30);
    
        QPixmap pix31("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/movies.jpe");
        ui->movies->setPixmap(pix31);
    
        QPixmap pix32("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/iobitmalwarefighter.jpe");
        ui->iobitmalware_2->setPixmap(pix32);
    
        QPixmap pix33("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/iobituninstaller.jpe");
        ui->iobituninstall_2->setPixmap(pix33);
    
        QPixmap pix34("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/driverbooster.jpe");
        ui->driverbooster_2->setPixmap(pix34);
    
        QPixmap pix35("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/esword.jpe");
        ui->esword_2->setPixmap(pix35);
    
        QPixmap pix36("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/internetdownloadmanager.jpe");
        ui->idm_2->setPixmap(pix36);
    
        QPixmap pix37("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/fxsoundenhancer.jpg");
        ui->fxsoundenhancer_2->setPixmap(pix37);
    
        QPixmap pix38("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/idapro.jpe");
        ui->idapro_2->setPixmap(pix38);
    
        QPixmap pix39("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/freealarmclock.jpg");
        ui->alarmclock_2->setPixmap(pix39);
    
        QPixmap pix40("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/allapps.jpe");
        ui->allapps_2->setPixmap(pix40);
    
        QPixmap pix41("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/screenshootit.jpe");
        ui->screenshootit_2->setPixmap(pix41);
    
        QPixmap pix42("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/flashjigsawproducer.jpe");
        ui->flashjigsawproducer_2->setPixmap(pix42);
    
        QPixmap pix43("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/gifmoviemaker.jpe");
        ui->gifmoviemaker_2->setPixmap(pix43);
    
        QPixmap pix44("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/iskysoftvideoeditor.jpe");
        ui->iskyvideoeditor_2->setPixmap(pix44);
    
        QPixmap pix45("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/macromediadreamweaver.jpe");
        ui->macdream_2->setPixmap(pix45);
    
        QPixmap pix46("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/line.jpe");
        ui->line_2->setPixmap(pix46);
    
        QPixmap pix47("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/koplayermulti.jpe");
        ui->koplayer_2->setPixmap(pix47);
    
        QPixmap pix48("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/lastpass.jpe");
        ui->lastpass_2->setPixmap(pix48);
    
        QPixmap pix49("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/flashationmenubuilder2.jpg");
        ui->flashation_2->setPixmap(pix49);
    
        QPixmap pix50("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/recyclingbin.jpe");
        ui->RecyclingBin_2->setPixmap(pix50);
    
        QPixmap pix51("C:/Users/dclar.DESKTOP-JTNNAGR/Desktop/test/ApplicationPicker/icons/paint.jpg");
        ui->paint_2->setPixmap(pix51);
    
    }
    
    
    MainWindow::~MainWindow()
    
    {
        delete ui;
    }
    
    void MainWindow::on_lineEdit_textChanged(const QString &search)
    {
        QList<QPushButton *> buttons = findChildren<QPushButton *>();
    
        // handle empty search by showing all buttons and exiting
        if (search.isEmpty())
        {
            foreach (QPushButton *b, buttons)
                b->show();
    
            return;
        }
    
        // search buttons for any matching "search" and hide everything not matching
        foreach (QPushButton *b, buttons)
        {
            if (b->text().contains(search, Qt::CaseInsensitive))
                b->show();
            else
                b->hide();
        }
    }
    
    
    void MainWindow::on_aaalogo_clicked()
    {
        system("C:/MyApps/AAAlogo.ahk");
    }
    
    void MainWindow::on_adobeimageready_clicked()
    {
        system("C:/MyApps/adobeimageready.ahk");
    }
    
    void MainWindow::on_troubleshooting_2_clicked()
    {
        system("C:/MyApps/TROUBLESHOOTING.ahk");
    }
    
    void MainWindow::on_photoshop_2_clicked()
    {
        system("C:/MyApps/adobephotoshop.ahk");
    }
    
    void MainWindow::on_qtcommunity1_clicked()
    {
        system("C:/MyApps/QTCommunity.ahk");
    }
    
    void MainWindow::on_googlechrome_2_clicked()
    {
        system("C:/MyApps/googlechrome.ahk");
    }
    
    void MainWindow::on_advancedinstall_clicked()
    {
        system("C:/MyApps/advancedinstall.ahk");
    }
    
    void MainWindow::on_winrar_2_clicked()
    {
        system("C:/MyApps/winrar.ahk");
    }
    
    void MainWindow::on_winzip_2_clicked()
    {
        system("C:/MyApps/winzip.ahk");
    }
    
    void MainWindow::on_avi2dvd_clicked()
    {
        system("C:/MyApps/xilsoftavi2dvd.ahk");
    }
    
    void MainWindow::on_dvd2mp4_clicked()
    {
        system("C:/MyApps/xilsoftdvd2mp4.ahk");
    }
    
    void MainWindow::on_microsoftword_2_clicked()
    {
        system("C:/MyApps/microsoftword.ahk");
    }
    
    void MainWindow::on_microsoftexcel_clicked()
    {
        system("C:/MyApps/microsoftexcel.ahk");
    }
    
    void MainWindow::on_microsoftfrontpage_clicked()
    {
        system("C:/MyApps/microsoftfrontpage.ahk");
    }
    
    void MainWindow::on_pushButton_13_clicked()
    {
        system("C:/MyApps/advancedsystemcare.ahk");
    }
    
    void MainWindow::on_animfx_2_clicked()
    {
        system("C:/MyApps/animfx.ahk");
    }
    
    void MainWindow::on_apowersoftaudiorec_2_clicked()
    {
        system("C:/MyApps/apowersoftaudiorec.ahk");
    }
    
    void MainWindow::on_autohotkey_2_clicked()
    {
        system("C:/MyApps/autohotkey.ahk");
    }
    
    void MainWindow::on_blender_2_clicked()
    {
        system("C:/MyApps/blender.ahk");
    }
    
    void MainWindow::on_calculator_clicked()
    {
        system("C:/MyApps/calculator.ahk");
    }
    
    void MainWindow::on_calendar_clicked()
    {
        system("C:/MyApps/windowscalendar.ahk");
    }
    
    void MainWindow::on_camera_clicked()
    {
        system("C:/MyApps/windowscamera.ahk");
    }
    
    void MainWindow::on_camstudio_2_clicked()
    {
        system("C:/MyApps/camstudio.ahk");
    }
    
    void MainWindow::on_cheatengine_2_clicked()
    {
        system("C:/MyApps/cheatengine.ahk");
    }
    
    void MainWindow::on_clipgrab_2_clicked()
    {
        system("C:/MyApps/clipgrab.ahk");
    }
    
    void MainWindow::on_codeblocks_2_clicked()
    {
        system("C:/MyApps/codeblocks.ahk");
    }
    
    void MainWindow::on_commandprompt_2_clicked()
    {
        system("C:/MyApps/commandprompt.ahk");
    }
    
    void MainWindow::on_daemontools_2_clicked()
    {
        system("C:/MyApps/daemontools.ahk");
    }
    
    void MainWindow::on_datecracker2000_clicked()
    {
        system("C:/MyApps/datecracker2000.ahk");
    }
    
    void MainWindow::on_movies_2_clicked()
    {
        system("C:/MyApps/movieslink.ahk");
    }
    
    void MainWindow::on_qtcommunity2_clicked()
    {
        system("C:/MyApps/QTCommunity2.ahk");
    }
    
    void MainWindow::on_iobitmalware_clicked()
    {
        system("C:/MyApps/iobitmalware.ahk");
    }
    
    void MainWindow::on_iobituninstall_clicked()
    {
        system("C:/MyApps/iobituninstall.ahk");
    }
    
    void MainWindow::on_driverbooster_clicked()
    {
        system("C:/MyApps/driverbooster.ahk");
    }
    
    void MainWindow::on_esword_clicked()
    {
        system("C:/MyApps/esword.ahk");
    }
    
    void MainWindow::on_idm_clicked()
    {
        system("C:/MyApps/internetdownmanager.ahk");
    }
    
    void MainWindow::on_fxsoundenhancer_clicked()
    {
        system("C:/MyApps/fxsoundenhancer.ahk");
    }
    
    void MainWindow::on_idapro_clicked()
    {
        system("C:/MyApps/idapro.ahk");
    }
    
    void MainWindow::on_alarmclock_clicked()
    {
        system("C:/MyApps/alarmclock.ahk");
    }
    
    void MainWindow::on_allapps_clicked()
    {
        system("C:/MyApps/allapps.ahk");
    }
    
    void MainWindow::on_screenshootit_clicked()
    {
        system("C:/MyApps/screenshootit.ahk");
    }
    
    void MainWindow::on_flashjigsawproducer_clicked()
    {
        system("C:/MyApps/flashjigsawproducer.ahk");
    }
    
    void MainWindow::on_gifmoviemaker_clicked()
    {
        system("C:/MyApps/gifmoviemaker.ahk");
    }
    
    void MainWindow::on_iskyvideoeditor_clicked()
    {
        system("C:/MyApps/iskyvideoeditor.ahk");
    }
    
    void MainWindow::on_macdream_clicked()
    {
        system("C:/MyApps/macromediadreamweaver.ahk");
    }
    
    void MainWindow::on_line_clicked()
    {
        system("C:/MyApps/line.ahk");
    }
    
    void MainWindow::on_koplayer_clicked()
    {
        system("C:/MyApps/koplayermulti.ahk");
    }
    
    void MainWindow::on_lastpass_clicked()
    {
        system("C:/MyApps/lastpass.ahk");
    }
    
    void MainWindow::on_flashation_clicked()
    {
        system("C:/MyApps/flashationmenubuilder.ahk");
    }
    
    void MainWindow::on_RecyclingBin_clicked()
    {
        system("C:/MyApps/recyclingbin.ahk");
    }
    
    void MainWindow::on_paint_clicked()
    {
        system("C:/MyApps/paint.ahk");
    }
    

    Okay, for some reason it's not ending the code... so here is the Header file...

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    #include <QPushButton>
    
    #include <QMainWindow>
    
    namespace Ui {
    class MainWindow;
    }
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        explicit MainWindow(QWidget *parent = 0);
        ~MainWindow();
    
    
    
    private slots:
        void MainWindow::on_lineEdit_textChanged();
    
        void on_aaalogo_clicked();
    
        void on_adobeimageready_clicked();
    
        void on_troubleshooting_2_clicked();
    
        void on_photoshop_2_clicked();
    
        void on_qtcommunity1_clicked();
    
        void on_googlechrome_2_clicked();
    
        void on_advancedinstall_clicked();
    
        void on_winrar_2_clicked();
    
        void on_winzip_2_clicked();
    
        void on_avi2dvd_clicked();
    
        void on_dvd2mp4_clicked();
    
        void on_microsoftword_2_clicked();
    
        void on_microsoftexcel_clicked();
    
        void on_microsoftfrontpage_clicked();
    
        void on_pushButton_13_clicked();
    
        void on_animfx_2_clicked();
    
        void on_apowersoftaudiorec_2_clicked();
    
        void on_autohotkey_2_clicked();
    
        void on_blender_2_clicked();
    
        void on_calculator_clicked();
    
        void on_calendar_clicked();
    
        void on_camera_clicked();
    
        void on_camstudio_2_clicked();
    
        void on_cheatengine_2_clicked();
    
        void on_clipgrab_2_clicked();
    
        void on_codeblocks_2_clicked();
    
        void on_commandprompt_2_clicked();
    
        void on_daemontools_2_clicked();
    
        void on_datecracker2000_clicked();
    
        void on_movies_2_clicked();
    
        void on_qtcommunity2_clicked();
    
        void on_iobitmalware_clicked();
    
        void on_iobituninstall_clicked();
    
        void on_driverbooster_clicked();
    
        void on_esword_clicked();
    
        void on_idm_clicked();
    
        void on_fxsoundenhancer_clicked();
    
        void on_idapro_clicked();
    
        void on_alarmclock_clicked();
    
        void on_allapps_clicked();
    
        void on_screenshootit_clicked();
    
        void on_flashjigsawproducer_clicked();
    
        void on_gifmoviemaker_clicked();
    
        void on_iskyvideoeditor_clicked();
    
        void on_macdream_clicked();
    
        void on_line_clicked();
    
        void on_koplayer_clicked();
    
        void on_lastpass_clicked();
    
        void on_flashation_clicked();
    
        void on_RecyclingBin_clicked();
    
        void on_paint_clicked();
    
        void findChildren();
    
    
    
    private:
    
        Ui::MainWindow *ui;
    
    };
    
    #endif // MAINWINDOW_H
    

    @ambershark edit: fixed code tags :)


  • Moderators

    @Epiales666 Ok, I fixed the code tags for you, the 3 ticks at the "end" needed to be on their own line.

    I'll take a look and see what's going on.


  • Moderators

    @Epiales666 Ok, so to fix your slot definition just change this line in your header file:

    private slots:
       void MainWindow::on_lineEdit_textChanged();
    

    to be:

    private slots:
       void on_lineEdit_textChanged(const QString &);
    

    As for the findChildren, everything looks good there, so after you fix this above error give me a full build log with errors in it.



  • @ambershark

    U're awesome hon... Thank you very, very much. I've done some php coding.. actually, quite a bit of php coding for games and stuff... but my issue is I've never taking any C++ Courses or anything related. Google is my friend, and most of what I've done, I've basically been able to find code snippets and figure just about anything out when I was programming with php and mysql/mysqli... I've made several games that used bitcoin to play them if you wanted to upgrade your items and stuff. I LOVE doing things like this. I just need to really sit back and start learning C++ now.

    You are awesome, and @SGaist is awesome. There are not many places you can actually go to where people are willing to even write code for you to help you. I know that's basically what has happened. What the developer didn't write for me, I could easily write, like the commands that actually open the exe files. I had to figure a way to make it work because qt doesn't want to recognize white spaces like "Program Files"... that space messed it all up. So I just used the AHK program and wrote a script to initiate the exe file when pressing the button. So I do know how to do some. Not completely crippled lol.

    Again, thanks for the awesome help hon.



  • @ambershark said in Searching Button Text:

    void on_lineEdit_textChanged(const QString &);

    Okay, I replaced the code, and I still get that error about the > for some reason.

    C:\Users\dclar.DESKTOP-JTNNAGR\Desktop\test\ApplicationPicker\mainwindow.cpp:185: error: C2059: syntax error : '>'
    On this line:

    QList<QPushButton *> buttons = findChildren<QPushButton *>();
    

    And I tried the double quotes and several other ways to try and get the white spaces recognized. In the end, I needed the AHK program to do it for me. It's completely annoying, as I have to have one script file for EVERY button. But it's for my personal use, so it's not that big of a deal. Eventually I want to try and learn how to make a widget... I think that's it... Then have an add button that would add that widget to the mainwindow. This way I could add the exe files and save them or delete them and have it alphabetize them. I know that's WAY over my head for now, but I want to learn to do it. Sorry I'm ranting lol. U're actually online and I love to talk lol.



  • @ambershark

    So frustrating.... every where on google I've searched, that line is correctly written... but it throws that error.... grrrr

     QList<QPushButton *> buttons = findChildren<QPushButton *>();
    

    The Syntax Error: '>'

    What a mess lol....



  • @ambershark

    HAHA, I'm always messing with stuff. I've been removing and editing now for like an hour or more. I have it working. I removed the void findChildren(); from the header and it worked. lol....

    only issue is, it still shows the EMPTY buttons instead of removing them. Yeah, it removes the text and hides it, but in order to get to the exe that it's searching, I must scroll down to get to it.

    I'm assuming it's coded to just remove the text...not the buttons?

    Anyway.. thank you very much hon, and sorry for being difficult.



  • @ambershark

    Sorry, my misinformation. It's removing the buttons, but showing the icons. That is why I"m having to scroll down to get to the program. I'm going to try and write something to remove the icons as well. Wish me luck. If you feel generous, maybe you can help me get that done :)

    You are GREAT.. So thank you very much. This is what it looks like when I search for something at the bottom of the window lol...

    https://gyazo.com/1d5e0ac17d6fb50d9343c456dfd34db4



  • @ambershark

    Aha lol... I figured out how to remove the labels as well. I"m a fast learner once I get the code lol...

    Now, having the results appear at the top is the last thing. Right now they appear in the middle. It might just be as easy as aligning the scroll area, so I'll mess with it. Thank you again. I'll let you know what I come up with. YAY YOU...thx hon



  • @ambershark

    Okay hon... my last reply to you lol. I get excited when things work out and work properly :D

    This is what it looks like when I search.

    https://gyazo.com/a28eacded4f5faa1861062dde5fc6c20

    Now I have aligned the actual scroll area to be aligned to the top and the left, but that didn't work. Just need to figure out how to put the searched items at the top and not separated. Any ideas? If u're tired of me, no worries, I"ll figure it out, or make it work as is. You've been extremely wonderful. Thank you and the other guy...

    ---------{@ X Eternity


  • Moderators

    @Epiales666 Hmm, did you try setAlignment(Qt::AlignHCenter | Qt::AlignTop); ?

    I don't work with scroll areas much but that alignment should do it. It could be from hiding and showing those labels and buttons that is causing it to act weird. Not necessarily the best solution but it should work. :)

    Also if you make a custom class for your buttons that can handle the picture and the button then you wouldn't need to hide/show them separately since it would just be one object. Something for a later time once you learn a bit more. :)



  • @ambershark said in Searching Button Text:

    setAlignment(Qt::AlignHCenter | Qt::AlignTop);

    yeah, I've been working on it since I talked to you last. Haven't taken a break, and havn't figured anything out lmao...

    When I put the above in the cpp, I get this:

    C:\Users\dclar.DESKTOP-JTNNAGR\Desktop\test\ApplicationPicker\mainwindow.cpp:200: error: C3861: 'setAlignment': identifier not found


  • Moderators

    @Epiales666 Well you need your scroll area object... I don't know what it's called but I'll assume it's in your ui variable... let's just say ui->myScrollArea->setAlignment(...) that should help you. Of course replace it with the actual variable. :)

    You could probably set that in designer too somewhere. I'm not sure though I don't really use the designer. I tend to just write the code by hand.



  • @ambershark

    Makes sense... it's just scrollArea.. and I added but it doesn't actually do anything. There are no errors, but it doesn't work ... Story of my life LOL... Thanks Hon... I'm still a chuggin along working on it. :)



  • @ambershark

    I have tried this:

    ui->scrollArea->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);
    

    Maybe it's a scroll area thing. I have no idea why it won't work.



  • @ambershark

    Okay... I had the stuff snapped to the mainwindows grid, so that's why I couldn't align it properly. I rewrote the entire thing and it works now. At least mostly. Some items will show in the middle, while most of them show at the top. Not sure why it does that, but it's workable.

    And about the labels? When I do a search/filter on the labels, along with the buttons, they show up just fine without any issues. But once I put a picture in the label, they don't show anymore. Not sure why that would have anything to do with it, since it's still considered a QLabel...

    Anyway, it works as good as I can get it I think. Thank you so very much for your help.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.