Hello everyone 
I'm using Qt 4.7. I want a main window of size 272x380 with a line edit widget in it of completely black color(total window and lineedit). But here i'm unable to change the color of line edit border 
Here is my code and screen shot attached....As displayed in the screenshot I need that red shaded border also black. I tried different types of code but i din't get it.Can any one please help me regarding this issue??

#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QLineEdit>
int main(int argc, char *argv[])
{
LineEdit->setStyleSheet("border: black");
//LineEdit->setStyleSheet("border: 1px solid black");
//LineEdit->setStyleSheet("QLineEdit{background: black;}");
// ("QLineEdit { background-color : rgb(45, 45, 45); }");
//LineEdit>setStyleSheet("QLineEdit{background: black;}");
window.setWindowFlags(Qt::WindowTitleHint | Qt::FramelessWindowHint);
window.setWindowTitle(" ");
window.setFixedSize(272,480);
MainWindow w;
w.show();
return a.exec();
}
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QLineEdit>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QLineEdit *LineEdit = new QLineEdit;
LineEdit->setStyleSheet("border: black");
//LineEdit->setStyleSheet("border: 1px solid black");
//LineEdit->setStyleSheet("QLineEdit{background: black;}");
// ("QLineEdit { background-color : rgb(45, 45, 45); }");
//LineEdit>setStyleSheet("QLineEdit{background: black;}");
QMainWindow window;
window.setWindowFlags(Qt::WindowTitleHint | Qt::FramelessWindowHint);
window.setWindowTitle(" ");
window.setFixedSize(272,480);
MainWindow w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent, Qt::FramelessWindowHint),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->setStyleSheet("background-color:rgb(13, 13, 13);");
// this->setStyleSheet("QLineEdit{foregroundRole-color : rgb(244, 244, 244); }");
//this->setStyleSheet("QLineEdit{border: black;}");
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
Q_OBJECT
public:
~MainWindow();
protected:
private:
Ui::MainWindow *ui;[QTCLASS][/QTCLASS]
};
#endif // MAINWINDOW_H
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
protected:
void changeEvent(QEvent *e);
private:
Ui::MainWindow *ui;[QTCLASS][/QTCLASS]
};
#endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode
Bookmarks