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. How to put a label below a transparent QCommandLink?

How to put a label below a transparent QCommandLink?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 346 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.
  • slimhsS Offline
    slimhsS Offline
    slimhs
    wrote on last edited by
    #1

    I want to add a label below a QCommandLinkButton.
    example:

    QString button_text="Room,AREA1";
    QVBoxLayout layout=new QVBoxLayout(ui->scrollAreaWidgetContents);
    for(int i=0;i<64;i++){
    QLabel  *label[i]=new Qlabel();
    label[i]->setText("Zone 1");
    label[i]->setStyleSheet("color:rgb(58,177,75);\n"
                                 "font-family: \"Helvetica Neue LT W1G\";\n"
                                 "font-size: 14px;\n"
                                 "background-color:none;\n"
                                 "margin-top:-5px"
                                 );
    
    buttons[i]=new QCommandLinkButton();
    buttons[i]->setStyleSheet(QString::fromUtf8( "background-color: none;\n"
                                        "color:black;\n"
                                        "border: 1px solid rgb(190,190,190) ;\n"
                                        "border-width: 1px 0px 0px 0px;\n"
                                        "font-family: \"Helvetica Neue LT W1G\";\n"
                                        "font-size: 10px;\n"
                                        "text-align:center"
                                                           ));
    buttons[i]->setFocusPolicy(Qt::NoFocus);
    buttons[i]->setText(button_text.toStdString().c_str());
    
    ui->scrollAreaWidgetContents->layout()->addWidget(label[i]);
    ui->scrollAreaWidgetContents->layout()->addWidget(buttons[i]);
    
    

    But in order to get a sentence like this:

    Zone1 Room,AREA1
    

    I got this sentence:

               Room,AREA1
    Zone1
    

    How can I fix this ??

    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