Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Persian
  4. پر رنگ کردن(bold) متن انتخاب شده در ابزار QPlain text edit

پر رنگ کردن(bold) متن انتخاب شده در ابزار QPlain text edit

Scheduled Pinned Locked Moved Persian
1 Posts 1 Posters 1.5k Views 1 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.
  • H Offline
    H Offline
    honarvar
    wrote on last edited by
    #1

    p{direction:rtl; text-align:right}. سلام. من میخوام وقتی قسمتی از یک متن در plain text edit رو اتخاب میکنم با زدن یک دکمه اون رو پر رنگ کنم.(bold)

    @
    void MainWindow::On_Bold_clicked()
    {
    QFont bold;
    QFont normal;
    normal.setBold(false);
    bold.setBold(true);

    if(ui->action_Bold->isChecked())
        ui->plainTextEdit->setFont(bold);
    else
        ui->plainTextEdit->setFont(normal);
    

    }
    @

    p{direction:rtl; text-align:right}. این کد، تمام متن منو پر رنگ میکنه. چیکار کنم که اون قسمتی که انتخاب کردم فقط bold بشه.

    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