Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qt standard signal wont trigger custom slot
Forum Updated to NodeBB v4.3 + New Features

qt standard signal wont trigger custom slot

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 1.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anas_Deshmukh
    wrote on last edited by Anas_Deshmukh
    #1

    hi ,

    
    bool connectStat=QObject::connect(dateEdit, SIGNAL(editingFinished()), this,  SLOT(slotSetTempDateSetting(void)), Qt::QueuedConnection);
    
     qDebug() << "connectStat : " <<connectStat;
    

    in this scenario connectStat get 'true' value, but unable to invoke my customised slot.

    can anyone help me how to figure out that QDateedit->editingfinished() emited or not ? if yes then why wont respective slot invoked?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Anas_Deshmukh
      wrote on last edited by Anas_Deshmukh
      #2

      i also consider link text but unable to fix the problem.

      jsulmJ 1 Reply Last reply
      0
      • A Anas_Deshmukh

        i also consider link text but unable to fix the problem.

        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Anas_Deshmukh How do you test? You need to put the cursor in one of the spin boxes and then remove it from there (for example pressing TAB key).

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply
        0
        • jsulmJ jsulm

          @Anas_Deshmukh How do you test? You need to put the cursor in one of the spin boxes and then remove it from there (for example pressing TAB key).

          A Offline
          A Offline
          Anas_Deshmukh
          wrote on last edited by
          #4

          @jsulm i am pressing TAB key.
          I am using QDateEdit and QTimeEdit fields in dialogbox,
          need to set maxlimit for date and time field (both QDateEdit and QTimeEdit using setMaximumDate and setMaximumTime).

          test case :
          edit date for current date : both date and time wont exceed currentdate-time frame,
          when i edit yesterday date my time edit wont allow to accept 24 hrs.

          
          // my customized slot : slotSetTempDateSetting
          
          void window::slotSetTempDateSetting(void)
          {
              qDebug() << "slotSetTempDateSetting called, : ";
          
              QDateEdit* tempDateEditObj=(QDateEdit*)tempDateEditVar;
              qDebug() << "tempDateEditObj : " << tempDateEditObj->date();
          
              QTimeEdit* tempTimeEditEditObj=(QTimeEdit*)timeEditGlobalObjVar;
          
              if(tempDateEditObj->date() < QDate::currentDate()) {
                  qDebug() << "given date is less thn current date";
                  QTime tempTimeObj=QTime::fromString("23:59:59","hh:mm:ss");
                  tempTimeEditEditObj->setMaximumTime(tempTimeObj);
              }
              else {
                  qDebug() << "given date is same as current date";
                  QString qstrTimeMaxLimit=QString::fromLocal8Bit(defaultInTime);
                  QTime tempTimeObj=QTime::fromString(qstrTimeMaxLimit,"hh:mm:ss");
                  tempTimeEditEditObj->setMaximumTime(tempTimeObj);
              }
          }
          
          jsulmJ 1 Reply Last reply
          0
          • A Anas_Deshmukh

            @jsulm i am pressing TAB key.
            I am using QDateEdit and QTimeEdit fields in dialogbox,
            need to set maxlimit for date and time field (both QDateEdit and QTimeEdit using setMaximumDate and setMaximumTime).

            test case :
            edit date for current date : both date and time wont exceed currentdate-time frame,
            when i edit yesterday date my time edit wont allow to accept 24 hrs.

            
            // my customized slot : slotSetTempDateSetting
            
            void window::slotSetTempDateSetting(void)
            {
                qDebug() << "slotSetTempDateSetting called, : ";
            
                QDateEdit* tempDateEditObj=(QDateEdit*)tempDateEditVar;
                qDebug() << "tempDateEditObj : " << tempDateEditObj->date();
            
                QTimeEdit* tempTimeEditEditObj=(QTimeEdit*)timeEditGlobalObjVar;
            
                if(tempDateEditObj->date() < QDate::currentDate()) {
                    qDebug() << "given date is less thn current date";
                    QTime tempTimeObj=QTime::fromString("23:59:59","hh:mm:ss");
                    tempTimeEditEditObj->setMaximumTime(tempTimeObj);
                }
                else {
                    qDebug() << "given date is same as current date";
                    QString qstrTimeMaxLimit=QString::fromLocal8Bit(defaultInTime);
                    QTime tempTimeObj=QTime::fromString(qstrTimeMaxLimit,"hh:mm:ss");
                    tempTimeEditEditObj->setMaximumTime(tempTimeObj);
                }
            }
            
            jsulmJ Online
            jsulmJ Online
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Anas_Deshmukh said in qt standard signal wont trigger custom slot:

            qDebug() << "slotSetTempDateSetting called, : ";

            do you see this in the app output?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            A 1 Reply Last reply
            0
            • jsulmJ jsulm

              @Anas_Deshmukh said in qt standard signal wont trigger custom slot:

              qDebug() << "slotSetTempDateSetting called, : ";

              do you see this in the app output?

              A Offline
              A Offline
              Anas_Deshmukh
              wrote on last edited by
              #6

              @jsulm NO.

              1 Reply Last reply
              0
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi
                Do you have any threads u didnt tell about ?
                Im wondering why you use Qt::QueuedConnection

                1 Reply Last reply
                1
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi,

                  @Anas_Deshmukh said in qt standard signal wont trigger custom slot:

                  SLOT(slotSetTempDateSetting(void)

                  That void there looks fishy.

                  If you are using Qt 5, you might want to use the new syntax.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved