T
T
tucnak2011-08-21 12:38:42
css
tucnak, 2011-08-21 12:38:42

Qt CSS

During the layout of the design for the program, I decided to upload CSS for the first time. Here is the output:

mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

QMainWindow // 16 строчка
{
    background-color:#777; // 18 cтрочка
}


It throws two errors:

mainwindow.cpp:18: error: stray '#' in program
mainwindow.cpp:17: error: expected unqualified-id before '{' token

How to solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kharvd, 2011-08-21
@tucnak

Styles must be stored in a string or in a file. The documentation describes everything in detail: doc.qt.nokia.com/4.7/stylesheet.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question