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 Combo box UP/DOWN arrow keys not working properly

Qt Combo box UP/DOWN arrow keys not working properly

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 694 Views
  • 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.
  • Himanshu chardeH Offline
    Himanshu chardeH Offline
    Himanshu charde
    wrote on last edited by Himanshu charde
    #1

    connect(comboSize,SIGNAL(activated(int)),this,SLOT(UP_DOWN_arrow_font_changed(int)),Qt::UniqueConnection);
    connect(comboSize,SIGNAL(highlighted(QString)),this,SLOT(textSize(QString)),Qt::UniqueConnection);

    void TextEdit::UP_DOWN_arrow_font_changed(int index)
    {
    QString strCBData=comboSize->currentText();
    textSize(strCBData);
    }

    void TextEdit::textSize(const QString &p)
    {
    qDebug()<<"TextEdit::textSize() START::";
    qDebug(PriorityP1())<<"TextEdit Font Size before" << p.toInt();
    qreal pointSize =(p.toFloat()) ;
    qDebug(PriorityP3())<<"TextEdit Font Size after" << pointSize << (p.toFloat());
    if (p.toFloat() > 0)
    {
    QTextCharFormat fmt;
    bSizeChanged = true;
    fmt.setFontPointSize(pointSize);
    mergeFormatOnWordOrSelection(fmt);
    }
    qDebug()<<"TextEdit::textSize() END::";
    }

    jsulmJ 1 Reply Last reply
    0
    • Himanshu chardeH Himanshu charde

      connect(comboSize,SIGNAL(activated(int)),this,SLOT(UP_DOWN_arrow_font_changed(int)),Qt::UniqueConnection);
      connect(comboSize,SIGNAL(highlighted(QString)),this,SLOT(textSize(QString)),Qt::UniqueConnection);

      void TextEdit::UP_DOWN_arrow_font_changed(int index)
      {
      QString strCBData=comboSize->currentText();
      textSize(strCBData);
      }

      void TextEdit::textSize(const QString &p)
      {
      qDebug()<<"TextEdit::textSize() START::";
      qDebug(PriorityP1())<<"TextEdit Font Size before" << p.toInt();
      qreal pointSize =(p.toFloat()) ;
      qDebug(PriorityP3())<<"TextEdit Font Size after" << pointSize << (p.toFloat());
      if (p.toFloat() > 0)
      {
      QTextCharFormat fmt;
      bSizeChanged = true;
      fmt.setFontPointSize(pointSize);
      mergeFormatOnWordOrSelection(fmt);
      }
      qDebug()<<"TextEdit::textSize() END::";
      }

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Himanshu-charde "not working properly" - what does this mean exactly?

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

      Himanshu chardeH 1 Reply Last reply
      2
      • jsulmJ jsulm

        @Himanshu-charde "not working properly" - what does this mean exactly?

        Himanshu chardeH Offline
        Himanshu chardeH Offline
        Himanshu charde
        wrote on last edited by
        #3

        @jsulm actually when the signal is emitted by highlightened(), then the size of font is changing properly. And at the time i use keyboard UP/DOWN key for which i used activated() signal to change the content of combo box it is not working

        jsulmJ 1 Reply Last reply
        0
        • Himanshu chardeH Himanshu charde

          @jsulm actually when the signal is emitted by highlightened(), then the size of font is changing properly. And at the time i use keyboard UP/DOWN key for which i used activated() signal to change the content of combo box it is not working

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Himanshu-charde Did you make sure connect() succeeded?
          Did you make sure slot was called?
          Did p.toInt() succeed?

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

          1 Reply Last reply
          2
          • Himanshu chardeH Offline
            Himanshu chardeH Offline
            Himanshu charde
            wrote on last edited by
            #5

            yeah it is all working even textSize() function is also getting called but dont know where it is stucked

            jsulmJ 1 Reply Last reply
            0
            • Himanshu chardeH Himanshu charde

              yeah it is all working even textSize() function is also getting called but dont know where it is stucked

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Himanshu-charde So, what is the value of pointSize in qreal pointSize =(p.toFloat()) ?

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

              Himanshu chardeH 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Himanshu-charde So, what is the value of pointSize in qreal pointSize =(p.toFloat()) ?

                Himanshu chardeH Offline
                Himanshu chardeH Offline
                Himanshu charde
                wrote on last edited by
                #7

                @jsulm it depend on the current size like 17 or 18

                1 Reply Last reply
                0

                • Login

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